Modes
- Message
- Iterate
- Gather
- Wait
Reshape and map data from one structure to another.
Message Mode
Message is the most common mode. It takes data from previous nodes and reshapes it into a new structure. Use it to extract fields, rename keys, combine data from multiple sources, build API payloads, or set default values.How It Works
You define a JSON mapping where each key is the output field name, and each value is either a static value or a template expression that pulls data from upstream nodes.Configuration
| Setting | Description |
|---|---|
| Output Mapping | A JSON object defining the transformed output. Values support {{template}} syntax. |
Example
A previous Request node (ID1, label “Fetch User”) returned:
Common Patterns
Rename fields
Rename fields
Map an external API’s naming convention to your internal format:
Merge data from multiple nodes
Merge data from multiple nodes
Pull fields from different upstream nodes into a single object:
Build an API payload
Build an API payload
Prepare a structured body for a downstream Request node:
Set defaults and constants
Set defaults and constants
Mix dynamic and static values:
Iterate Mode
Iterate takes a list and runs every downstream node once for each item in that list. It turns a single flow execution into a loop, processing each element individually.How It Works
You point the Transform at a list from a previous node. For each item in that list, the nodes connected after the Transform execute with that single item as their input. The flow effectively “fans out” — if the list has 50 items, the downstream path runs 50 times.Configuration
| Setting | Description |
|---|---|
| Source List | A template expression pointing to the array to iterate over (e.g., {{1_Request.body.users}}) |
Example
A Request node fetches a list of 3 users:{{1_Request.body.users}}. The downstream nodes run 3 times — once with Alice’s data, once with Bob’s, once with Charlie’s. Each iteration receives the current item as its input.
Use Cases
- Sending a personalized email to each contact in a list
- Creating a ticket for every failed check in a batch
- Writing each record from an API response to a data table
- Making an individual API call per item (e.g., enriching each lead)
Iterations run sequentially by default. For large lists, keep downstream operations lightweight or use the failure path to handle individual item errors without stopping the entire loop.
Gather Mode
Gather is the counterpart to Iterate. After a fan-out, Gather collects all the individual results back into a single list so the flow can continue with the complete set.How It Works
Place a Gather Transform after a section of your flow that was fanned out by an Iterate. The Gather waits for all iterations to complete, then combines their outputs into an array. Downstream nodes receive the full collected result.Configuration
| Setting | Description |
|---|---|
| Source | The node whose iterated outputs should be collected |
Example
Continuing the example above:- Iterate fans out over 3 users
- For each user, a Request node calls an enrichment API and returns additional data
- Gather collects all 3 enrichment results into a single list
The Iterate → Gather Pattern
This is one of the most powerful patterns in Zygo:Wait Mode
Wait pauses the flow for a specified duration before continuing to the next node. Use it to add intentional delays — rate limit compliance, polling intervals, or giving an external system time to process before you check the result.Configuration
| Setting | Description |
|---|---|
| Duration | How long to pause, in seconds |
Use Cases
API rate limiting
API rate limiting
You’re calling an external API inside an Iterate loop that has a rate limit of 10 requests per second. Add a Wait node with a 1-second delay between each call to stay under the limit.
Polling for completion
Polling for completion
You trigger an async job on an external system, then need to check if it’s done. Add a Wait before the status-check Request to give the job time to complete:
- Request — trigger the job
- Wait — pause for 30 seconds
- Request — check the job status
- Condition — is it done? If not, loop back to Wait
Staggered notifications
Staggered notifications
Send a sequence of messages with delays between them — a welcome email now, a follow-up in 5 minutes, and a tips email in an hour.
Retry with backoff
Retry with backoff
After a failed request, wait before retrying. Chain multiple Wait + Request pairs with increasing durations for exponential backoff.
Output
Regardless of mode, downstream nodes reference the Transform’s output using the standard template syntax:| Mode | Output |
|---|---|
| Message | The JSON object you defined in the mapping |
| Iterate | The current item from the list (available to nodes within the loop) |
| Gather | An array containing all collected results |
| Wait | Passes through the input data unchanged |
Choosing the Right Mode
| I need to… | Use |
|---|---|
| Reshape or restructure data | Message |
| Process each item in a list individually | Iterate |
| Collect iterated results back into a list | Gather |
| Pause before the next step | Wait |
| Rename fields or build a payload | Message |
| Send an email to every user in a list | Iterate |
| Summarize results after a loop | Gather |
| Respect an API’s rate limit | Wait |