Skip to content

Demo how to handle errors generated by Parallel tasks with AWS Step Functions

Notifications You must be signed in to change notification settings

v-studios/stepfunctions-parallel-error

Repository files navigation

README Parallel Error

A Demonstration.

We want a Parallel task to wrap two functions, one that computes JSON output, the other computes PDF output.

If they both succeed, we go to the successful Done state.

If either raises an UserException or SystemException, we should trap it outside of the Parallel task and send it to the correct failure processor, both of which flow to a DoneError terminal failure state.

When you deploy this, it will create a Step Function state machine and two Lambda functions; the Lambdas randomly choose an error or success. When you Execute it in the AWS console, you can see it taking different paths, with the errors caught by the Parallel Task, then routed to the correct handler. You can inspect the Input and Output of the states to see what function caused which error.

The diagrams below are from the Step Functions console and show the three different possible execution workflows.

parallelerror-errorsystem.png

parallelerror-erroruser.png

parallelerror-success.png

About

Demo how to handle errors generated by Parallel tasks with AWS Step Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages