Variable Resolution
Scripts and request fields share a single placeholder syntax: {{varName}} for environment variables and {{flow.varName}}for flow variables. Understanding how those placeholders are resolved — and when — avoids most "why is my variable empty"surprises.
Two Stores, Two Prefixes
- •{{varName}} — environment variables. Resolved from the active environment (live context first, then any static stored value).
- •{{flow.varName}} — flow variables. Resolved from the flow store for the current run (values set via at.flow.set, plus any extracted values from previous steps).
When Placeholders Are Resolved
The two main times placeholders come up:
- •Inside request fields (URL, headers, body, query params, auth, assertion expected values): resolved at request-build time — after any pre-script has run. A pre-script that calls at.environment.set can affect the resolved URL of the same request.
- •Inside lifecycle script bodies (Before All / After All): {{random.*}} placeholders are resolved inside the script text itself, right before execution. Regular {{var}} and {{flow.var}} placeholders in lifecycle script bodies are not resolved — use at.environment.get() / at.flow.get() instead.
- •Inside pre-script and post-script bodies: no placeholders are resolved — not environment, not flow, not random. Use the at.* API to read and write values from script code.
If you accidentally type "{{token}}"literally inside a pre-script, the script runtime notices it on error and suggests switching to at.environment.get("token")in the error output.
Unresolved Variables
If a placeholder inside a request field cannot be found in any store, the request is not sent — Atrahasis collects every missing variable and surfaces an error before the HTTP call is made:
Unresolved variable(s): {{token}}, {{user_id}}Fix the missing variable in the active environment (or set it from an earlier script) and re-run. This early failure exists on purpose: sending a request with a literal {{token}} in the header would almost always be a bug.
Example — Mixed Environment and Flow Variables
// URL with both environment and flow variables:
// {{base_url}}/api/users/{{flow.userId}}/posts
//
// Resolution at send time:
// {{base_url}} → from at.environment → "https://api.example.com"
// {{flow.userId}} → from at.flow → "42"
//
// Final URL: https://api.example.com/api/users/42/posts