- Newest
- Most votes
- Most comments
I managed to figure out the issue. My MAP was utilizing the "Express" mode for iteration instead of Standard. Once I switch to Standard the token was generated and available in $states.context.Task.Token
The issue you're encountering is related to how the task token is accessed in the Wait for Callback pattern. When using the .waitForTaskToken integration pattern, you need to explicitly pass the task token using the $.Task.Token reference, not $states.context.Task.Token.
In your JSON configuration, you should modify the TaskCallbackToken Value to use the correct reference:
"Tags": [ { "Key": "TaskCallbackToken", "Value": "{% $.Task.Token %}" }, { "Key": "Source", "Value": "TriggerBatchTranscribe" } ]
The $.Task.Token is the correct way to access the task token from the Context object when using the Wait for Callback pattern. This token is what you'll need to return via the SendTaskSuccess or SendTaskFailure API calls to resume your workflow after the transcription job completes.
For the Wait for Callback pattern to work properly, you need to:
- Pass the task token to the service or external system
- Configure your EventBridge rule to capture the transcription job completion events
- Have your handler call SendTaskSuccess or SendTaskFailure with the token
This approach will allow your workflow to pause until each transcription job completes, giving you the control you need over how many jobs are submitted to Amazon Transcribe at once.
Sources
Troubleshooting issues in Step Functions - AWS Step Functions
Discover service integration patterns in Step Functions - AWS Step Functions
answered a year ago
Relevant content
asked 10 months ago

This is actually completely incorrect. as it is pulling $.Task.Token from JSONPath which does not work in JSONata.