Build sequential pipelines, parallel branches, and loops — and handle errors gracefully so a single step failure doesn't halt your entire automation.
Sequential steps
The simplest multi-step workflow is a linear chain: step A produces output that step B consumes, which produces output for step C, and so on. In the visual editor, this appears as a left-to-right sequence of connected nodes. Data flows automatically from each node's output to the next node's input through the expression system. Sequential workflows are easy to reason about and debug because each step runs only after the previous one succeeds. Use sequential steps whenever the order of operations matters and each step depends on the result of the one before it.
Parallel branches
When two or more steps are independent of each other, you can run them in parallel to reduce total runtime. Connect a single upstream node to multiple downstream nodes — Cotonity will execute them concurrently and wait for all branches to complete before continuing. For example, an agent that enriches a lead record might fetch data from a firmographic API and a social-profile API simultaneously, then merge the results in a downstream step. Parallel branches are subject to rate limits on external APIs, so monitor your integration quotas and add retry logic if needed.
Loops and iteration
Use a Loop node to iterate over an array of items — processing each record in a list, each file in a directory, or each row in a dataset. The Loop node exposes `{{loop.item}}` and `{{loop.index}}` expressions inside the loop body, making it easy to parameterize the actions within it. You can configure a maximum iteration count as a safety ceiling and choose between sequential iteration (one item at a time) and concurrent iteration (all items in parallel, up to a configurable concurrency limit). Loops can be nested, but deeply nested loops can make debugging difficult — consider flattening complex nested loops into separate agents that are invoked via the Invoke Agent action.
Error handling in multi-step workflows
In a multi-step workflow, a failure in one step does not automatically halt the entire run unless you configure it to do so. Each node has an On Error setting with three options: Stop Run (default), Continue with Error Output, and Retry. For critical steps where a failure means the downstream steps cannot proceed meaningfully, keep Stop Run. For optional enrichment steps where the agent should proceed even if the step fails, choose Continue with Error Output — downstream nodes will see a null or error-shaped output for that step. Configure global error notifications in the agent's settings to receive an alert whenever any run fails.