AI UX PlaygroundNewsletterJoin 2K+ AI designers and PMs on Substack. New teardowns, patterns, and prompts as they drop.

Agents

Conditional Logic & Branching

Branch a workflow with if/else rules based on model output, tool results, or user state. Automation adapts instead of following one rigid script.

Interactive demo

Conditional Logic
Input Value
75
Condition: Value > 50?
Yes → Action A
No → Action B

Overview

How might we design conditional logic & branching so people can trust and act on AI output?

When to use

  • Ideal for automation platforms, workflow tools, and integration systems where conditional branching enables intelligent, adaptive automation workflows.

When to skip

  • Single-step prompts with no branching need.
  • Flows so complex that a visual graph becomes unmaintainable. Split into subflows.
  • High-stakes decisions that still need a human gate at every branch.

Rules

  • Hidden branches that fire with no preview in the builder.

  • Conditions written only in code with no readable summary.

  • Infinite loops with no max-iteration guard.

  • Branch labels that do not match the actual predicate.

Evidence

ProductImplementation
ZapierPaths and filters that branch automations on field values.
MakeRouters and conditional modules in scenario graphs.
n8nIF and Switch nodes in workflow canvases.
IFTTTSimple conditional applets for consumer automations.

FAQ

What is conditional logic in agent UX?

It is branching in a workflow: based on a condition (score, intent, tool status), the agent takes path A or B instead of one linear script.

How should conditions be shown to users?

In plain language next to the node (“If confidence < 0.6 → escalate”), with a test/simulate mode when possible.

How does this differ from plan-and-execute?

Plan-and-execute lays out steps for one goal. Conditional logic decides which steps run based on runtime signals.

What safety rails belong here?

Max branch depth, loop limits, and mandatory human approval on high-impact branches.