Variables & Context
The execution context is the shared, in-memory data store that flows through a run. Rules read from it, actions write to it, and variables supply configuration that lives outside any single run.
The execution context
When a rule set runs, the engine builds a context: a map of named keys to typed values. Each entry pairs a context key with a value that carries its own data type (and a flag for whether it is secret). As rules evaluate and actions execute, they read and update this same context, so data produced early in a run is visible later in the run.
Context keys
A context key is a short identifier (up to 50 characters), such as ticket.subject or customer.tier. Dotted names are just a naming convention that helps you group related values — the key itself is treated as a single label. You choose the keys when you declare a rule set's inputs and when actions write their results.
Declaring inputs
A rule set's context definition lists the inputs it expects. Each item names a context key, gives it a data type, an optional description, and a flag (set as initial context) controlling whether it is seeded into the context at the start of a run — for example, pre-filled on a manual-run form. This definition is the contract a caller fills in when invoking the rule set. See Running Rule Sets.
How values are resolved
Wherever the engine needs a value — the right side of a condition clause, an action parameter, a piece of a JSON or XML payload — it uses a value input. A value input resolves in exactly one of three ways:
| Source | Resolves to |
|---|---|
| Context key | The current value stored under that key in the context. |
| Variable | The value of a named environment variable for the active environment. |
| Constant value | A literal value typed in directly when authoring. |
Exactly one source A value input must set one and only one of context key, variable, or constant. Setting none or more than one fails validation while you author.
Variables
Variables are named configuration values defined per environment — think API keys, base URLs, and tuning constants. They keep secrets and environment-specific settings out of your rule logic so the same rule set can run unchanged across environments. See Environments.
Extension projectsExtension projects cannot reference environment variables. Any external value an extension needs must be passed in as an extension input instead, so the extension stays self-contained.
Moving data between rules and actions
The context is how rules and actions communicate. Most actions can write their result back to a context key, where later steps pick it up. Two actions manage the context directly:
- Add to Context — writes one or more key/value pairs into the context, each value being a value input.
- Remove from Context — deletes one or more keys from the context.
Both are covered in Data & Transform Actions.