Configuration File
Create a.runflow/rf.json file:
.runflow/rf.json in the current directory and parent directories.
Using config outside the SDK
By default, the SDK readsrf.json internally when creating agents and API clients. But if you need the config available to external tools (Promptfoo, custom test scripts, CI pipelines, or any Node.js process), add a single import:
.runflow/rf.json and sets the following environment variables in process.env:
| rf.json field | Environment variable |
|---|---|
apiUrl | RUNFLOW_API_URL |
apiKey | RUNFLOW_API_KEY |
tenantId | RUNFLOW_TENANT_ID |
agentId | RUNFLOW_AGENT_ID |
Examples
Promptfoo config:promptfooconfig.ts
test.ts
scripts/check-agent.ts
init is idempotent — safe to import multiple times from different files. It reads rf.json once and skips subsequent calls.Configuration Priority
- Explicit config in code
.runflow/rf.json- Environment variables
- Defaults
Next Steps
Environment Variables
Learn about environment variables
API Client
Manual API client setup