Environment Variables
Use typed project environment variables in Flow code and Agent prompts.
Environment Variables store project-level configuration that Flows can read at runtime from code and Agent prompts. Open Advanced → Environment Variables to review each variable's name, type, display value, and last modification.
Select Add Variable or Create Your First Variable.
Variable settings
| Setting | What it does |
|---|---|
| Name | Sets the runtime identifier. It must start with a letter and contain only letters, numbers, and underscores. Names must be unique in the project. |
| Type: String | Stores text. |
| Type: Number | Stores a numeric value. |
| Type: Boolean | Stores true or false. |
| Type: Secret | Stores sensitive text whose normal list display is masked. Use it for credentials and tokens. |
| Type: Data | Stores a structured object. |
| Value | Supplies the value and is validated against the selected type. |
Select a variable name to edit it. Archive in the editor or Remove from the list removes it from active use.
Use variables in a Flow
Every Flow in the project can read these variables at runtime. You do not need to add them to the Start node or connect them as Flow inputs.
In a Code node:
- Turn on Allow Environment Variables in the node settings.
- Read a variable by name with
context.env:
const serviceUrl = await context.env("SERVICE_URL");
const apiKey = await context.env("VENDOR_API_KEY");
const response = await fetch(`${serviceUrl}/records`, {
headers: {
Authorization: `Bearer ${apiKey}`,
},
});
Use variables in an Agent prompt
AI Agent prompts are Handlebars templates. Reference a non-secret project
variable with {{env.VARIABLE_NAME}} in any system or user prompt message:
You support customers in {{env.SUPPORT_REGION}}.
Escalate requests with a score above {{env.ESCALATION_THRESHOLD}}.
BotDojo replaces each reference with the current project value before sending
the prompt to the model. This makes String, Number, Boolean, and Data variables
useful for shared instructions, feature flags, limits, and other configuration
that should stay consistent across agents and Flows. Render an entire Data
variable as JSON with the json helper:
Allowed support channels: {{json env.SUPPORT_CHANNELS}}
Secret variables are deliberately excluded from prompt templates and cannot be
referenced with {{env.NAME}}. Keep credentials in variables with the
Secret type and read them only from an enabled Code, Code Tool, or Code
Interpreter node that needs them.
Changing a name, type, value, or removing a variable can break every Flow that references it. Search dependent Flows before making the change. A Secret reduces accidental display but remains sensitive; never copy it into prompts, logs, screenshots, or non-secret fields.