AWS Step Functions conditional routing on an Amazon Bedrock AgentCore harness agent verdict

Route a batch of transactions on the verdict of Amazon Bedrock AgentCore harness agents. Risky batches wait for a reviewer who signs in with Amazon Cognito.

You start this AWS Step Functions workflow with an account holder and a batch of card transactions. Up to three calls to one Amazon Bedrock AgentCore harness review the batch through the optimized InvokeHarness integration, so there is no agent code to deploy.
A fraud analyst call lists the suspicious transactions. A compliance call explains them and ends with a verdict token, which a Choice state routes on. RISK_NONE closes the batch automatically. RISK_IMMEDIATE goes to a third call that drafts a customer notification and case notes for approval. RISK_REVIEW, an unclear token or a failed call goes to human review.
Requests arrive by Amazon SNS email with Approve and Reject links, and the workflow waits up to 24 hours. The reviewer signs in with Amazon Cognito, and an AWS Lambda function behind Amazon API Gateway returns the decision. The workflow records each outcome in Amazon DynamoDB.

< 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/sfn-agentcore-harness-conditional-routing/cd step-functions-workflows-collection/sfn-agentcore-harness-conditional-routing

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Stop running executions, then delete the stack: sam delete.

Created by:

Surya Sai D

Surya Sai D

Surya works as a Technical Account Manager at AWS. He is an expert in Serverless frameworks and Event Driven Architectures. Surya is also passionate on technical writing and has contributed to AWS blogs and other Open Source Content.