Use this when workflows take different paths.
Branching · Workflow Automation
Branching in workflows sends execution down different paths depending on a condition, such as success or failure of a step or an input value.
1. Branching chooses different paths.
2. Always have a default/else.
3. Test every branch.
4. Document decisions.
5. Merge paths cleanly.
decision → branch A/B/default → merge
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Prepare fixtures for every condition boundary, including null/missing fields, exact threshold edges and default/no-match behavior. Run the workflow and record the evaluated inputs/expression result and selected transition. Confirm only the intended branch performs side effects, and independently verify its target result. Where branches reconverge, validate the merged data contract for each path.
Step 2 Common mistakes Narrow the fault
- Branches with no default path.
Step 3 Where it fails Narrow the fault
Separate input/schema production, expression evaluation, transition scheduling, branch action execution, reconvergence and final verification. Wrong branch can stem from stale/mistyped input rather than an expression bug. Do not reorder conditions or add a permissive default until boundary fixtures explain the failure. After correction, rerun all branch-edge fixtures to prevent shifting the error to an adjacent path.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Conditions choose which path runs.
- Test every branch.
- Merge branches before shared steps.
- Branch definitions (if/else, switch) — paths
- Default branch — unexpected values
- Branch coverage tests — quality
ReferenceWhy it matters1 section · depth on demand
In depth
Branching lets a workflow take different paths depending on data or results — for example handle routers and switches differently, or open a ticket instead of deploying when checks fail. Branches later merge or end separately.
| Branch type | Example |
|---|---|
| If/else | Validation passed → deploy, else → notify |
| Switch/case | Platform IOS, NX-OS, Junos → different template |
| Parallel branches | Deploy several sites at once |
| Error branch | On failure → rollback |
Keep the number of branches small and test each path; rarely used branches (especially error paths) are where workflows break.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Workflow branching evaluates runtime data or events to choose one or more next paths. Correctness depends on expression language, input shape/type, evaluation order, default/no-match behavior and whether branches are exclusive or parallel. A branch decision is control-plane state; downstream side effects still need their own verification. Reconverging branches can carry different data shapes or partial side effects, which must be normalized before a common step.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Version branch expressions with their input schema and test fixtures. Make default/fallback behavior explicit and review conditions when upstream producers change types or naming. Avoid duplicated side-effect logic across branches when a shared post-decision step is safer, and document whether new branches affect in-flight workflow versions. Keep business policy decisions auditable rather than hiding them in opaque expressions.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Workflow Automation > Branching. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cncf.io/projects/serverless-workflow/ · confidence 94%Quick lookup tables
Workflow Automation → Branching · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Workflow Automation → Branching.
| Layer | Workflow Automation → Branching operational reference |
|---|---|
| Runtime/ownership | Workflow branching and conditional transitions · identify controller/parser, durable intent, identity and target ownership before mutation |
| Persistent intent | Versioned definition/configuration with explicit dependencies, scope and credential boundary |
| Verification | Execute fixtures that satisfy each branch plus default/no-match behavior; capture evaluated input, expression result, selected transition and final target state. |
| Expected interpretation | Every intended condition selects exactly the documented branch, ambiguous/no-match behavior is explicit, branch-specific side effects are bounded, and paths reconverge only where state contracts are compatible. |
| Recovery boundary | Preserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture workflow instance/version, decision state, sanitized input fields used by the expression, expression/rule identifier, evaluated result, selected branch, downstream action IDs and final state. A trace that says only “went to step X” is insufficient if the condition value cannot be reconstructed. Preserve branch-specific errors separately.