Lesson 3 of 6 · 25 min

Conditional Branching in Workflows: If This, Then That

Send work down different paths based on what earlier steps found.

In this lesson1. Conditions depend on earlier results2. Design both paths on purpose3. Keep conditions readable4. Worked example: contracts with and without issues5. Common branching mistakes

Conditions depend on earlier results

A condition checks a value and chooses a path. The value must exist by the time the condition runs, so place conditions after the step that produces it. A contract review produces the number of issues found; a website scan produces a score; a new client record carries an amount. A common mistake is a condition at the start of a workflow that checks something nothing has measured yet.

Design both paths on purpose

Every condition has a Yes path and a No path, and both deserve thought. For a contract: if issues are found, give a person a task to review the flagged clauses; if not, send it for signature with reminders. For an amount: above the limit, ask for approval; below, proceed automatically. Make sure both paths reach a clear end, and that steps on the path not taken are shown as not run, so people reading the history are not confused.

  • Place the condition after the step that measures the value
  • Give the Yes path and the No path a clear end
  • Show steps on the untaken path as not run
  • Keep conditions simple: one value, one comparison

Keep conditions readable

Write conditions in words a client can read: issues found more than zero, amount more than five lakh, client email is known. Avoid stacking many conditions in one box; chain simple ones instead. Readable conditions make it easy for the client to trust and adjust the workflow without calling you.

Worked example: contracts with and without issues

A legal operations workflow starts when a contract is added. The review step reports how many clauses differ from the playbook. A condition checks issues found more than zero. On Yes, a lawyer gets a task to look at the flagged clauses before anything else happens. On No, the contract goes for signature with reminders every three days.

In the run history, the lawyer task shows as not run for clean contracts, so nobody wonders why it was skipped.

Common branching mistakes

Conditions are simple to add and easy to get wrong. A quick test run with sample data that hits each path catches most errors.

  • Checking a value before any step produced it
  • A path that never reaches an end
  • Several comparisons in one condition
  • Not testing both paths
Key takeaways
  • Put conditions after the step that produces the value.
  • Design both paths to a clear end.
  • Show untaken steps as not run in the history.
  • Keep each condition to one readable comparison.
Try it

Add one condition to your mapped process. Name the step that produces its value, write the condition in plain words and sketch both paths to their ends.

Check your understanding

1. Where should a condition be placed?

2. What should happen to steps on the path not taken?

3. How should conditions be written?

← PreviousWorkflow Triggers and Webhooks ExplainedNext lesson →Human in the Loop: Where to Put Approvals
XDQ Partner Network

Turn what you learn into monthly income

Resell AI agents and apps under your own brand. Up to 30% off credits, up to 30% recurring share, and apps built by XDQ Labs for your clients. Free to join.

Partner NetworkFor developer agenciesFor resellersFor consultantsWhite-label buildsDeal registration
Join the Partner Network free →
XDQ xAgents · AI lab for your company
While you sleep, your AI agents keep working.

From USD 49 or INR 2,999 a month. A person approves every step.

Start free, 14 days →See every agent300 credits · no card needed · prices include taxes🚀 Startup? Free landing page for 30 days →Need custom software or a security review? Send a brief →
Practise this lesson

Templates from our playbooks

Copy ready templates with when to use each one and why it works.

Playbook · Agency growthThe Agency LinkedIn Growth System: Positioning, a Weekly Content Engine, 10 Post Hooks and 40 Outreach MessagesFor software, AI and digital agencies. How to pick a niche, set up founder and team profiles, publish three posts a week, use hiring posts for reach, and start conversations with 40 messages for clients and partners.50 templates · 27 min readOpen the playbook →Playbook · Agency growthReach Beyond LinkedIn: A Channel by Channel Growth Plan for Agencies and ResellersGoogle Business Profile, WhatsApp Business, YouTube, Instagram, communities, directories, job platforms, partnerships, events, email and AI search. What each channel is good for, how to start, and 25 ready posts and captions.25 templates · 24 min readOpen the playbook →Playbook · Reselling software40 Sales Scripts for Software Resellers: Calls, WhatsApp, Demos, Objections and RenewalsFor people reselling software to small and mid sized businesses in India. Call openers, WhatsApp messages for warm leads, demo and no show scripts, objection replies, closing, onboarding and renewal scripts.40 templates · 25 min readOpen the playbook →