ThorStackThorStack
Workflows

Conditional steps

Branch the workflow on data — expressions, comparators, and the rules of the road.

When to branch

Use a conditional when the rest of the workflow depends on data only known at run time: a deal value, a customer's region, the success of an upstream node. Static configuration belongs in the workflow's settings, not in a branch.

Expression syntax

Conditional nodes evaluate a small expression language. The grammar is intentionally tiny — easier to read at 3am than a full Turing-complete language.

deal.amount >= 50000 and deal.region == "US"

Operators: ==, !=, <, <=, >, >=, and, or, not, in, startsWith, endsWith, matches.

Functions: now(), daysBetween(a, b), len(x), coalesce(a, b).

Anything more complex belongs in an agent step that returns a structured decision — that's traceable; a deeply nested expression is not.

Common patterns

PatternBranch
Triage by deal sizedeal.amount >= 50000 → AE; else → SDR
Region-aware routingorder.shipTo.country == "US" → US warehouse; else → EU warehouse
Customer healthcustomer.health < 50 → CSM intervention; else → standard nurture
Tax rulesinvoice.region == "GB" → VAT path; "NG" → VAT (NG); else → no tax

Default branches

Every conditional has an else branch — even if you only added if and else if. ThorStack auto-generates the implicit else so a run never has nowhere to go.

Validating expressions

The editor evaluates expressions against a sample payload so you can sanity-check before saving. The sample comes from the most recent successful run of the same workflow, or a hand-crafted one if there hasn't been a run yet.

Next

Ready for a stack
built around you?

Every ThorStack deployment starts with a 30-minute call. Tell us how you operate — we'll show you what your stack would look like.