Tailflow
Skip to article
Browse documentation

Build a flow

Templates and event fields

Insert event data and earlier outputs without guessing field names.

Insert a value

Use {{ event.field }} in message fields that support templates. Select an example and click a field in the event shape: that copies it with its braces, ready to paste. Right-click a field to copy only its path, for a filter or inside an expression you have already opened. A source’s fields differ from those of other sources.

Nested fields use dots, and array positions start at zero: {{ event.logs.0.address }}. The input.event and input.actions aliases also work in templates.

Message Template Editor and Preview
1Event shape
2Message
Rendered
125000 USDC moved
Example. Copy a field’s path from the event shape, insert it in the message, and check the rendered value before enabling.Changes stay in this example. Nothing is saved or sent.

Use an earlier action

Outputs use actions followed by the action type and its count within the path, such as actions.transform_1 or actions.agent_1. The inspector shows the current key.

Only earlier outputs from this path are available. Reordering two actions of the same type or deleting one can change the numbering. Retest downstream messages after editing.

Email Configuration with Transform Output
Transform · Output
actions.transform_1.summary
125000 USDC transferred
actions.transform_1.link
https://example.com/transaction
Email · Body
Rendered
125000 USDC transferred https://example.com/transaction
Example. Select an output from the earlier Transform action, then test the message. The action must be above the message on the same path.Changes stay in this example. Nothing is saved or sent.

Arithmetic and number formatting

Templates support arithmetic on numeric values. Division keeps up to 18 fractional digits and truncates. For example, {{ event.value_decimal / 1000 }} expresses an amount in thousands.

Shape a number with a function: {{ format(event.value_decimal, 2) }} writes 7,000,000.00, with separators and exactly two decimals. round, floor and ceil take the same two inputs and leave the separators out: {{ round(event.price_usd, 2) }}. abs removes the sign. Functions and arithmetic combine: {{ format(event.value_decimal * actions.token_price_1.usdc.price_usd, 2) }}.

An unknown field renders empty and is reported as unresolved in previews. Division by zero or a nonnumeric operand also cannot produce a valid value. Fix these warnings before enabling, or give the value a fallback.

Every operator and function, with examples, is in Fallbacks, math, and number formatting.

Message Preview with an Unresolved Field
Event shape
token_symbol
USDC
value_decimal
125000
Email · Body
Rendered
transfer
Unresolved: event.symbol
Example. Check the exact path against Event shape. Replace the unresolved name with token_symbol before enabling.Changes stay in this example. Nothing is saved or sent.

Optional data

Inspect several examples where possible. A sale price, USD estimate, or metadata field present on one event may be absent on another. Add a fallback with two bars: {{ event.token.symbol || event.token.address }} uses the address when the token has no symbol, and {{ event.collection.name || "an unnamed collection" }} uses the text. Fallback text goes in quotes. A fallback applies when the value is missing or empty, never when it is 0.

In a batch, use event.count, event.events, and batch summary fields. Do not assume a single transfer’s transaction link or wallet fields exist at the top level.

Template With a Fallback for a Missing Value
Email · Body
Preview
With an estimate
Worth 7,000,000.00
Without one
Worth an unpriced amount
Example. Add a fallback after two bars. It is used when the value is missing or empty, and the message says so in words you chose.Changes stay in this example. Nothing is saved or sent.