Branch Workflows with If Logic
You're the control room operator at Isla Dino. Your AI Operator can now detect emergencies and log them. But logging isn't enough - when dinosaurs escape, you need to dispatch the emergency response squad immediately!
In this final challenge, you'll add conditional logic to the sub-workflow: if there's a real emergency, format and send a dispatch order. If not, just log it and move on.
What you'll practice:
- Using the If node for conditional branching
- Comparing boolean values
- Formatting emergency dispatch messages with Edit Fields
- Converting data to file format for records
Your Task
- 1Copy the exercise below
- 2Paste into your n8n editor (Ctrl+V)
- 3Solve it — use hints if you get stuck
- 4Check the solution when done
Add emergency dispatch logic to the sub-workflow you created in Challenge 4.
- Open the sub-workflow you created in Challenge 4 (the separate workflow with the "When Executed by Another Workflow" trigger)
- Add an If node after the trigger to check if there's an emergency
- On the TRUE branch (emergency detected):
- Add an Edit Fields node to format a dispatch message
- The message should include the location, time, and dinosaur count
- Add a Convert to File node connected directly to the trigger (for logging all events). Set the operation to "Convert to CSV" to simulate appending a row to a spreadsheet
Important: Make sure the sub-workflow is both saved AND published after making changes - the tool node can only find workflows that are saved and published!
Hint: Use expressions to reference the input parameters from the trigger node.
Expected output:
- If emergency: A formatted dispatch message ready to send
- If no emergency: Just a log entry (no dispatch)
Get the exercise workflow
Create a free account to copy exercises into your n8n editor.