Module 3 Lesson 4: Connections & Branching
·Automation

Module 3 Lesson 4: Connections & Branching

Direct the flow. Master the art of connecting nodes, using the IF node for decision making, and merging data streams back together.

Module 3 Lesson 4: Connections & Branching

A linear workflow is easy to build. But real life has "Choices." Decisions are handled in n8n using Branching Nodes.

1. The IF Node (True or False)

The most common logical gate.

  • "Is the order value > $100?"
  • True: Send a personalized thank you email.
  • False: Send the standard email.

2. The Switch Node (Multi-Way)

If you have 5 different options, don't use 4 IF nodes. Use a Switch.

  • "Check the user's country."
  • Case 'US': Send to US Slack.
  • Case 'UK': Send to UK Slack.
  • Case 'FR': Send to FR Slack.
  • Default: Send to Global Slack.

3. The Merge Node (The Joiner)

Eventually, your branches need to come back together.

  • Append: Simply put the lists together.
  • Merge by Index: Join Item 1 of List A with Item 1 of List B.
  • Merge by Key: Join items where email matches. (Like a SQL JOIN).

4. Multiple Inputs (The Waiting Room)

The Merge node can be set to "Wait for all inputs."

  • Scenario: You start Item A (Get data from GitHub) and Item B (Get data from Jira).
  • The Merge node waits until BOTH are finished before moving to the next step.

Exercise: The Logic Puzzle

  1. Create a workflow with a Set node containing a variable score = 85.
  2. Add an IF node: score >= 90.
  3. If True, add a node that says "Expert."
  4. If False, add a node that says "Learner."
  5. Research: What happens if you connect one node output to TWO different next nodes? Do they both run? (Hint: Yes! It's an automatic 'Split').
  6. Why is the Merge node one of the hardest nodes to master in n8n?

Summary

Branching nodes give your automation "Intelligence." By mastering IF, Switch, and Merge, you can move away from simple scripts and build "Decision Engines" that behave differently based on the data they receive.

Next Lesson: Truth in execution: Testing and Debugging Individual Nodes.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn