Using loadPrompt() with Agent (Recommended)
The simplest way to use prompts from the portal is with loadPrompt(). It works just like openai() - no await needed!
loadPrompt()creates a lazy reference (no API call yet)- When
agent.process()runs, the prompt is fetched from the portal - Variables are rendered automatically
- Result is cached for subsequent calls
Standalone Prompts Manager
For more control, use thePrompts class directly:
Security Rules
- ✅ Can read global prompts (provided by Runflow)
- ✅ Can create/update/delete own tenant prompts
- ❌ Cannot modify global prompts
- ❌ Cannot access other tenants’ prompts