Skip to main content
All variables live on a global env object. Access them anywhere a field accepts a string using {{ env.NAME }}, or directly as env.NAME inside JavaScript steps. See Environment variables for the full list of reserved variables and how Momentic loads them at runtime.

Example

Extract a value, then use it in a later step:
extract-order-id.test.yaml

Setting variables

From JavaScript

From any step with a return value

Any step with a return value (e.g. AI extract, JavaScript) can write that value to the environment with saveAs - the editor’s Save to environment variable option. Provide a key; the step’s return value is written to env after execution.

Scope

All variables are test-scoped. Set a variable in one step; any subsequent step in the same test can read it.

Module parameters

Module parameters are variables scoped to the module’s execution. A parameter named API_KEY is available as {{ env.API_KEY }} inside that module.