
Runs Amazon Bedrock batch inference as the primary cost-effective path, with automatic fallback to on-demand inference using a Distributed Map when the SLA deadline is at risk. Uses the callback (task token) pattern to suspend execution cheaply while waiting for the batch job, and the saga pattern to ensure a clean terminal state on any failure.

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/bedrock-batch-with-sla/cd step-functions-workflows-collection/bedrock-batch-with-sla
npm installcdk bootstrap aws://<ACCOUNT_ID>/<REGION>cdk deploy -c modelId=us.anthropic.claude-sonnet-4-6 -c slaTotalMinutes=360
cdk destroy.