A tablet showing charts and graphs next to a coffee cup, banner image on the How AI agents fit inside workflows page

HiringsAI blog

How AI agents fit inside workflows

The agent is not the workflow. It is one node inside a fixed envelope that decides when it starts, what it may touch, and who can stop it. How the agent framework, Anthropic, OpenAI and the node-based workflow tool document the fit.

The envelope: fixed outside, flexible insidefixed triggerwebhook, schedule,new rowThe agent nodedecides which toolsto call, in which order(the node-based workflow tool's AI Agent node wording)fixed finishvalidate, store,notifyhuman gateinterrupt + approveThe envelope's path is predefined; the agent slot's is notThe agent framework: workflows have predetermined code paths; agents define their own
01

The short answer

An agent in production rarely runs alone.

The agent framework's workflows-and-agentsThe agent framework's workflows-and-agents guide draws the line its whole documentation is built on: workflows have predetermined code paths and are designed to operate in a certain order, while agents are dynamic and define their own processes and tool usage.
Anthropic's building-effective-agents guideAnthropic's building-effective-agents guide makes the same split and then points at the combination: its patterns are ways to arrange LLM calls inside fixed structures, and even its autonomous agent is described as operating inside a loop with environment feedback, not outside any structure at all.
The practical shapeThe practical shape that falls out of both documents is the envelope: a trigger you control starts the run, deterministic steps handle the input and the output, and one or more agent slots sit in the middle doing the part that needs judgment.
The agent decides which tools to call and in which orderThe envelope decides when the agent runs, what data it sees, and what happens to whatever it produces.

The short answer

An agent in production rarely runs alone. The agent framework's workflows-and-agents guide draws the line its whole documentation is built on: workflows have predetermined code paths and are designed to operate in a certain order, while agents are dynamic and define their own processes and tool usage. Anthropic's building-effective-agents guide makes the same split and then points at the combination: its patterns are ways to arrange LLM calls inside fixed structures, and even its autonomous agent is described as operating inside a loop with environment feedback, not outside any structure at all. The practical shape that falls out of both documents is the envelope: a trigger you control starts the run, deterministic steps handle the input and the output, and one or more agent slots sit in the middle doing the part that needs judgment. The agent decides which tools to call and in which order; the envelope decides when the agent runs, what data it sees, and what happens to whatever it produces.

Five pages were: the agent framework's workflows-and-agents pattern guide and its interrupts reference, Anthropic's building-effective-agents engineering guide, OpenAI's practical guide to building agents, and the node-based workflow tool's AI Agent node documentation. Every mechanism below is attributed to the page that documents it, and where a page is silent about something, that silence is stated rather than filled.

02

Where the agent slot goes: the pattern cards

The agent framework's guide catalogs five arrangements, and reading them together shows where an agent can sit.

Routing processes the input, classifies itRouting processes the input, classifies it, And directs it to a specialized flow, so the agentic decision is front-loaded: the router chooses which predetermined path runs.
Parallelization fans independent subtasks out to run at the same time and aggregates the results
Orchestrator-worker is the closestOrchestrator-worker is the closest to a free agent while staying a workflow: the orchestrator LLM breaks the task into subtasks, delegates them to worker calls, and synthesizes the results, and the agent framework notes it suits cases where the subtasks cannot be predicted in advance, its example being a coding task that must change an unknown number of files.
Evaluator-optimizer loops a generator against an evaluator until the output clears a bar

Where the agent slot goes: the pattern cards

The agent framework's guide catalogs five arrangements, and reading them together shows where an agent can sit. Prompt chaining runs LLM calls in a fixed sequence where each processes the previous output, with a gate between steps; the agent framework describes it for well-defined tasks that break into smaller, verifiable steps. Routing processes the input, classifies it, and directs it to a specialized flow, so the agentic decision is front-loaded: the router chooses which predetermined path runs. Parallelization fans independent subtasks out to run at the same time and aggregates the results. Orchestrator-worker is the closest to a free agent while staying a workflow: the orchestrator LLM breaks the task into subtasks, delegates them to worker calls, and synthesizes the results, and the agent framework notes it suits cases where the subtasks cannot be predicted in advance, its example being a coding task that must change an unknown number of files. Evaluator-optimizer loops a generator against an evaluator until the output clears a bar.

Anthropic's guide covers the same five patterns under the same names and adds the building block underneath all of them: the augmented LLM, a model enhanced with retrieval, tools and memory. That framing matters for the envelope question. Anthropic's point is that the agent slot is not a different species from the workflow around it; it is the same component with more latitude. Start with the augmented LLM, put it in a chain when the steps are known, let it route when the branches are known, promote it to orchestrator when the subtasks are not known, and only run it as a fully autonomous agent when the task needs open-ended loops. Each step up the ladder moves latitude out of the envelope and into the slot.

where the slot goes (the agent framework and Anthropic, same five patterns)prompt chainLLM to LLM in a fixed order,gate between stepsslot latitude: lowestroutingclassify input, pick apredefined branchslot latitude: branch choiceorchestrator-workerorchestrator splits subtasks,workers run, it synthesizesslot latitude: subtasks unknownevaluator-optimizergenerate, evaluate, loopuntil the output clears the barslot latitude: retry freedomThe fifth card, parallelization, fans fixed subtasks out and aggregates themlatitude labels are a synthesis of the two guides; neither guide ranks the patternsboth guides present these as combinable, not a ladder you must climb The slot replaces the steps you cannot predefineno slot: every branch drawn by handstep 1branch Abranch Bbranch Cwith a slot: branches collapse into one nodefixed input stepsagent nodepicks tools per runfixed output stepssynthesis; the agent framework's wording: subtasks that cannot be predicted in advance
03

The agent as one node: the node-based workflow tool's version

The node-based workflow tool makes the envelope literal.

Its AI Agent node documentationIts AI Agent node documentation describes a single node on the canvas that you connect to a chat model and one or more tool sub-nodes, and the agent then decides which tools to call to complete the task.
The page's own definition of the agent is worth quoting closelyAn autonomous system that receives data, makes decisions, and acts within its environment to achieve goals, where the environment is everything the agent can access that is not the agent itself.
In envelope terms the canvas is the environment boundary
The page also requires at least one tool sub-nodeAn agent node with no tools is a configuration error, not a minimalist setup.

The agent as one node: the node-based workflow tool's version

The node-based workflow tool makes the envelope literal. Its AI Agent node documentation describes a single node on the canvas that you connect to a chat model and one or more tool sub-nodes, and the agent then decides which tools to call to complete the task. The page's own definition of the agent is worth quoting closely: an autonomous system that receives data, makes decisions, and acts within its environment to achieve goals, where the environment is everything the agent can access that is not the agent itself. In envelope terms, the canvas is the environment boundary. The agent can only touch what you wired into it as sub-nodes; everything upstream and downstream of the node is the ordinary deterministic workflow. The page also requires at least one tool sub-node: an agent node with no tools is a configuration error, not a minimalist setup.

Two maintenance notes on that page show the node evolving toward the envelope model rather than away from it. The agent-type setting is deprecated from the node-based workflow tool 1.82.0: every AI Agent node now behaves as a Tools Agent, which the page says was the recommended and most used setting, and the older v1 node that still carries the setting will be removed in the node-based workflow tool 3.0. For the old specialized types like the SQL Agent, the documented replacement is a recent Agent node with a Postgres or MySQL tool sub-node attached. The direction is consistent with the rest of this article: fewer kinds of agent, more composition of one agent node with explicit tools inside a deterministic workflow.

The node-based workflow tool's AI Agent node, from its documentationAI Agent nodedecides which tools to callchat modelsub-nodetool sub-nodesat least one required(the page's rule)memoryoptional sub-nodeMCP serverconnect as a tool(page's pointer)everything not wired in as a sub-node is outside the agent's environmentsince the node-based workflow tool 1.82.0 every AI Agent node behaves as a Tools Agent (its page)The v1 node with the agent-type setting is removed in the node-based workflow tool 3.0 (its page)
04

The human gate: interrupts that pause the whole graph

The strongest mechanism the agent framework's documentation offers for fitting an agent inside a larger process is the interrupt.

Its interrupts reference is precise about the mechanicsCalling interrupt() inside any node suspends graph execution, the checkpointer saves the exact graph state, and the graph waits indefinitely until you resume it by invoking again with a Command carrying the human's response, which becomes the return value of the interrupt call inside the node.
The interrupt payload can be any JSON-serializable valueThe interrupt payload can be any JSON-serializable value, So the node can hand the reviewer a full description of the pending action, not just a yes-or-no flag.
The reference catalogs the patterns the gate takes
Approve-or-reject pauses before a critical action, an API callA database change, any important decision, and routes to a proceed or cancel branch based on the response.

The human gate: interrupts that pause the whole graph

The strongest mechanism the agent framework's documentation offers for fitting an agent inside a larger process is the interrupt. Its interrupts reference is precise about the mechanics: calling interrupt() inside any node suspends graph execution, the checkpointer saves the exact graph state, and the graph waits indefinitely until you resume it by invoking again with a Command carrying the human's response, which becomes the return value of the interrupt call inside the node. The interrupt payload can be any JSON-serializable value, so the node can hand the reviewer a full description of the pending action, not just a yes-or-no flag. And interrupts are dynamic: unlike static breakpoints that pause before or after a node, they can be placed anywhere in the code and can be conditional on the run's own state, which is what makes "ask a human only when the amount exceeds X" expressible.

The reference catalogs the patterns the gate takes. Approve-or-reject pauses before a critical action, an API call, a database change, any important decision, and routes to a proceed or cancel branch based on the response. Review-and-edit lets the human modify the graph's state before execution continues, so the reviewer fixes the agent's draft rather than merely accepting it. Interrupts can also live inside tool functions themselves, so a specific tool always pauses for approval whenever the agent calls it, regardless of which node invoked it. That last pattern is the envelope tightened to its smallest unit: not a gate around the workflow, but a lock on the dangerous tool.

an interrupt's lifecycle (the agent framework's reference)node runsreaches interrupt()graph suspendscheckpointer savesexact statewaitsindefinitelyresume with Commandresponse becomes interrupt()'s return valuepayload is any JSON value: show the reviewer the whole pending actioninterrupts can be conditional on run state, unlike static breakpoints (the page's contrast) three gate patterns, one reference pageapprove / rejectpause before a criticalaction; yes routes toproceed, no to cancelThe page's examples:API call, DB changereview and edithuman modifies thegraph state, then therun continues with itfix the draft, not justaccept itinterrupt in a toolThe tool pauses forapproval on every call,whoever invoked ita lock on the tool,not the workflowall three are the same mechanism placed at different depthssummary of the patterns section; the reference also covers validating human input

One rule in the reference deserves its own paragraph, because it changes how you write the node. When a run resumes from an interrupt, the runtime restarts the entire node from the beginning; it does not resume from the line where interrupt() was called, so every statement before the interrupt executes again. The page's consequence is blunt: side effects called before an interrupt must be idempotent, because they will run twice. Its companion rules follow from the same mechanism: do not wrap interrupt calls in a bare try/except, because the pause works by raising a special exception that your handler would swallow, and do not reorder interrupt calls within a node between edits. These are the details that separate a gate that works in the demo from one that double-charges a card on the first real approval.

The restart rule (the page's warning, not ours)node line 1 to N: runs on first entryinterrupt() suspends; state saved; human answerson resume: the node restarts from line 1, not from the interrupt lineso anything before the interrupt runs twice; side effects there must be idempotentThe page's rules: no bare try/except around interrupt, no reordering interrupts in a node
05

Guardrails around the slot: OpenAI's layering

OpenAI's practical guide to building agents approaches the same fit from the safety side.

The agent slot sits inside several concentric checks rather than behind one wall
The guide's human-intervention section names two triggers that should hand control to a person
The first is exceeding failure thresholdsThe first is exceeding failure thresholds, set limits on retries or actions, and when the agent exceeds them, escalate.
The second is high-risk actions, anything sensitiveIrreversible or high-stakes should require confirmation before execution.

Guardrails around the slot: OpenAI's layering

OpenAI's practical guide to building agents approaches the same fit from the safety side. Its advice is to stop looking for one control and build a layered defense: a single guardrail is unlikely to be sufficient, so the guide stacks complementary mechanisms, relevance classifiers on inputs, safety filters on outputs, rules-based checks like blocklists and limits, and tool-risk ratings that decide what the agent may invoke without review. The agent slot sits inside several concentric checks rather than behind one wall.

The guide's human-intervention section names two triggers that should hand control to a person. The first is exceeding failure thresholds: set limits on retries or actions, and when the agent exceeds them, escalate. The second is high-risk actions: anything sensitive, irreversible or high-stakes should require confirmation before execution. Read beside the agent framework's interrupt mechanics, this is the policy layer and the mechanism layer of the same gate. OpenAI's guide tells you when to pause; the agent framework's reference shows the pause as a first-class, resumable operation inside the graph rather than an exception that kills the run. Neither page covers the other's content: OpenAI's guide does not document the agent framework's checkpoint mechanics, and the agent framework's reference does not prescribe when a business should require approval. The two pages are complementary, and this article is where they meet.

layers, not a wall (OpenAI's guide)human escalation: failure thresholds, high-risk actionsrules-based checks: blocklists, limits, tool-risk ratingsinput relevance + output safety filtersThe agentand its toolsThe guide's premise: a single guardrail is unlikely to be sufficientlayer list condensed from its guardrails section; placement on rings is our drawing when to hand control to a person (OpenAI's two triggers)failure threshold hitlimits on retries or actions;exceeding them escalatesThe agent got stuck, not caughthigh-risk action pendingsensitive, irreversible orhigh-stakes: confirm firstThe action was fine; the stakes were notone trigger watches the agent's competence, the other watches the action's blast radius
06

Choosing how much latitude the slot gets

Both engineering guides argue for restraint, in nearly the same words.

Both engineering guides argue for restraintBoth engineering guides argue for restraint, in nearly the same words.
Anthropic's guide opens with the recommendationAnthropic's guide opens with the recommendation to find the simplest solution possible and increase complexity only when needed, warning that agentic systems trade latency and cost for task performance, and that for many applications optimizing single LLM calls with retrieval and in-context examples is enough.
Its rule of thumbIts rule of thumb, workflows offer predictability and consistency for well-defined tasks, while agents are the better option when flexibility and model-driven decision-making are needed at scale.
OpenAI's guide echoes the shape from the product sideStart with a single agent and add structure as the use case proves it needs it.
Draw the deterministic skeleton firstDraw the deterministic skeleton first, mark the steps where you cannot predefine the path, and put the agent exactly there, with a gate at whatever depth the blast radius justifies. how much latitude, per Anthropic's guide task well-defined: plain workflow; predictability and consistency win branches known: routing picks among predefined flows subtasks unpredictable: orchestrator-worker (the agent framework's coding example) open-ended loop needed: autonomous agent, inside guardrails and gates The guide's caution: agentic systems trade latency and cost for task performance its starting point: find the simplest solution possible; add complexity only when needed

Choosing how much latitude the slot gets

Both engineering guides argue for restraint, in nearly the same words. Anthropic's guide opens with the recommendation to find the simplest solution possible and increase complexity only when needed, warning that agentic systems trade latency and cost for task performance, and that for many applications optimizing single LLM calls with retrieval and in-context examples is enough. Its rule of thumb: workflows offer predictability and consistency for well-defined tasks, while agents are the better option when flexibility and model-driven decision-making are needed at scale. OpenAI's guide echoes the shape from the product side: start with a single agent and add structure as the use case proves it needs it. The envelope follows naturally. Draw the deterministic skeleton first, mark the steps where you cannot predefine the path, and put the agent exactly there, with a gate at whatever depth the blast radius justifies.

how much latitude, per Anthropic's guidetask well-defined: plain workflow; predictability and consistency winbranches known: routing picks among predefined flowssubtasks unpredictable: orchestrator-worker (the agent framework's coding example)open-ended loop needed: autonomous agent, inside guardrails and gatesThe guide's caution: agentic systems trade latency and cost for task performanceits starting point: find the simplest solution possible; add complexity only when needed
07

A worked assembly, with the pieces named

Put the pieces together on one concrete shape: a support-refund pipeline.

Put the pieces together on one concrete shapePut the pieces together on one concrete shape, a support-refund pipeline.
A webhook starts the runA webhook starts the run, deterministic steps fetch the order and compute the refund ceiling from your policy table.
Then the agent slot, it reads the customer's messageDecides which tools to call (order lookup, prior-ticket search), and drafts a resolution.
A rules-based checkA rules-based check from OpenAI's layered list compares the drafted refund against the ceiling: over the ceiling is a high-risk action by the guide's definition, so the run pauses on a agent framework-style interrupt, the reviewer sees the full payload, approves, edits the amount, or rejects, and the node resumes from its beginning, which is safe because nothing before the interrupt charged anything.
Under the ceiling, the run skips the gate entirelyUnder the ceiling, the run skips the gate entirely, Because the interrupt was conditional.

A worked assembly, with the pieces named

Put the pieces together on one concrete shape: a support-refund pipeline. A webhook starts the run; deterministic steps fetch the order and compute the refund ceiling from your policy table. Then the agent slot: it reads the customer's message, decides which tools to call (order lookup, prior-ticket search), and drafts a resolution. Now the gates, at two depths. A rules-based check from OpenAI's layered list compares the drafted refund against the ceiling: over the ceiling is a high-risk action by the guide's definition, so the run pauses on a agent framework-style interrupt, the reviewer sees the full payload, approves, edits the amount, or rejects, and the node resumes from its beginning, which is safe because nothing before the interrupt charged anything. Under the ceiling, the run skips the gate entirely, because the interrupt was conditional. A retry counter enforces the other trigger: if the agent's tool calls fail past the threshold, the run escalates instead of looping. The envelope did the routing, the ceilings, the pausing and the escalation; the agent did only the reading and the drafting. That division is the whole article in one pipeline.

The example is a synthesis assembled from the five vendor documentation: the envelope shape from the agent framework and Anthropic, the tool-choice behavior from the node-based workflow tool's node definition, the ceiling and retry triggers from OpenAI's intervention list, and the pause mechanics from the agent framework's interrupts reference. No vendor documents this exact pipeline, and nothing in the example requires behavior beyond what the vendors' documentation state.

08

Limits of this account

Three honest boundaries.

First, the pages reviewedFirst, the pages reviewed are framework and platform documentation: they describe mechanisms, not your workloads, and none of them measures how often production agents actually stay inside their envelopes.
Second, vendor scope, this article reads the agent frameworkAnthropic, OpenAI and the node-based workflow tool.
The durable-execution engine's durable-execution modelThe trigger-action tool's Agents product and Microsoft's the AI assistant Studio approach the same fit differently, and their pages are not part of this article's evidence.
Third, the patternThird, the pattern names are Anthropic's and the agent framework's vocabulary; other frameworks name the same shapes differently, and nothing here claims these five patterns are exhaustive.

Limits of this account

Three honest boundaries. First, the pages reviewed are framework and platform documentation: they describe mechanisms, not your workloads, and none of them measures how often production agents actually stay inside their envelopes. Second, vendor scope: this article reads the agent framework, Anthropic, OpenAI and the node-based workflow tool. The durable-execution engine's durable-execution model, the trigger-action tool's Agents product and Microsoft's the AI assistant Studio approach the same fit differently, and their pages are not part of this article's evidence. Third, the pattern names are Anthropic's and the agent framework's vocabulary; other frameworks name the same shapes differently, and nothing here claims these five patterns are exhaustive.

09

Where this leaves you

"Add an agent" is not a design.

The design is an envelope, a trigger you controlDeterministic steps for the parts you can predefine, an agent node wired to exactly the tools it needs, a human gate at the depth the stakes justify, and an escalation path for the day the agent gets stuck rather than caught.
The reviewed documentation agreesThe reviewed documentation agrees on that shape from four directions, the agent framework's mechanics, Anthropic's patterns, OpenAI's guardrails and the node-based workflow tool's canvas.
The agent earnsThe agent earns its slot by doing the part you could not draw in advance; everything else in the workflow exists to make that part safe to run.

Where this leaves you

"Add an agent" is not a design. The design is an envelope: a trigger you control, deterministic steps for the parts you can predefine, an agent node wired to exactly the tools it needs, a human gate at the depth the stakes justify, and an escalation path for the day the agent gets stuck rather than caught. The reviewed documentation agrees on that shape from four directions, the agent framework's mechanics, Anthropic's patterns, OpenAI's guardrails and the node-based workflow tool's canvas. The agent earns its slot by doing the part you could not draw in advance; everything else in the workflow exists to make that part safe to run.

The envelope, as a checklist1. draw the fixed skeleton first: trigger, input steps, output steps2. agent slot only where the path cannot be predefined3. wire in the minimum tools; the node-based workflow tool's rule: at least one, and no more than needed4. conditional interrupts on high-risk actions; idempotent code before each5. retry and action thresholds that escalate to a person, per OpenAI's guideeach row's source behavior is named in the sections above; the checklist itself is synthesis
A wooden desk with glasses, a coffee cup, a plant and the edge of a laptop, banner image on the How AI agents fit inside workflows page

Keep reading, or try a tool.

Long-form guides on building, automating and AI computing.