AWS Step Functions parallel agents on one Amazon Bedrock AgentCore harness

Fan out three Amazon Bedrock AgentCore harness agents in parallel on a document uploaded to Amazon S3, and publish the merged report only if all three finish.

Uploading a text document under docs/ in an Amazon S3 bucket starts this AWS Step Functions workflow through Amazon EventBridge. An AWS Lambda function reads the document and passes its text on.
A Parallel state then calls one Amazon Bedrock AgentCore harness three times at once through the optimized InvokeHarness integration, so there is no agent code to deploy. Each branch has its own system prompt: a summarizer, a risk analyst and an action-item extractor. Amazon Nova Lite answers all three.
A Choice state continues only if all three branches finished their sections. If one didn't, the workflow stops and publishes nothing, so a partial report never goes out. A second Lambda function merges the sections into one report, which the workflow stores in Amazon DynamoDB and emails through Amazon SNS.

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

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Empty the bucket, 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.