Templates and conditions
agntz uses a small templating language — handlebars-shaped, intentionally tiny — for variable interpolation in instructions, tool params, step inputs, and the output map. Conditional execution (when, until) uses the same syntax with a comparison-operator extension.
Variable interpolation
{{name}} is replaced with the resolved value from state.
Rules:
{{varName}}— replaced with the resolved value. Null renders as empty.- Dotted paths like
{{researcher.summary}}walk into a sub-agent's output. - Unresolved references (skipped steps, first loop iteration) resolve to null — they don't throw.
Conditional blocks
Blocks can be nested but cannot be parameterized — there's no {{#each}}, no helpers, no expression evaluation beyond == / !=.
Conditions in when and until
Used at step level (when) and at sequential level (until). Evaluated against the resolved state.
Operators:
| Operator | Meaning | ||
|---|---|---|---|
== | Equal | ||
!= | Not equal | ||
>, < | Numeric comparison | ||
>=, <= | Numeric comparison | ||
&& | Logical AND | ||
| ` | ` | Logical OR |
Truthiness = non-null, non-empty, non-zero. Strings, arrays, and objects are truthy if non-empty.
Special namespaces
Some {{...}} references aren't state lookups — they're resolved by the runtime against the environment or the workspace's secret store.
| Prefix | Source | Where supported |
|---|---|---|
{{env.NAME}} | process.env | Embedded; hosted is opt-in per server |
{{secrets.NAME}} | Workspace secret store | Hosted only |
In hosted mode, {{env.X}} is intentionally restricted — multi-tenant workers don't share an environment with your code. Use {{secrets.X}} for credentials and configure them in Settings → Secrets on the hosted edition.
What's not in templates
agntz's templating is deliberately small. There's no:
- arbitrary expression evaluation
- loops (
{{#each}}) - helpers / partials
- string transforms
- Math
If you need to compute something, do it in a tool agent and pin the result into state, or do it client-side before calling the agent.