[{"data":1,"prerenderedAt":65},["ShallowReactive",2],{"pattern-sfn-bedrockagentcore-harness-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":26,"language":33,"level":34,"meta":35,"patternArch":36,"resources":49,"s3URL":6,"services":6,"stem":57,"testing":58,"videoId":6,"__hash__":64},"patterns\u002Fpatterns\u002Fsfn-bedrockagentcore-harness-cdk.json","AWS Step Functions with Amazon Bedrock AgentCore Harness Optimized Integration (CDK)",null,{"text":8},[9],"\u003Ccode>cdk destroy\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fnithin-chandran-r.json",{"text":13},[14,15,16],"cdk bootstrap","npm install","cdk deploy --parameters HarnessArn=arn:aws:bedrock-agentcore:us-east-1:ACCOUNT:harness\u002FYOUR-HARNESS","Invoke Amazon Bedrock AgentCore harness from AWS Step Functions using the optimized integration — zero Lambda, Converse-shaped responses, and token metrics.","json","AWS CDK",{"template":21},{"repoURL":22,"templateURL":23,"projectFolder":24,"templateFile":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fsfn-bedrockagentcore-harness-cdk","serverless-patterns\u002Fsfn-bedrockagentcore-harness-cdk","sfn-bedrockagentcore-harness-cdk","lib\u002Fsfn-bedrockagentcore-harness-stack.ts",{"headline":27,"text":28},"How it works",[29,30,31,32],"This pattern uses the AWS Step Functions optimized integration for Amazon Bedrock AgentCore to invoke a harness directly — no Lambda function required.","The harness orchestrates model inference, tool use, and multi-turn conversations. Step Functions receives a Converse-shaped response with aggregated token usage metrics.","The optimized integration provides CloudWatch deep-links for turn-by-turn agent reasoning traces, built-in retry\u002Fcatch for throttling, and a 15-minute execution timeout.","The state machine includes error handling with specific catches for ResourceNotFoundException and ThrottlingException with exponential backoff.","TypeScript","200",{},{"icon1":37,"icon2":42,"line1":46},{"x":38,"y":39,"service":40,"label":41},20,50,"sfn","AWS Step Functions",{"x":43,"y":39,"service":44,"label":45},80,"bedrock","Amazon Bedrock AgentCore",{"from":47,"to":48},"icon1","icon2",{"bullets":50},[51,54],{"text":52,"link":53},"Invoke Amazon Bedrock AgentCore harness with Step Functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fconnect-bedrockagentcore.html",{"text":55,"link":56},"Amazon Bedrock AgentCore Harness","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock-agentcore\u002Flatest\u002Fdevguide\u002Fharness.html","patterns\u002Fsfn-bedrockagentcore-harness-cdk",{"text":59},[60,61,62,63],"Start an execution with a prompt:","\u003Ccode>aws stepfunctions start-execution --state-machine-arn $(aws cloudformation describe-stacks --stack-name SfnBedrockagentcoreHarnessStack --query 'Stacks[0].Outputs[?OutputKey==`StateMachineArn`].OutputValue' --output text) --input '{\"prompt\": \"What is Amazon Bedrock AgentCore?\"}'\u003C\u002Fcode>","Check execution output (wait 10-30 seconds for agent reasoning):","\u003Ccode>aws stepfunctions describe-execution --execution-arn EXECUTION_ARN --query 'output'\u003C\u002Fcode>","FWeoSxljwJJbt7vjjf8z3W3vxIRzF4r57ih4PmJ70Eg",1782815710626]