All 22 chapters
- Part 01 — Your First Day with AI
- Part 02 — The Developer's Toolkit
- Part 03 — Building Your First Project
- Part 04 — Leveling Up
- Part 05 — The Agent Era
- Part 06 — The Big Picture
Agentic Workflows
When AI stops answering questions and starts doing work.
Here’s the moment it clicked for me.
I was debugging a production issue. A client’s deployment had failed. The old workflow: check Vercel logs, look at recent GitHub commits, check if a database migration ran correctly in Supabase, read error monitoring in Sentry. Four tools, four browser tabs, twenty minutes of context-switching.
With Claude Code and MCP servers connected to all four services, I typed one sentence: “The last production deploy failed. Figure out why and suggest a fix.”
Claude checked the Vercel deployment logs. Found a build error. Looked at recent commits on GitHub. Identified the change. Checked the database migration status. Found a missing column. Drafted a fix, ran it against the dev database, verified it worked, and presented me with the diagnosis and the solution. Ninety seconds. I was unnecessary for the investigation — not for the decision about whether to apply the fix, but for the detective work of finding the problem.
That’s an agentic workflow. Not a single prompt and response. A goal, followed by autonomous decisions about what to check, what to try, and what to do next.
What makes something agentic
A chatbot takes your prompt and gives a response. One turn. An agent takes your goal and works toward it across multiple steps, deciding what to do next based on what it just learned. The difference is who decides the next step. Turn-by-turn directions versus a destination.
The capability ladder: single prompt → chain of thought → tool use → agentic loop → multi-agent. Most practical work in 2026 happens on rungs 2-4. The sweet spot is a single agent with good tools.
Workflows vs agents
Anthropic draws a line every builder should understand. Workflows are systems where you decide the steps in advance, and the AI executes them. Like a recipe. Agents are systems where the AI decides the steps at runtime. Like telling a chef “make something great with whatever’s in the fridge.”
Anthropic’s most important advice: “We recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all.”
Five patterns from simple to complex: prompt chaining (fixed sequence, each step feeds the next), routing (classify input, send to the right handler), parallelization (multiple calls simultaneously), orchestrator-workers (central AI decomposes and delegates), and evaluator-optimizer (one generates, another evaluates, loop until quality). Patterns 1-3 are workflows. Start there. Only go further when simpler options can’t solve your problem.
Agentic coding in 2026
Coding is the one domain where agents definitively work in production. Claude Code is the most capable and extensible — subagents for specialized roles, MCP servers for external tools, hooks and Skills for automation, Agent Teams for coordination. Three modes: interactive (safe daily driver), auto mode (faster, less oversight), and headless (CI/CD, no human in loop).
OpenAI’s Codex runs in cloud sandboxes. GitHub Copilot’s coding agent takes an issue and returns a PR — no local setup. Devin from Cognition gets a full VM and works unsupervised but independent evaluations show roughly 14% success on novel issues. We evaluated Devin for a large migration. It handled mechanical parts well, but guessed wrong on architectural decisions more often than right. We used Claude Code instead.
Beyond code
Computer use agents interact with GUIs — Anthropic’s Computer Use, OpenAI’s Operator, Google’s Project Mariner. Powerful but brittle. They work on known workflows and break on unfamiliar interfaces. Use for internal tools and testing, not autonomous browsing.
Customer support agents work at scale. Intercom’s Fin handles 65-77% of conversations autonomously at $0.99 per resolution. Sierra hit $100M ARR. The pattern: routine questions are autonomous, unusual ones escalate to humans. Getting that boundary right is the entire product.
Code review — CodeRabbit has reviewed over 13 million PRs with 50%+ reduction in manual review. But independent benchmarks show all AI review tools missed a severe S3 misconfiguration bug. Agents catch the obvious. Humans catch the subtle.
Incident response — Sentry’s Seer diagnoses production errors automatically. Datadog’s Bits AI reports up to 95% reduction in time-to-resolution. These work because incidents follow patterns.
The risks
The autonomy-reliability math is unforgiving. Even 95% reliability per step produces only 36% task completion on a 20-step workflow. Agents get stuck in loops. They burn through tokens. They occasionally take destructive actions — Replit Agent deleted a production database during an explicit code freeze.
Meta’s practical constraint: no single agent action should be both irreversible and consequential. If it’s irreversible (deleting data), require human approval. If it’s consequential (deploying to production), add a review step. Anthropic’s own research found 12% of agents prioritize sycophancy over truthfulness when goals conflict.
When NOT to build an agent
Don’t use an agent when a workflow will do. Don’t use a workflow when a simple prompt will do. Deterministic tasks (run payroll, process nightly batch) should be scripts, not agents. Well-understood decision trees should be code, not AI. Agents shine on open-ended exploration, well-scoped work with good tools, and tasks where the path depends on what you find along the way.
The bottom line
Agentic workflows are the most powerful and most overhyped capability in AI right now. Claude Code debugging across four services in two minutes — real. CodeRabbit reviewing 13 million PRs — real. Agents reliably handling novel, complex, multi-step tasks — not yet.
Start with Claude Code and MCP. One tool, one task. Watch how it works. Then add more tools, more scope, more autonomy — incrementally, with logging and cost caps. That’s the practical path to agentic workflows that actually work.
This is the free web edition of Chapter 17. The full text — with agentic workflow code examples, ReAct loop implementations, multi-agent orchestration patterns, and cost optimization strategies — is available in 42: The AI Builder’s Stack, coming Q3 2026 on Amazon in hardcover, paperback, and digital.