Building Agentic Workflows with LangGraph and Amazon Bedrock AgentCore
Author
Leandro Mota
Date Published
Structuring and Running Agentic Workflows in Practice
Building applications with large language models introduces a shift in how systems are designed. Instead of executing predefined steps, the system is expected to interpret input, decide what to do, and execute accordingly. This shifts complexity away from individual function calls and into the structure of execution itself.
Two concerns emerge from this. The first is how the agent makes decisions across multiple steps. The second is how that logic runs reliably in production. LangGraph and Amazon Bedrock AgentCore address these concerns from different directions, and understanding that separation is key to using them effectively.
The Constraint: LLMs Do Not Define Workflows
A language model can generate output, but it does not define execution structure. It can suggest what to do next, but it does not enforce how that decision is carried out across a system.
When an application requires multiple steps, conditional logic, tool usage, or intermediate state, that structure must be implemented explicitly. Without it, the system becomes difficult to reason about and harder to debug, particularly when behavior varies across inputs. The model becomes part of the system, but not the system itself.
LangGraph: Making Execution Explicit
Developed by LangChain, LangGraph provides a way to define workflows as graphs rather than linear code. Each workflow is composed of nodes that represent individual steps, edges that define transitions, and a shared state that carries information across execution.
This framework makes it possible to express branching logic, iterative reasoning, and coordination between multiple agents in a way that remains explicit. Checkpoints can be introduced to pause or inspect execution, and state can be persisted to allow recovery or debugging.
The value here is not abstraction for its own sake. It is the ability to define and trace execution paths directly. Instead of inferring what the agent is doing from outputs, the structure of the workflow makes those decisions visible.
Amazon Bedrock AgentCore: Managed Agent-Platform
Amazon Bedrock AgentCore is AWS's fully managed service for building and deploying agentic AI systems. Unlike LangGraph's open-source approach, Bedrock provides an enterprise-ready, serverless platform that handles infrastructure, scaling, and integration with AWS services out of the box.
Amazon Bedrock AgentCore Architecture

Credit: Amazon Web Services
Core Components:
- Runtime: Serverless execution environment for agent logic
- Memory: Built-in short-term and long-term memory management
- Identity & Policy: IAM-based access control and permissions
- Gateway: API management and routing layer
- Observability: CloudWatch integration for monitoring and logging
- Code Interpreter: Secure Python execution environment for data analysis
- Evaluations: Built-in testing and quality assessment tools
Foundation Model Access: Bedrock AgentCore provides seamless access to leading foundation models including Claude 4.5 (Anthropic), Titan (AWS), Llama 3, Mistral, Cohere, and more, all through a unified API with consistent pricing and SLAs.
Guardrails & Responsible AI: Built-in content filtering, hallucination detection, PII redaction, and policy enforcement ensure agents operate safely and comply with organizational standards.
LangGraph + AWS AgentCore vs Standalone LangGraph
LangGraph can be used independently, but doing so requires implementing the surrounding runtime layer. This includes model access, execution environments, scaling, monitoring, and integration with external systems.

Many organizations use LangGraph for orchestration logic while leveraging Bedrock for model access and managed services. This combines LangGraph's flexibility with Bedrock's enterprise-grade infrastructure:
- LangGraph handles complex workflow orchestration
- Bedrock provides reliable model access and scaling
- AWS services (S3, DynamoDB, Lambda) handle data and compute
- CloudWatch provides unified monitoring across the stack
Where the Combination Is Useful
When used together, LangGraph defines how decisions are made and AgentCore ensures those decisions are executed reliably. This separation keeps responsibilities clear and reduces coupling between application logic and infrastructure.
A typical setup reflects this division. LangGraph orchestrates decision-making, Bedrock provides model access and execution, and AWS services handle storage and external dependencies. Observability is handled through centralized logging, allowing execution paths to be inspected after the fact.
This is not a new architectural pattern, but it applies familiar separation of concerns to systems where control flow is no longer fixed.
Building a Math Agent
The TrackIt team created a math agent that demonstrates how natural language can drive complex computations.
Link to GitHub repository: https://github.com/trackit/agentcore-demo
Natural Language Understanding
Instead of requiring specific syntax, users can ask questions naturally:
- "What's 25 plus 37?"
- "Calculate the average of my test scores: 85, 92, 78, 95, 88"
- "I bought 3 boxes with 12 items each, plus 15 loose items. How many total?"
The agent understands intent, extracts relevant information, and performs the appropriate calculations.
Intelligent Routing
The agent automatically determines the nature of the operation required based on the query:
- Mathematical calculations: Basic arithmetic to complex expressions
- Statistical analysis: Averages, medians, data insights
- General assistance: Explanations and guidance
This routing happens dynamically based on the input, showcasing LangGraph's conditional workflow capabilities.
Self-Awareness
An interesting feature is the agent's ability to explain its own architecture. When asked to "show graph structure," it visualizes its internal workflow. This meta-capability illustrates how agents can be self-documenting and transparent.


Deploying the Agent


AWS Console View


Invoking the Agent using the AWS CLI (Command Line Interface)

Agent Observability on the AWS Console
How This Translates to Real Workflows
1. Conversational Business Logic
Imagine replacing complex forms and interfaces with natural conversation. Instead of clicking through multiple screens, users could simply say:
- "Process a refund for order 12345"
- "Generate a sales report for Q3, focusing on new customers"
- "Schedule maintenance for all equipment due this month"
2. Adaptive Workflows
Traditional applications have fixed paths. With LangGraph and AgentCore, workflows can adapt based on:
- User intent and context
- Available data
- External conditions
- Previous interactions
3. Rapid Prototyping and Deployment
The development cycle becomes incredibly fast:
- Design your workflow as a graph
- Define what happens at each node
- Deploy with a single command
- Test and iterate immediately
No Kubernetes, no load balancers, no auto-scaling groups, just your logic running in the cloud.
4. Cost-Effective Intelligence
The serverless model means:
- Zero idle costs: Pay only when the agent is thinking
- Automatic scaling: Handle viral growth without preparation
- Global availability: Deploy once, run anywhere
Conclusion
LangGraph and Amazon Bedrock AgentCore address different parts of the same problem. LangGraph defines how an agent behaves through structured workflows, while AgentCore provides the environment to run those workflows reliably at scale.
Together, they allow applications to interpret input, route execution dynamically, and operate within a defined structure. This makes it possible to build systems that are flexible in behavior while remaining observable and maintainable in practice.
Related Posts

End-to-End Multimodal Video Search on AWS with Bedrock and OpenSearch
Building a multimodal video search engine on AWS using Amazon Bedrock embeddings and OpenSearch hybrid retrieval.
-900x506.jpg%3F2026-06-03T12%253A57%253A11.603Z&w=3840&q=85)
Giving AI the Keys: Controlling a Tesla with Amazon Bedrock AgentCore
How AWS Bedrock AgentCore securely connects AI agents to Tesla vehicle controls using MCP, Lambda, ECS, Cognito, and private networking.
