Skip to main content

Documentation Index

Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

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
fileType: momentic/test/v2
id: extract-order-id
steps:
  - act: Click "Place order"
  - extract:
      goal: The order id shown in the confirmation banner
      envKey: ORDER_ID
  - assert: "A confirmation email mentioning order {{ env.ORDER_ID }} was sent"

Setting variables

From JavaScript

setVariable("USERNAME", "testuser");
setVariable("PASSWORD", Math.random().toString(36).substring(2, 15));

From any step with a return value

Steps like AI extract and JavaScript expose a Save to environment variable option. Provide a key; the step’s return value is written to env after execution.
Save to environment variable

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.