Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

Human in the Loop

Wait for an approval from a human reviewer before continuing

This pattern allows you to integrate an human review or approval process into your workflows.
The task sends a message to a SNS topic which sends a notification to a human reviewer or approver by email for example. The workflow then waits until the approver completes their review. Depending on the review outcome a different Lambda function can be invoked.
Waiting for completion of the review is done using the .waitForTaskToken service integration. The payload of the SNS message contains a task token, which is automatically generated by AWS Step Functions.
The task will pause until it receives that task token back with a SendTaskSuccess or SendTaskFailure API call.

Launch Stack

GitHub icon Visit the GitHub repo for this workflow.

< Back to workflows

Download

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/human-in-the-loop/ cd step-functions-workflows-collection/human-in-the-loop

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Additional resources

Ben Freiberg

Presented by Ben Freiberg

Ben is a Senior Solutions Architect at Amazon Web Services (AWS) based in Frankfurt, Germany.

Follow on LinkedIn