I have a workflow that starts with GetDataLambda, which retrieves data needed by two independent processing paths. After that task completes, I want to run these branches in parallel:
- ProcessDataLambdaA1 -> ProcessDataLambdaA2
- ProcessDataLambdaB1 -> ProcessDataLambdaB2
The A and B paths do not depend on each other, so if a task in the A branch fails, I still want the B branch to continue processing. However, a failure inside one Step Functions Parallel branch currently causes the entire Parallel state to fail. What is the best way to isolate errors so each branch can finish independently, while still recording whether a branch succeeded or failed?
2 Answers
A common pattern is to end each branch with a Pass state and catch errors before reaching it. Under normal conditions, the A path would be ProcessDataLambdaA1 -> ProcessDataLambdaA2 -> PassA. If A1 fails, its Catch transition skips to PassA, allowing the branch to complete without interrupting B. You can use the same structure for the B path.
If later steps need to distinguish between a real success and a handled failure, set a status such as ProcessAStatus or ProcessBStatus on the normal and error paths, then inspect those values with a Choice state after the Parallel state. The branch is allowed to complete, while the workflow still retains the actual outcome.
Keep the Parallel state, but handle errors inside each branch instead of letting them reach the Parallel state. Add Catch handlers to the tasks in the A and B paths and route failures to branch-specific handling states, such as AFailed or BFailed. Once a branch reaches a terminal state after handling its error, the other branch can continue normally. It’s also useful to include the error information in that branch’s output so the final result shows which paths succeeded and which failed.

Does the AFailed state need to be a success state for the Parallel state to consider that branch complete?