AWS Step Functions generates the task token for you when you use any of the service integration patterns that support the .waitForTaskToken
integration. You can't generate your own token and pass it in as part of the integration. See the Wait for a Callback with Task token documentation for more information and examples.
For a workflow that requires multiple client interactions before proceeding to the next state, I'd personally use a Step Functions workflow. If the client interactions happen in a defined order, then I'd simply write a series of .waitForTaskToken
style service integrations that happen in serial, where each integration would then allow the next client interaction to happen (in whatever way is appropriate for what you're building, e.g. executing Lambdas, putting items in an SQS Queue, etc). However, if the client interactions can happen in any order and you want to basically pause the state machine until they're all done, I would consider delegating all of the monitoring of for the related client interactions into an Activity and just transition to that Activity's task to wait for the Activity to report back with a sendTaskSuccess
call or a timeout if they didn't all finish in the time you'd want them to.