Advanced flow control: try/catch, parallel, and merge
How to handle errors with Try / Catch, open several branches with Run in parallel, and join them back with Merge branches in your workflows.
Watch this step in the video · Flow control
What it is and when to use it
When a workflow does several things at once or calls external services, you need to control the order and what happens if something fails. Omnifox has three advanced nodes for this, all under the Actions section of the workflow editor palette:
- Try / Catch (handle errors) — detects whether the previous node failed and routes through a different output.
- Run in parallel — opens several branches from one point.
- Merge branches — brings those branches back together at a single point before continuing.
They're ideal for API calls (HTTP request), emails, or messages that can fail, and for firing several actions that don't depend on each other.
Try / Catch (handle errors)
This node reads the result of the immediately previous node and routes based on whether it succeeded or failed. That's why you must place it right after the node you want to watch (for example an HTTP request, an email, or a message).
It has two outputs:
- success (green) — the previous node finished OK.
- error (red) — the previous node returned an error or threw an exception.
On the error branch you have two variables to report what happened:
{{$error.message}}— the error text.{{$error.node}}— the ID of the node that failed.
A typical use: after an HTTP request to your CRM, add a Try / Catch; on success you continue the normal flow, and on error you notify an agent with the error message.
Run in parallel
Opens between 1 and 5 branches ("Number of branches" field). Each branch has its own output handle: b1, b2, … bN. Connect each handle to the start of its branch.
In this version the branches run sequentially in numeric order (b1, then b2, …), even though the canvas looks parallel. The end result is the same: every branch runs.
Lowering the branch counter does not delete existing edges: if you wired b3, b4, b5 and drop back to 2, those edges survive.
Merge branches
This is a synchronization (join) point. It counts the edges entering this node and only lets the flow continue once all of them have arrived. Connect the output of each parallel branch to this same node.
- If a single edge arrives, the merge acts as a pass-through.
- If a branch never arrives, the merge stays blocked indefinitely.
Steps to build a fan-out with a close
- Open the workflow editor from Automations.
- Drag a Run in parallel node and set the number of branches.
- Connect each handle (b1, b2, …) to the first action of its branch.
- Build each branch with the actions you need.
- Drag a Merge branches node and connect the final output of each branch to it.
- Continue the flow from the merge output.
Verification
Use the editor's Test run button and check the execution timeline: you should see each branch run and the merge advance only once, at the end.
If it doesn't work
- The workflow hangs at the merge: a branch never arrived. Make sure every branch ends connected to the merge, or cap it with a wait node (Wait until event) so the branch doesn't stay pending forever.
- Try / Catch always returns success: you placed it far from the node to watch. It must go immediately after it.
{{$error.message}}comes out empty: you're using it outside the error branch; those variables only exist after a real error.
Tips
- Combine Try / Catch + Merge for retries: on the error branch increment a counter with the variables node and try again.
- Keep branches independent; if one branch depends on another's result, don't use parallel, chain them instead.
Related articles
Related articles
-
Build your first workflow
Omnifox workflows automate your operation: a trigger starts the automation and action nodes do the work. Build a welcome message in minutes.
-
Workflow triggers catalog
Learn which events can start a workflow automatically in Omnifox.
-
Workflows complete guide
Workflows in depth, in 54 chapters: triggers, nodes, variables, testing, history, templates, import and export, with every setting explained and a real workflow end to end.
-
Action nodes available in workflows
Discover the actions a workflow can run automatically.
-
Conditions and branching (if/then) in a workflow
Make your flows take decisions and follow different paths based on each contact data.