Skip to content

Start building

Agents

AI agents vs workflows: when to use which

Use a workflow when you know the steps in advance, and an AI agent when the steps depend on what it finds. A workflow follows a fixed path you drew; an agent chooses its own path with a language model, within the tools and limits you give it.

Updated · 5 min read

What is a workflow?

A workflow is a set of steps that runs when something starts it: a schedule, a call from another system, or a person pressing Run. Each step does one thing, such as reading a record, calling an API or sending a message. Conditions choose between branches, and failed steps are retried.

Because the path is drawn in advance, a workflow does the same thing every time it gets the same input. That makes it cheap to run, easy to test and easy to explain to an auditor.

What is an AI agent?

An AI agent is given a goal, instructions and a set of tools, and a language model decides at run time which tools to call and in what order. It can deal with free text, with surprises and with requests nobody planned for. The price is that it can take a different path on different days, and every step costs a model call. What is an AI agent? explains the loop in more detail.

How do AI agents and workflows compare?

  • The path

    Workflow
    Fixed, drawn in advance
    AI agent
    Chosen by the model as it goes
  • Best for

    Workflow
    Repeatable processes
    AI agent
    Open-ended requests and messy input
  • Cost per run

    Workflow
    Low; a model is called only where you add one
    AI agent
    A model call for every step
  • Same input, same result?

    Workflow
    Yes
    AI agent
    Usually, not always
  • How you test it

    Workflow
    Run each branch
    AI agent
    Try many example requests and read the tool calls
  • When a step fails

    Workflow
    It is retried, then follows its error path
    AI agent
    The model reads the error and decides what to do

When should you use a workflow?

  • You can write the steps down before you start.
  • It must run on a timer, or when another system calls it.
  • The result must be the same every time, for example for finance or compliance.
  • It runs at high volume, where a model call per step would cost too much.
  • The input is already structured, such as a form submission or a webhook from another system.

When should you use an AI agent?

  • The input is free text: an email, a chat message, a support ticket.
  • The next step depends on what the last one found.
  • Many different tools might apply, and choosing between them takes judgment.
  • A person is talking to it and expects a sensible answer to an unplanned question.

Can you combine agents and workflows?

Yes, and it is often the best design. Let the workflow own the trigger, the timing and the fixed steps, and call a model or an agent only for the part that needs judgment. The run stays predictable where it can be, and flexible where it must be.

A worked example: a website form sends each new enquiry to a workflow.

  1. The workflow starts from a signed webhook when the form is submitted.
  2. An “Ask AI” step reads the message and returns JSON with one field, the kind of enquiry, checked against a schema.
  3. A switch step sends sales enquiries one way and everything else another.
  4. For sales, an agent step researches the company and creates or updates the contact in the CRM. Its CRM writes wait for a person’s approval.
  5. For everything else, an action step posts the enquiry to the support channel in Slack.

Only two of those steps call a model, and only one of them can choose its own path.

How do workflows and agents work together in MyDeepAgents?

Workflows are drawn on a visual canvas in the console. These steps can run today:

  • Action: one action of a connected tool, or one tool of an MCP server.
  • HTTP request: a call to any HTTPS address, optionally with a key that is sent only to the hosts you list.
  • Ask AI: one model call with no tools, answering in text or in JSON checked against a schema.
  • Agent: runs one of your published agents and waits for it, including any approvals its tools need.
  • Condition and switch: choose a branch.
  • Set: store values for later steps.
  • Delay: wait for a time or until a date, on a timer that survives restarts.
  • End: finish the run as completed or failed, with an output.

A workflow starts from a webhook (signed with HMAC SHA-256 and a timestamp, or checked against a static token), from a schedule written as a cron line in your time zone, or by hand and through the API. Each run is a durable Temporal workflow that can last up to 30 days. Action and HTTP steps are retried three times by default with a growing wait between tries, and a step that still fails can follow its own error path.

Key points

  • A workflow follows a path you drew; an agent chooses its path with a model.
  • Use workflows for known, repeatable steps, timers and high volume.
  • Use agents for free text, judgment and requests nobody planned for.
  • The strongest designs combine them: a workflow for the frame, AI only where judgment is needed.
  • In MyDeepAgents a workflow can call a model with an Ask AI step, or run a whole agent with an agent step.

Questions people also ask

Is an AI agent just a workflow with a model in it?

No. In a workflow you choose the steps and their order in advance, even if one step calls a model. In an agent the model chooses the steps while it runs.

Which is cheaper to run, an agent or a workflow?

Usually a workflow. Its steps are ordinary calls, and a model is used only where you add an AI step. An agent calls the model before every step it takes.

Can a workflow wait for a person to approve something?

In MyDeepAgents, through an agent step. When the agent reaches a tool that needs approval, the workflow waits until a person approves or rejects it. A separate approval step for workflows is not available yet.

Can a workflow run on a schedule?

Yes. In MyDeepAgents a schedule is a five-field cron line with a time zone, such as every weekday at 8:00 in Asia/Kolkata.

Early access

Put an agent to work

Build an agent, connect it to your tools, and decide what it may do on its own. Or tell us what you want it to do.