Calling Asynchronous API with Callbacks

Invoke an asynchronous API, then pause the state machine and call back on completion.

1. When the workfow is executed, it sends the API payload to Amazon SQS to be consumed by an AWS Lambda function which will call the Async API.
2. SQS send message step is configured to wait for callback to resume the state machine execution. This is configured by using the waitForTaskToken functionality.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/calling-async-api-callback/cd step-functions-workflows-collection/calling-async-api-callback

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Created by:

Hossam Ebrahim

Hossam Ebrahim

Hossam Ebrahim is a Solutions Architect at Amazon Web Services, based out of London, UK. With more than 13 years of working experience in software engineering including architecting, designing, and developing enterprise solutions, Hossam is helping AWS customers in their cloud adoption journey. Outside of work he enjoys spending time with his family, and watching movies.

Follow on LinkedIn