An extra 30% off every course until Sunday, October 11.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

3.3.4. Prompt Flows and Chaining

💡 First Principle: Complex GenAI tasks often require sequential reasoning — the output of one FM call informs the next. Prompt Flows provide a visual, managed orchestration layer for multi-step FM workflows, eliminating the need to write custom orchestration code for common chaining patterns.

Amazon Bedrock Prompt Flows (now named Amazon Bedrock Flows) enables no-code/low-code orchestration of:

  • Sequential FM calls (output of step 1 → input of step 2)
  • Conditional branching (a condition node routes to different downstream nodes based on an expression, such as a classification result or a length check)
  • Iteration (iterator/collector nodes; a DoWhile loop node repeats its body while a condition holds, up to maxIterations (default 10), and always runs at least once)
  • Knowledge Base retrieval steps
  • Lambda function steps (external data enrichment)
  • Input/output transformation
Example: document analysis pipeline as a Prompt Flow:
Input: raw_document
  ↓
Step 1 (FM): "Extract the 5 key topics from this document" → topic_list
  ↓
Step 2 (Knowledge Base): Retrieve relevant context for each topic → context_per_topic
  ↓
Step 3 (Lambda): Format and merge retrieved contexts → enriched_context
  ↓
Step 4 (FM): "Given these topics and context, generate an executive summary" → summary
  ↓
Step 5 (Conditional): IF summary length > 500 words → Step 6 ELSE → Output
  ↓
Step 6 (FM): "Condense this summary to 300 words" → concise_summary
  ↓
Output: concise_summary
When to use Prompt Flows vs. agents vs. Step Functions:
OrchestrationBest ForNot For
Bedrock Prompt FlowsStructured multi-step FM workflows; visual design; predictable pathsDynamic tool selection; long-running processes
Agents (AgentCore; Bedrock Agents Classic for existing customers)Autonomous reasoning; dynamic tool calling; variable number of stepsDeterministic workflows; real-time latency requirements
Step FunctionsComplex orchestration with many services; durable execution; long-runningSimple FM chaining

⚠️ Exam Trap: Bedrock Prompt Flows has execution time limits. A synchronous InvokeFlow run times out after one hour; asynchronous flow executions (StartFlowExecution, in preview) run up to 24 hours with each node limited to five minutes. For long-running, durable workflows that coordinate many services (processing large document sets, batch operations), use Step Functions + Lambda with asynchronous Bedrock invocations — not Prompt Flows.

Reflection Question: You need to build a pipeline that: (1) classifies incoming documents by type, (2) routes each type to a different FM prompt for extraction, and (3) validates the extraction output against a schema before writing to DynamoDB. Would you implement this as a Prompt Flow, an agent, or a Step Functions workflow? Justify your choice.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications