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
| Criterion | Workflow | Agent |
|---|---|---|
| Logic | Deterministic: steps are defined in advance | Autonomous: the agent reasons and decides at each step |
| Trigger | Automatic (cron, webhook, event) or manual | Conversation or API call |
| Inputs | Structured (variables, triggers) | Natural language (questions, instructions) |
| Outputs | Predictable and reproducible | Variable depending on context and reasoning |
| Error handling | Managed by dedicated blocks (retry, error_handler) | The agent adapts its strategy |
| Complexity | Processes with clear rules | Vague or exploratory tasks |
| Monitoring | Per 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_agentblock in a workflow delegates an analysis task to an agent. - Agent → Workflow: an agent uses the
workflowtool 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
- Create a workflow — Get started with the Workflow Builder
- Create an agent — Configure your first agent
Need help?
Contact us: Support and contact.