AWS Step Functions to Amazon SQS with callback

Step Functions → SQS → AWS Lambda

Create an AWS Step Functions workflow with a callback.

The Step Functions workflow has one task which will send a message to the SQS queue and waits for a token to be sent back.
The message contains the input of the task and a token. The Lambda function is used to call to Step Functions API with the token.
Between the SQS queue and the Lambda function, there could an external service that consumes the message from the SQS queue and calls the Lambda function with the token.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/sfn-callback-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".

Created by:

Corneliu Croitoru

Corneliu Croitoru

Developer at heart, in 2018 joined AWS as a Solution Architect and since 2021 building, jointly with customers, the most exciting and innovative prototypes on AWS.

Follow on LinkedIn