Test every decision path in workflows: List all workflow decisions and create test cases for each route; Use boundary values and combinations to test compound conditions; Verify destination effects, not just routing, with fresh test states
Image: Workflow Automation Guide

Workflow Design

Part of Workflow testing and deployment

Building test cases for every decision branch

Turn workflow decisions into cases with expected routes and destination effects, including compound conditions, defaults and boundaries.

List every workflow decision and create cases that take each intended route. For each case, state the expected route and the destination effect before running it. A branch is covered only when the relevant input reaches it and its result is checked.

Turn the workflow into a route list

Start at the trigger and mark each filter, condition, switch, approval outcome and error route. Record the values each decision reads and where each result goes. Include a default route and a route that should take no external action.

Suppose a hypothetical workflow creates a fulfilment request only for a paid order with a supported delivery method. Its rules could produce this case sheet:

CasePaymentDelivery methodExpected routeExpected effect
APaidSupportedCreate requestOne request linked to the order
BUnpaidSupportedStop as ineligibleNo request
CPaidUnsupportedHold for correctionNo request
DUnpaidUnsupportedStop as ineligibleNo request
EMissingSupportedLook up the source state or holdNo request until eligibility is known

The rules and outcomes are invented for this example. In a real workflow, use the source and destination contracts to define them. Cases B and C have the same immediate record count but different decisions to record.

Add boundaries and combinations that matter

For a compound condition such as paid AND supported, test the true and false value of each part. Add combinations where evaluation order changes the outcome, or where a missing value could cause an error before the intended hold route. For numeric or date thresholds, use values immediately below, at and above the boundary. Include an unrecognised value for any catch-all route.

Nested decisions can create many combinations. Prioritise those that reach a different action, error route or business outcome. Record any route that cannot safely be exercised. Do not claim complete coverage from one test of a decision that can receive materially different inputs.

Priority Testing Combinations for Compound Conditions

  1. Paid AND SupportedTrue, True → Create request
  2. Paid AND SupportedFalse, True → Stop as ineligible
  3. Paid AND SupportedTrue, False → Hold for correction
  4. Paid AND SupportedFalse, False → Stop as ineligible
  5. Missing ValueLook up source state or hold

Check effects as well as routing

A trace showing the chosen branch does not establish that a destination record was created or withheld. Record the initial destination state, expected result and observed result separately. If the destination accepts work for later processing, inspect its later outcome. Use a fresh test identity or a known starting state so an earlier record is not mistaken for the result.

Choose a safe test surface for each case. AWS Step Functions TestState can execute a supported state without creating a state machine or updating an existing one. Its API supports mocked service integrations; enhanced mocking options are available through the AWS CLI and SDKs.

Power Automate cloud-flow testing offers manual triggering and, after a manual test, an automatic option that can reuse a recent trigger or repeat a test run. These facilities exercise paths; checking the destination remains a separate task.

Keep the case sheet as a plan until observed results are entered. Record the workflow version, input reference, expected route and effect, actual route and effect, and any discrepancy.

More from Workflow Design