AIP-C01: Designing GenAI Workflows with AWS Step Functions

AIP-C01 exam essentials — when to choose Bedrock Agents, Bedrock Flows, or Step Functions, plus the Bedrock optimized integration, Retry and Catch safeguards, .waitForTaskToken human approval, and Distributed Map.

Production GenAI rarely ends with a single model call. A real business flow extracts a document, summarizes it, checks it for safety, waits for a reviewer, and only then publishes the result. The official AIP-C01 exam guide names AWS Step Functions in 11 separate skills for exactly this kind of work. This post covers when to choose Bedrock Agents, Amazon Bedrock Flows, or Step Functions, and the Step Functions patterns the exam expects: retries, fallbacks, human approval, and parallel processing.

Three Orchestration Tools: Agents vs Flows vs Step Functions

All three run multi-step logic. The difference is who decides the next step.

| Factor | Bedrock Agents | Amazon Bedrock Flows (formerly Prompt Flows) | AWS Step Functions | |--------|----------------|----------------------------------------------|--------------------| | Who decides the next step | The model, at runtime (ReAct) | The developer, in a visual builder | The developer, as a state machine | | Strength | Open-ended requests, autonomous tool choice | No-code prompt chains and branching | Retries, error handling, long-running steps, human approval, execution history | | Exam keywords | "Decides which API to call" | "Non-developers build prompt flows" | "Fixed order, auditable, wait for approval" |

When a question says the steps run in a fixed order, every step must be auditable, the flow must wait for a reviewer, or only the failed step should be retried, the answer is Step Functions. In practice the tools are combined: Step Functions owns the business process, and one of its steps invokes a Bedrock Agent for autonomous tool use.

 

Step Functions Essentials

A workflow is a state machine. The states used most in GenAI designs are (call a service), (branch on a value such as a quality score), (run different branches at once), and (repeat the same steps for each item).

| Factor | Standard workflow | Express workflow | |--------|-------------------|------------------| | Max duration | 1 year | 5 minutes | | Execution semantics | Exactly-once | At-least-once (async) | | Callback (.waitForTaskToken) and .sync | Supported | Not supported | | Best for | Human approval, long-running, audited flows | High-volume, short event processing |

Human approval can take days, so it requires a Standard workflow. Also remember the 256 KiB limit on data passed between states: keep large documents and model responses in S3 and pass references.

 

Calling Bedrock Without Lambda

Step Functions has an optimized integration with Amazon Bedrock. The resource calls a model directly from the workflow, and starts a fine-tuning job and waits for it to finish. The InvokeModel integration adds two fields that the Bedrock API doesn't have: and , which accept an S3 URI. Use them when the request body would exceed 256 KiB.

Chaining these tasks gives you prompt chaining, with a different model per step to balance cost and quality.

 

Safeguards: Retry, Catch, Timeouts, and Circuit Breakers

defaults to a 1-second first wait, 3 attempts, and a backoff rate of 2.0. For throttling, add to cap the wait and so that retries from many executions don't arrive at the same moment. routes unrecoverable errors to a fallback state: a smaller model or a safe canned reply. keeps the original input alongside the error. and turn stuck tasks into errors. Stopping conditions: a self-refinement loop must count its iterations and use to stop after, for example, three passes. Circuit breaker: after repeated model failures, record an "open" state in DynamoDB, and have later executions check it in a state and skip straight to the fallback until a cool-down passes.

 

Human-in-the-Loop with .waitForTaskToken

Add to the reviewer task (for example ) and include the task token in the message. The execution pauses at no transition cost. When the reviewer approves through an API Gateway endpoint, a Lambda function calls with the token; a rejection calls . Set for the approval deadline and catch the timeout to escalate.

Don't confuse this with Amazon Augmented AI (A2I). A2I creates human review tasks when an ML prediction such as a Textract extraction has low confidence. Putting generated content through a business approval step is a Step Functions callback.

!Step Functions GenAI workflow with human review

Parallel, Map, and Distributed Map

sends the same input to several branches, which suits model ensembles and side-by-side model comparison. repeats steps for each array item. For tens of thousands of items, Distributed Map reads object lists, CSV, or JSON from S3 and runs up to 10,000 child executions in parallel, with a tolerated failure percentage.

If you only need one model to process many prompts without real-time results, Bedrock Batch Inference is simpler and cheaper. Choose Distributed Map when each item passes through several services, such as Textract, a model call, validation, and a database write.

 

Event-Driven Starts and Content-Based Routing

An EventBridge rule on S3 object creation can start an execution: Textract extracts the text, Lambda cleans it, and an AWS SDK integration calls the Knowledge Base . For dynamic routing, a small model classifies the request and a state sends it to the model that fits best, or to a human agent for sensitive requests.

 

Exam Quick Reference

"Multi-step GenAI with fixed order, audit history, and retries" -- AWS Step Functions (Standard) "Model decides which tool to call at runtime" -- Bedrock Agents "No-code prompt chains with branching" -- Amazon Bedrock Flows "Invoke a model from a workflow without Lambda" -- Optimized integration bedrock:invokeModel "Model input or output larger than 256 KiB" -- Input/Output S3Uri "Spread out retries during throttling" -- Retry + MaxDelaySeconds + JitterStrategy FULL "Pause until a reviewer approves" -- .waitForTaskToken + SendTaskSuccess "Process tens of thousands of documents" -- Distributed Map "Same input to several models at once" -- Parallel state "Stop calling a failing model for a while" -- Circuit breaker (DynamoDB + Choice)

Back to blog list