[{"data":1,"prerenderedAt":57},["ShallowReactive",2],{"workflow-calling-async-api-callback":3},{"id":4,"title":5,"cleanup":6,"contributors":10,"deploy":12,"description":15,"diagram":16,"extension":17,"framework":18,"gitHub":19,"introBox":28,"level":33,"meta":34,"resources":35,"s3URL":44,"services":45,"simplicity":48,"stem":49,"testing":50,"type":54,"usecase":55,"videoId":27,"__hash__":56},"workflows\u002Fworkflows\u002Fcalling-async-api-callback.json","Calling Asynchronous API with Callbacks",{"headline":7,"text":8},"Cleanup",[9],"1. Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fhossam-ebrahim.json",{"text":13},[14],"sam deploy --guided","Invoke an asynchronous API, then pause the state machine and call back on completion.","\u002Fassets\u002Fimages\u002Fworkflows\u002Fcalling-async-api-callback.png","json","AWS SAM",{"template":20,"payloads":25},{"repoURL":21,"templateDir":22,"templateFile":23,"ASL":24},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fstep-functions-workflows-collection\u002Ftree\u002Fmain\u002Fcalling-async-api-callback\u002F","calling-async-api-callback","template.yaml","statemachine\u002Fworkflow_AsyncAPICallbackPattern.asl.json",[26],{"headline":27,"payloadURL":27},"",{"headline":29,"text":30},"How it works",[31,32],"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.","200",{},{"headline":36,"bullets":37},"Additional resources",[38,41],{"text":39,"link":40},"Wait for a Callback with the Task Token","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-to-resource.html#connect-wait-token",{"text":42,"link":43},"Invoking asynchronous external APIs with AWS Step Functions","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Farchitecture\u002Finvoking-asynchronous-external-apis-with-aws-step-functions\u002F",null,[46,47],"lambda","sns","2 - Pattern","workflows\u002Fcalling-async-api-callback",{"headline":51,"text":52},"Testing",[53],"See the GitHub repo for detailed testing instructions.","Standard","APIs","O_RbsyPX-SRRD-P7lYUUBMfrfV06cKBV4U4gudWPAH8",1781519745579]