Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Filters, Paths and Formatting

Paths: Branching Logic in Zaps

Branch one Zap into several routes with Paths: rules per path, fallback paths, evaluation order, nesting limits, comparing Paths with filters, and a runnable router stand-in.

A filter has two outcomes: continue or stop. Real processes need more: high-value orders go to a manager, small ones to a queue; sales leads go to sales, support requests to support, everything else to a catch-all. Paths give a Zap this if / else-if / else branching.

Zapier cannot run on this site. Paths may require a paid plan and their limits (number of paths, nesting depth) can change, so check current documentation. The Python blocks are labelled stand-ins that model routing.

What Paths do

A Paths step splits the Zap into named branches (Path A, Path B, ...). Each path has a rule, built like a filter with fields, operators and values. When the Zap reaches the Paths step it checks the rules, and runs the steps inside each path whose rule is true. Steps after the Paths group only run if you place them inside a path; most designs repeat shared steps in each path, or move shared work before the Paths step.

flowchart TD
  T["Trigger: new support request"] --> P{"Paths"}
  P -->|"A: message contains 'invoice'"| A["Notify finance"]
  P -->|"B: message contains 'bug'"| B["Create engineering ticket"]
  P -->|"C: fallback"| C["Post to general support"]

Each path has a rule and its own steps. A fallback path catches everything the others do not.

Rules per path

Rules work like filter rules:

  • Several rules in one path combine with AND or OR.
  • Paths are evaluated independently: more than one can be true, in which case all of those paths may run, depending on how the rules are written. Make the rules mutually exclusive when only one should run.
  • A fallback path (an "else") runs when no other path matches, where supported. If you do not define one, unmatched events simply do nothing in the Paths group.

Think carefully about overlap. If a message mentions both "bug" and "invoice", should it go to finance, engineering or both? Decide on purpose.

Path design checklist

  1. Name each path clearly: "High value order", not "Path B".
  2. Make rules exclusive when you want one result (use ranges: under 100, 100 to 999, 1000 or more).
  3. Add a fallback for unexpected data so nothing is silently dropped.
  4. Put shared steps before the Paths group.
  5. Keep paths short; if one grows large, move its work into a separate Zap.
  6. Consider that nested paths (paths inside paths) are limited and hard to read.

Paths versus filters versus lookups

Situation Tool
Continue only if a condition holds Filter
Different steps depending on a condition Paths
Map many inputs to values (for example country to sales rep) Lookup table
Different Zaps for very different processes Separate Zaps

A router with ten paths is often better as a lookup table plus one action, because the table is easier to edit.

A router: a stand-in

The code below models a Paths step with exclusive ranges plus a fallback. It prints which path each order takes.

Python Stand-in: routing orders by value

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Overlapping paths: a stand-in

Sometimes more than one path should run, and sometimes that is a bug. This stand-in makes the difference visible with keyword rules.

Python Stand-in: overlapping rules

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The "General" rule is always true, so it runs on every message when paths are independent. A fallback should run only when nothing else matched. Design the rule accordingly (for example "does not contain invoice AND does not contain bug").

Looking at the data flow

Inside a path, steps can use data from the trigger and from steps before the Paths group, but not from steps in other paths (they may not have run). If you need the same value later regardless of the route, compute it before the split.

Testing and history

  • In the editor you can test each path's steps, but the rule decides at run time which paths run. Make sure each rule is tested with matching data.
  • In Zap History, check which path ran for a real event.
  • Add a test event for every path and for the fallback.

Common mistakes

  1. Overlapping rules that fire several paths unexpectedly.
  2. No fallback, so unusual data vanishes.
  3. Paths used for something a filter does.
  4. Copying the same ten steps into every path instead of sharing steps before the split.
  5. Hidden complexity: nobody remembers what Path D is for. Name and document paths.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What do Paths add compared with a filter?

    Filters only continue or stop; paths branch into different routes.
  2. 2. Two path rules are both true for an event. What may happen?

    Paths are evaluated independently, so make rules exclusive when only one should run.
  3. 3. What is a fallback path for?

    A fallback is the else branch that catches unmatched data.
  4. 4. Where should work shared by all routes go?

    Computing shared values before the split keeps paths small and consistent.

Summary

  • Paths branch a Zap with a rule per path and optional fallback.
  • Make rules exclusive when one outcome is intended, and add a fallback.
  • Put shared steps before the split; keep paths short and well named.
  • Use filters for gates, paths for routes, and lookup tables for many mappings.

Next: Formatter: Text and Numbers