Autosana has two types of variables that work together to make your flows flexible and data-driven:Documentation Index
Fetch the complete documentation index at: https://docs.autosana.ai/llms.txt
Use this file to discover all available pages before exploring further.
- Environment Variables — Static configuration (credentials, URLs, feature flags) set before runs
- Runtime Variables — Dynamic values that accumulate during execution from hooks, flow/suite overrides, and the agent itself
Environment Variables
Environment variables are key-value pairs managed in Settings > Environments. They store static configuration like API keys, test credentials, and URLs.- Reference them in flow instructions and cURL hooks using
${env:VARIABLE_NAME} - Scripts access them via standard language methods (
os.environ.get(),process.env,$VAR) - Can be stored as secrets (encrypted, never displayed in plain text)
- The agent never sees the raw variable — only the resolved value substituted into instructions
Runtime Variables
Runtime variables are dynamic values that build up during a run. They come from five sources, and all feed into the same pool:Build Variables
Attached to a specific app build, either from your CI pipeline or the dashboard. These override environment variables for all flows that run against that build. When to use: You need to pass context from your CI pipeline into flow instructions — PR numbers, branch names, feature flags, deployment URLs, or any other build-specific data. How to set them from CI (GitHub Action):variables field in the request body of /api/ci/confirm-upload, /api/ci/upload-web-build, or /api/v1/flows/run. The value can be a string ("KEY1=VALUE1,KEY2=VALUE2") or a JSON object ({"KEY1": "VALUE1"}).
How to set them from the dashboard:
- Go to Apps
- Expand the build history for an app
- Click the variables icon on any build
- Add key-value pairs and click Save Variables
pr-42) and types it into the UI.
Suite Variables
Set in the suite editor before a run. These override environment variables for all flows in the suite. When to use: You want a differentTEST_EMAIL or API_URL for a specific suite without changing the environment.
How to set them:
- Edit your suite
- Expand the Advanced dropdown
- Add key-value pairs
Flow Variables
Set in the flow editor before a run. These override both suite variables and environment variables for that specific flow. When to use: One flow in a suite needs a different value than the rest — for example, a flow that tests a different API endpoint. How to set them:- Edit your flow
- Expand the Advanced dropdown
- Add key-value pairs
Hook Exports
Hooks can export values by writingKEY=VALUE pairs to /tmp/autosana.env. These values become available to all subsequent hooks and flows in the suite.
Agent Variables
The agent can dynamically save and retrieve values during flow execution. This is useful when the data you need doesn’t exist until the agent interacts with the app. Set Variable — Tell the agent to save a value it sees on screen:- Saving a generated order ID, username, or confirmation number from the screen
- Capturing dynamic data in one step and verifying it in a later step
- Storing values that subsequent hooks or flows need
Using Variables in Instructions
Use the${env:VARIABLE_NAME} syntax to reference variables in flow instructions:
Variable Precedence
When multiple sources define the same variable name, later sources override earlier ones:| Priority | Source | Set by |
|---|---|---|
| Highest | Hook exports and agent-set variables | Hook scripts, agent using Set Variable |
| High | Flow variables | Flow editor, before the run |
| Medium | Suite variables | Suite editor, before the run |
| Low | Build variables | CI pipeline or dashboard, attached to the build |
| Lowest | Environment variables | Settings > Environments |
TEST_EMAIL=default@example.com and your suite defines TEST_EMAIL=suite@example.com, the suite value wins for all flows in that suite.
If both a hook and the agent set the same variable name, whichever runs last wins — there’s no fixed priority between them.
Cross-Flow Propagation in Suites
When flows run together in a suite, runtime variables from one flow automatically carry forward to the next. This lets you chain data across flows: Flow 1 — Agent captures data:${env:KEY}):
Examples
Example 1: Dynamic Data Capture Within a Single Flow
Capture a value from the app and verify it later in the same flow:Example 2: Passing Data Between Flows in a Suite
Flow 1 — Create an order:${env:KEY}):