Skip to main content

Automations

Data Between Steps

How variables carry data from the trigger and earlier steps into any block, and how to pick them safely

Variables work like mail-merge fields in a letter: you write {{trigger.name}} in a block's settings, and when the run happens, Nirvai replaces it with the real value — the actual customer name from the actual event. That's how data flows through your automation: every block can reach back and use what came before it.


The three variable families​

VariableReachesExample
{{trigger...}}The data that started the run — the deal, the order, your manual input{{trigger.dealname}}, {{trigger[0].amount}}
{{steps.N.output...}}What step number N produced{{steps.3.output.summary}}
{{item...}}Inside For Each / Loop: the item being processed right now{{item.email}}

Use them anywhere you type a value: agent instructions, tool fields, database fields, and every rule builder.

One item or several​

A step's output is a list of items. When a step produced exactly one item, you can skip the position: {{steps.1.output.field}}. When it produced several, say which one: {{steps.1.output[0].field}} is the first. Files work the same way, and their details sit one level down — {{steps.1.output[0].file.name}} (see Files in Automations).


The variable picker​

You don't have to remember paths — every field that accepts variables has a picker that shows what's available from earlier steps, inserted as neat pills. Each suggestion carries a trust label:

LabelMeaning
Verified structureThe producing step promises this field exists (a structured agent output) — the safest pick
From your testSeen in the sample you captured while testing the trigger
Seen in last runExisted the last time this automation ran
UnlabeledYou typed it by hand — allowed, but nothing guarantees it exists

Try it below — click a suggestion to drop it into the Subject field as a pill:

Send email
Subject
New deal: {{trigger.dealname}}
Insert a variable
tip

The picker warns but never blocks — you can always type a path you know is coming. The labels just tell you how sure Nirvai is that it will be there.


When a variable comes out empty​

If a {{variable}} finds nothing at run time, the run does not crash — but tool and database blocks report it loudly in the run results ("N values resolved to nothing"), and fields that resolved empty are left out of database writes. If a step's output looks blank, this warning is the first thing to check.

One rule for free-form agent output​

A structured agent step exposes its individual fields. A free-form agent step exposes only its whole answer ({{steps.N.output}}) — because nothing guarantees which fields a free-written answer contains. Want fields? Give that step structured output.


Common mistakes​

MistakeBetter approach
Guessing field names by handTest the trigger first (Listen) — then the picker shows the real fields from a real event.
Reading {{steps.2.output.score}} from a free-form agentMake step 2 structured, with score as a promised field.
Using {{item...}} outside a For Each / LoopIt only exists inside those blocks; elsewhere use {{trigger...}} or {{steps...}}.

What's next​

Pass documents and images from step to step in Files in Automations, or see your variables filled in with real values in Testing & Runs.