Skip to main content

Agent or Workflow?

In brief

Ontologie offers two automation engines: Workflows and Agents. This guide helps you choose which one to use based on your needs.

What you will learn

  • The fundamental differences between an agent and a workflow
  • When to favor one over the other
  • How to combine them for advanced use cases

Quick comparison

CriterionWorkflowAgent
LogicDeterministic: steps are defined in advanceAutonomous: the agent reasons and decides at each step
TriggerAutomatic (cron, webhook, event) or manualConversation or API call
InputsStructured (variables, triggers)Natural language (questions, instructions)
OutputsPredictable and reproducibleVariable depending on context and reasoning
Error handlingManaged by dedicated blocks (retry, error_handler)The agent adapts its strategy
ComplexityProcesses with clear rulesVague or exploratory tasks
MonitoringPer execution (success/failure/logs)Per session (reasoning, tools used)

When to use a Workflow

A workflow is the right choice when:

  • The process is repetitive — The same steps repeat with each execution.
  • The rules are clear — You know exactly what to do in each case (conditions, loops, filters).
  • Reliability comes first — You need identical results with each execution.
  • The trigger is automatic — An event, a schedule or a webhook starts the process.

Examples:

  • Send a welcome email when a customer is created
  • Synchronize data between two systems every hour
  • Calculate a risk score from defined business rules
  • Generate a weekly report and send it by email

When to use an Agent

An agent is the right choice when:

  • The task is exploratory — You don't know in advance how many steps will be needed.
  • The input is in natural language — The user asks a question or gives a free-form instruction.
  • Reasoning is required — The agent must analyze, compare, and synthesize information.
  • The context changes — The answer depends on the ontology, documents, and conversation history.

Examples:

  • "Which suppliers deliver to Europe with a lead time under 5 days?"
  • "Summarize the penalty clauses in our contracts with ACME Corp"
  • "Compare the performance of our three warehouses this quarter"
  • "Suggest a sourcing strategy for the new product X"

Combining them

In advanced cases, you can use both together:

  • Workflow → Agent: an ai_agent block in a workflow delegates an analysis task to an agent.
  • Agent → Workflow: an agent uses the workflow tool to trigger a structured process.

Example: a workflow detects an anomaly in the data (deterministic logic), then calls an agent to analyze the cause and write a report (reasoning).

Expected outcome

You know when to use a workflow (repetitive processes, clear rules, automatic triggers) and when to use an agent (open questions, contextual analysis, exploration). You can also combine them for complex scenarios.

Next steps

Need help?

Contact us: Support and contact.