Major

How to Build an Agentic Workflow: Patterns, Steps, and Limits

Most guides define agentic workflows and stop. This one builds one: the five patterns worth knowing, an ordered path from goal to running artifact, and the honest rule for deciding which steps should stop being reasoning and become code.

Rahul RamakrishnanUpdated
Workflow diagram and user goals sketched on a desk for planning an agentic workflow

How do you build an agentic workflow?

Define the goal as a pass/fail test, pick the simplest pattern that passes it, give the agent scoped tools, put programmatic checks between steps, and run it against real cases. Then take every step that behaves the same way each time and move it out of the model into code. On Major, that last move is built in: the agent reasons through the work once, builds an app for the repeatable stretch, and runs the app from then on.

This is written for AI operators and platform leads who have a workflow working in a demo and need it to survive production. An agentic workflow is a process where a model decides which steps to take and calls tools to carry them out, instead of following a sequence a developer fixed in advance. The flexibility is the point. It is also the cost, because every run is reasoned again and can take a different path.

Pick the simplest of five patterns

Anthropic's Building effective agents lays out five workflow patterns. Choose by how much the path varies.

  • Prompt chaining: a fixed sequence of model calls, each feeding the next. Use it when you can list the steps in advance.
  • Routing: classify the input, then send it to a specialized handler. Use it when inputs fall into distinct categories.
  • Parallelization: run independent subtasks at once, or run the same task several times and compare. Use it when speed or confidence matters.
  • Orchestrator-workers: a lead model decomposes the task and delegates. Use it only when you cannot predict the subtasks. It costs more and fails in more places.
  • Evaluator-optimizer: one model drafts, another critiques, and the loop repeats until a bar is met. Use it when you can state the bar clearly.

Most production work is a chain or a router. Reaching for orchestrator-workers first is the most common over-build.

Build it in six steps

  1. Write the goal as a test. "Every invoice over $5,000 is matched to a purchase order or flagged with a reason" can pass or fail. "Handle invoices" cannot.
  2. Run five real cases by hand. Write the steps down for each. If the sequence is identical across all five, you need a fixed automation with one model call. Where it diverges in ways you cannot list in advance, that divergence is what the agent handles.
  3. Choose the pattern. Start with the simplest one from the list above.
  4. Scope the tools. Give each step the minimum permission it needs. An agent that can read a ledger does not also need to write to it.
  5. Add gates between steps. A schema check, a range check or a lookup that must return a row. A gate stops a bad intermediate output from propagating.
  6. Put a person on anything irreversible. Sending an external message or moving money gets an approval point.

Skip the agent entirely if the full process is already specified. A cron job is simpler and cheaper.

What breaks first in production

Compounding error and non-deterministic retries. A five-step chain at 95 percent reliability per step lands near 77 percent overall (0.95 to the fifth power), and nothing tells you which step degraded.

Retries do not replay either. The same input can produce a different tool selection and a different path, so a retry is only idempotent when the retried step is code. Audit has the same problem: two runs of one task leave two different trails, and an auditor asking what happened in March gets a probabilistic answer.

State is the third failure. A context window is a poor database. It is expensive to refill, it disappears when the session ends, and a workflow that pauses for a human approval has nowhere durable to wait.

Reasoning versus rules: where each belongs

Deterministic automation, the kind a Zap or a cron job runs, is right when the task is stable and inputs are predictable. Moving a row between systems or sending a templated email when a deal closes needs no judgment at runtime. Encoding it once is cheaper and easier to audit.

Agentic steps earn their place where inputs are messy: triaging a support queue, reconciling records that do not line up, reading a contract clause. Most real workflows are hybrids with a predictable spine and a few branches that need judgment. The design question is which parts deserve a model at runtime.

Build the workflow on Major

Major is the enterprise platform where agents build the software they run on. That gives the hybrid a home. Here is the invoice-matching example from step 1 as a concrete build.

  • Connectors: NetSuite for purchase orders and the ledger, Gmail for vendor email, Slack for approvals. Credentials are scoped per connector through the credential proxy, so the agent holds no raw keys.
  • The app: a reconciliation app with its own managed database holding invoices, match status and exceptions. State lives there, so a run that pauses for approval resumes from stored rows rather than a replayed conversation.
  • The agent and its judgment: the agent decides what to do with exceptions, such as a vendor name that almost matches, a contract term that changes the amount owed, or an email that needs a reply. The deterministic matching runs as app code.
  • The trigger: a workflow on a schedule or on a new-invoice event runs the app. The agent is called only for rows the app cannot resolve.
  • Human gate: anything over a threshold posts to Slack and waits for a named approver.
  • Governance: role-based access decides who can see and change the app, and audit logs record each action with the identity that took it. An action can be reconstructed afterward, which is what separates this from a black box.

This is the claim only a platform that builds apps can make. Agents on the market that store learned skills still run each execution through the model. A Major app is code the agent wrote once and then steps out of, so the repeatable stretch stays the same on run one thousand as on run one, and token cost is front-loaded and then flat rather than climbing with volume. The model still does less, not nothing. It keeps the exceptions.

Start building free and describe your own workflow to see which steps the agent turns into an app.

What this does not cover

Evaluation of the judgment steps is a separate and harder problem. Gates and approval points catch bad outputs after the fact, but measuring whether the agent's exception calls are good over time needs its own test set and deserves its own piece. Agentic workflows also do not replace the people who own the goal. A person defines the pass/fail test and signs off above the threshold.

Start building on Major

Describe the workflow you have running in a demo and let a Major agent build the deterministic app for its repeatable steps, with scoped credentials, managed state and audit on every action.

Related articles

Frequently asked questions

What is an agentic workflow?
An agentic workflow is a process where an AI model decides which steps to take and calls tools to carry them out, instead of following a sequence a developer fixed in advance. The model plans, acts, reads the result, and repeats until a goal test passes, which is what separates it from a script. That flexibility is the point and also the cost, since every run is reasoned again and can take a different path. On Major, the repeatable steps of a workflow become a deterministic app the agent runs, so the workflow holds its own state and audit trail rather than being re-derived each time.
What is the best agentic workflow?
The best agentic workflow is the simplest pattern that passes your success test. Anthropic's taxonomy gives you five to choose from: prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer. Select by how much the path varies. A fixed sequence takes prompt chaining, distinct input categories take routing, and only unpredictable decomposition justifies orchestrator-workers, which costs more and fails in more places. Major pushes the same way, because once a pattern is stable the agent can write it as an app and stop paying for the reasoning on every run.
What are the 5 essential elements to start implementing agentic solutions?
The five are a goal written as a pass/fail test, tools scoped to the minimum permission each step needs, a state store that outlives the run so work resumes instead of restarting, programmatic gates between steps that stop a bad intermediate output from propagating, and a human approval point on anything irreversible such as sending an external message or moving money. Four of the five are infrastructure rather than prompting. Major supplies those four by default, with scoped credentials through a credential proxy, a managed database inside the app, and audit written where the agent acts. Defining the pass/fail test stays with you.
How do I know if my workflow should be agentic or a fixed automation?
Write the workflow down as a numbered sequence for five real cases: if the sequence is identical across all five, build a fixed automation with one model call, and if it diverges in ways you cannot enumerate in advance, that divergence is what an agent handles. Most real processes are a mix, with a predictable spine and a few branches that need judgment. Major is built for that mix, since the agent reasons over the branch and runs an app for the spine. If the entire process is already fully specified, a plain cron job is simpler and you do not need an agent at all.
Can ChatGPT create workflows?
ChatGPT can draft and reason through a workflow and run steps inside a conversation, but it does not give you durable, scheduled, permissioned execution. There is no managed state between sessions, no scoped credentials per step, and no audit trail an auditor would accept. Production work needs software that keeps running when the chat window is closed. Major closes that gap by having the agent build the workflow into a deployed app with SSO, permissions, a database and logs, so the same steps run on a schedule without anyone typing.
What breaks first when an agentic workflow goes to production?
Compounding errors and non-deterministic retries break first. A five-step chain at ninety-five percent per-step reliability lands near seventy-seven percent overall, and nothing tells you which step degraded. Retrying does not replay either: the same input can produce a different tool selection and a different path, so retry logic is not idempotent unless the retried step is code. That is the case for turning stable steps into a Major app, where a failed run resumes from stored state and reruns the same code rather than guessing at the path again.