Introduction to Workflows
Learn about workflows in Inferable
In Inferable context, workflows provide a powerful “Workflow as Code” approach to orchestrating complex, multi-step AI agent interactions within the platform.
Language Support
Inferable is committed to supporting workflow orchestration in all the SDKs. However, Typescript is the only language that currently supports workflow as code.
Language | Supported |
---|---|
Typescript | ✅ |
Go | ❌ |
.NET | ❌ |
Orchestration Layer
Although you can’t control the control flow of the agents themselves, you can control the orchestration of a workflow. Therefore, a common pattern in building effective agentic systems is mixing a series of agents and their results in a workflow.
The goal of the workflow system is to provide a way to allow the developer to make deterministic decisions in the control flow, while still allowing the agent reasoning to make probabilistic decisions.
Workflow as Code
The workflow system lets you write side-effect free code in your programming language via the Inferable SDK. You can use any standard control flow patterns, such as loops, conditionals, etc.
This allows you to make deterministic decisions in your code, while delegating probabilistic reasoning to the agents.
Durability
Workflows are durable and fault-tolerant. Each workflow execution is tracked by a unique executionId
. You can trigger a workflow many times, but as long as the executionId
is the same, you will get the same result.
Distributed Nature
Workflows are defined in your own codebase and run in your own compute environment. The control plane “discovers” your workflow when you register it, making it callable by any other machine that has access to your Inferable cluster.
Control Flow vs. Agent Reasoning
When building workflows, it’s important to understand when to use control flow versus agent reasoning:
- Use control flow for deterministic decisions (e.g., checking if a number exceeds a threshold)
- Use agent reasoning for probabilistic decisions (e.g., analyzing sentiment, making judgment calls)
It’s worth noting that whenever you leave a decision up to the agent reasoning, it’s prone to hallucinations and probabilistic results. Therefore, when a decision can be made deterministically, it’s more suitable and efficient to make it in the workflow’s control flow.
Was this page helpful?