Building Prompt Workflows with Amazon Bedrock Flows
This lesson explains how Amazon Bedrock Flows, formerly Prompt Flows, link prompts, knowledge bases, functions and logic into versioned workflows built visually or through the API.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the node types of a flow.
- Deploy flows with versions and aliases.
- Decide when Flows suit a workflow.
Flow nodes
A flow is a graph of nodes connected by data paths. The input node receives the request and the output node returns the result. Prompt nodes run an inline prompt or a prompt from Prompt Management. Knowledge base nodes retrieve chunks or generate an answer. Lambda function nodes run custom pre-processing or post-processing, and inline code nodes run short Python snippets. Condition nodes branch on expressions over node outputs. Iterator and collector nodes process each item of a list and gather the results. Agent nodes call a Bedrock agent, and other nodes read from or write to S3 or call Amazon Lex.
The following table summarises the main node types.
| Node | Purpose |
|---|---|
| Input / Output | Receive the request; return the result |
| Prompt | Run an inline or Prompt Management prompt |
| Knowledge base | Retrieve chunks or generate an answer |
| Lambda function / Inline code | Custom pre-processing and post-processing |
| Condition | Branch on values from earlier nodes |
| Iterator / Collector | Process list items one by one and gather results |
| Agent | Delegate to a Bedrock agent |
| S3 storage and retrieval | Read or write objects |
The following diagram shows the nodes of the triage flow.

Flow node types
Versions, aliases and invocation
A flow is edited as a working draft, then a version is created as an immutable snapshot, and an alias points to a version. Applications call InvokeFlow with the flow ID and alias ID and receive output events as a stream; the alias is moved to a new version to release changes and moved back to roll back, with no change to the calling code. Tracing shows the inputs and outputs of each node for debugging. Flows can be multi-turn when an agent node needs more information from the user.
rt = boto3.client("bedrock-agent-runtime")
resp = rt.invoke_flow(
flowIdentifier="FLOW123456", flowAliasIdentifier="ALIASPROD1",
inputs=[{"nodeName": "FlowInputNode", "nodeOutputName": "document", "content": {"document": ticket_text}}],
)
for event in resp["responseStream"]:
if "flowOutputEvent" in event:
print(event["flowOutputEvent"]["content"]["document"])When to choose Flows
Amazon Bedrock Flows suit prompt-centric workflows with a clear, fixed structure: classify a request and then branch, retrieve passages and then generate an answer, summarise each item in a list, or validate and format an output. Flows need no orchestration code, give business users and developers a visual builder, reuse prompts from Prompt Management and are versioned and deployed through aliases like applications.
Other services suit other workflows. When a process runs for hours or days, needs human approval, has complex error handling or calls many AWS services, AWS Step Functions is more suitable. When the task is open-ended and the model must decide the steps itself, for example choosing which tools to call based on what it finds, an agent is more suitable. Flows sit between the two: more structured than an agent and lighter than a general workflow service.
Flow, Step Functions or agent?
No-code triage pipeline
A support operations team wants to classify incoming tickets, answer how-to questions from a knowledge base, draft escalation notes for complaints, and let analysts adjust the logic without developers.
A Bedrock Flow fits: a prompt node classifies the ticket, a condition node branches, a knowledge base node answers how-to tickets, a prompt node drafts escalation notes, and a Lambda node formats the result for the ticketing system. The team edits the flow visually and releases changes by moving the production alias to a new version.
How is a new version of a flow released and rolled back?
Show answer
By moving an alias to a new immutable version, and moving it back to roll back.
Exam Tips
Remember for the exam
- Flows connect prompt, knowledge base, Lambda, condition, iterator, collector and agent nodes.
- Release by moving an alias to a new immutable version; roll back the same way.
- Prompt-centric chains without code: Flows. Long-running, human approval: Step Functions.