The Anatomy of an Agentic Workflow: State, Nodes, and Edges

20 hours ago 4
Club.noww.in

  

Complex agentic applications are easier to build when we compose multiple specialized agents and tools into a coordinated process.

 

But this leads to the next important question, How are these workflows actually constructed?

 

Whether we build an agentic workflow using LangGraph, Microsoft Agent Framework, or our own orchestration code, the architecture can be understood through three fundamental components:

 

·      State: The shared and evolving memory of the workflow

·      Nodes: The workers that perform individual tasks

·      Edges: The routing logic that decides what should happen next

 

To understand these components, let's use a "Travel Planning Agent" as our example.

 

Imagine a user says:

> "Plan a 5-day trip to Japan for two people with a budget of $3,000."

 

Instead of one giant agent trying to do everything, we can build a workflow with specialized nodes for itinerary planning, flight search, hotel search, budget checking, and final planning.

 

1. State: The Shared Memory of the Workflow

The state is the single source of truth for the workflow. It contains everything the workflow currently knows about the user's request and everything that has been produced by the different nodes.

 

For our travel planner, the initial state might look like this:

{ destination: "Japan", duration: 5, travelers: 2, budget: 3000, itinerary: null, flightOptions: null, hotelOptions: null, budgetStatus: null }

At this point, the workflow knows what the user wants, but no work has been performed yet.

 

A Flight Search Node can read the destination, duration, and number of travelers from the state and search for suitable flights.

 

It then updates the state:

{ destination: "Japan", duration: 5, travelers: 2, budget: 3000, itinerary: null, flightOptions: [...], hotelOptions: null, budgetStatus: null }

  Later, the Hotel Search Node can read the destination and dates and add hotel options:

{ destination: "Japan", duration: 5, travelers: 2, budget: 3000, itinerary: null, flightOptions: [...], hotelOptions: [...], budgetStatus: null }

   

The state keeps evolving as the workflow progresses. This is why state is so important, the nodes do not need to directly communicate with one another. They communicate indirectly through the shared state.

 


The Flight Node doesn't need to know anything about the Hotel Node. The Hotel Node doesn't need to know how the flight search was performed. Both simply read from and write to the shared state.

 

Think of the state as a shared workspace where every worker can see the information produced so far.

 

2. Nodes: The Workers That Perform the Tasks

If the state is the shared workspace, nodes are the workers operating on that workspace. A node represents one discrete unit of work.

 

Our travel workflow could contain nodes such as:

 

·      Trip Planning Node

·      Flight Search Node

·      Hotel Search Node

·      Budget Check Node

·      Itinerary Node

 

Each node has a specific responsibility.

 

For example:

 

Flight Search Node:

Read: destination travelers dates Perform: Search available flights Write: flightOptions

   

Hotel Search Node:

 

Read: destination dates travelers Perform: Search available hotels Write: hotelOptions

   

Budget Check Node:

 

Read: budget flightOptions hotelOptions Perform: Calculate total estimated cost Write: budgetStatus

Notice that each node has a limited responsibility.

 

·      The Flight Search Node does not try to create the itinerary.

·      The Hotel Search Node does not decide whether the trip is within budget.

·      The Budget Check Node does not search for flights.

 

This separation is an important architectural principle:

> A node should do one thing well.

 

This makes the workflow modular. If we later decide to replace our flight provider, we only need to modify or replace the Flight Search Node.

 

The rest of the workflow can remain unchanged. Nodes can also be implemented in different ways. One node might be an LLM-powered agent, another might call an external API, and another might simply execute deterministic business logic.

 

For example:

Travel Workflow │ ┌──────────────────┼──────────────────┐ ↓ ↓ ↓ Flight Search Hotel Search Budget Check Agent/API Agent/API Function

The workflow doesn't really care how a node performs its work. It only cares about the input it receives and the state it produces.

 

3. Edges: The Routing and Decision Logic

Now we have the state and the workers. But there is still one important question: Who decides which worker should run next?, that is the responsibility of the edges.

 

Edges represent the routing logic between nodes. For example, our workflow might initially look like:

Start │ ▼ Flight Search │ ▼ Hotel Search │ ▼ Budget Check │ ▼ Itinerary │ ▼ Finish

In a traditional workflow, these edges can be completely deterministic. For example:

After Flight Search ↓ Always run Hotel Search

   

But agentic workflows can make these decisions dynamically.

 

Suppose the Budget Check Node discovers that the selected flights and hotels cost $4,200, while the user's budget is only $3,000. The workflow shouldn't blindly continue to generate the final itinerary. Instead, the routing logic can inspect the state and decide:

 

Budget Check │ ▼ Is budget exceeded? │ ┌──┴───┐ Yes No │ │ ▼ ▼ Find Create Cheaper Itinerary Options

   

The workflow can therefore adapt to the situation. In a more agentic implementation, an LLM can act as the routing manager. It can inspect the current state and decide.

 

> "The current options exceed the user's budget. We should search for cheaper hotels."

 

The workflow then routes execution back to the Hotel Search Node. After the hotel options are updated, the Budget Check Node runs again. If the budget is now acceptable, the workflow moves forward to the Itinerary Node.

 

This creates a dynamic execution path:

 

Start │ ▼ Flight Search │ ▼ Hotel Search │ ▼ Budget Check │ ├── Budget OK ──────────→ Itinerary │ └── Over Budget │ ▼ Hotel Search │ ▼ Budget Check │ └──────────────→ Itinerary

   

This is where agentic workflows become particularly powerful. The workflow is no longer just a fixed sequence of steps. The state influences the routing decision, and the routing decision determines which node executes next.

 

So we can think of the three components this way:

State ↓ "What do we know right now?"

Nodes ↓ "What work can we perform?"
Edges ↓ "Where should we go next?"

 

Together, they form the basic anatomy of an agentic workflow.

  • State: provides the shared memory.
  • Nodes: perform the work.
  • Edges: control the flow of execution.

Once we understand these three building blocks, we can start designing more sophisticated workflows with branching, loops, parallel execution, retries, human approval, and dynamic agent routing.

 

Previous                                                    Next                                                    Home
Read Entire Article