New pattern - Step Functions to Bedrock InvokeModel (CDK)#3083
Conversation
Step Functions Express workflow that invokes Amazon Bedrock Claude Sonnet directly using the native InvokeModel optimized integration. No Lambda function required — reduces latency, cost, and complexity. - BedrockInvokeModel L2 CDK construct with resultSelector - Express workflow for synchronous sub-5-minute executions - Built-in retry with exponential backoff (3 attempts, 20s base) - Scoped IAM for inference profile + foundation model ARNs
|
Hi @biswanathmukherjee 👋 Friendly nudge — this pattern is ready for review. Deployed and tested end-to-end on a live AWS account. Would appreciate a look when you have time. Thank you! |
|
Hi @biswanathmukherjee 👋 This shows Step Functions native BedrockInvokeModel — direct SFN→Bedrock without Lambda. Uses the L2 BedrockInvokeModel construct. Different from Lambda+Bedrock patterns — zero Lambda involved. |
|
|
||
| --- | ||
|
|
||
| Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
There was a problem hiding this comment.
| Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| @@ -0,0 +1,83 @@ | |||
| # Step Functions to Amazon Bedrock InvokeModel (CDK) | |||
There was a problem hiding this comment.
| # Step Functions to Amazon Bedrock InvokeModel (CDK) | |
| # AWS Step Functions Express workflow with optimized integration for Amazon Bedrock InvokeModel |
| - [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources. | ||
| - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured | ||
| - [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/cli.html) installed | ||
| - [Node.js](https://nodejs.org/) 18.x or later |
| - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured | ||
| - [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/cli.html) installed | ||
| - [Node.js](https://nodejs.org/) 18.x or later | ||
| - [Amazon Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) enabled for Anthropic Claude Sonnet in your AWS account |
There was a problem hiding this comment.
| - [Amazon Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) enabled for Anthropic Claude Sonnet in your AWS account | |
| - [Amazon Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) enabled for a model of your choice (Anthropic Claude Sonnet is the default in this pattern) in your AWS account |
|
|
||
| ## How it works | ||
|
|
||
| Step Functions has a native optimized integration with Amazon Bedrock that lets you call `bedrock:InvokeModel` directly from a workflow state — no Lambda function needed. This reduces latency, cost, and operational complexity. |
There was a problem hiding this comment.
I don't need a Lambda function for any Step Functions integration, the benefits of an optimized integration are more than that
| @@ -0,0 +1,52 @@ | |||
| { | |||
| "title": "Step Functions to Amazon Bedrock InvokeModel", | |||
There was a problem hiding this comment.
| "title": "Step Functions to Amazon Bedrock InvokeModel", | |
| "title": "AWS Step Functions Express integration with Amazon Bedrock InvokeModel", |
| @@ -0,0 +1,52 @@ | |||
| { | |||
| "title": "Step Functions to Amazon Bedrock InvokeModel", | |||
| "description": "Invoke Amazon Bedrock directly from Step Functions using the native InvokeModel optimized integration — no Lambda function required. Deployed with AWS CDK.", | |||
There was a problem hiding this comment.
| "description": "Invoke Amazon Bedrock directly from Step Functions using the native InvokeModel optimized integration — no Lambda function required. Deployed with AWS CDK.", | |
| "description": "Invoke Amazon Bedrock directly from Step Functions using the native InvokeModel optimized integration. Deployed with AWS CDK.", |
| "headline": "How it works", | ||
| "text": [ | ||
| "This pattern deploys a Step Functions Express workflow that invokes Amazon Bedrock (Claude Sonnet) directly using the native bedrock:InvokeModel optimized integration.", | ||
| "No Lambda function is needed — Step Functions calls Bedrock directly, reducing latency, cost, and operational complexity.", |
There was a problem hiding this comment.
see comment on the README regarding optimized integrations
Description
This pattern deploys a Step Functions Express workflow that invokes Amazon Bedrock (Claude Sonnet) directly using the native InvokeModel optimized integration — no Lambda function required. Deployed with AWS CDK.
Key Features
BedrockInvokeModelL2 CDK constructresultSelectorextracts response text, model, and usage metadataProvisionedModel.fromProvisionedModelArn(required for cross-region inference profiles)Architecture
Testing
Deployed and tested on AWS account. Verified:
SUCCEEDEDexecution statusFoundationModel.fromFoundationModelIdgeneratesfoundation-modelARN but inference profiles needinference-profileARN — usedProvisionedModel.fromProvisionedModelArnwith constructed ARNChecklist