- ENGINEERING
- INSIGHTS
What Is Workflow Orchestration? How It Works, Patterns, and Tools
Workflow orchestration is running a multi-step process from one place that decides what runs next, hands each step to the system that does the work, and records what happened.
The steps can be service calls, database writes, AI model calls, or a person clicking Approve. What makes it orchestration is that no step has to know about the others. The order, the branching, the retries, and the waiting live in one definition that you can read, change, and watch as it runs.
Most explanations of the term are written for buyers. This guide is for the people who build the thing. It covers how an engine works inside, the patterns every workflow is made of, the kinds of tools that share the name, and one workflow read line by line. The code is from Orkes Conductor, because that is what we build. The ideas apply to every engine, and the main ones are compared by name.
(opens the full-size image in a new tab) Workflow orchestration vs choreography
There are two ways to make several services carry out one process.
In choreography there is no coordinator. Each service publishes an event when it finishes, and the services that care react to it. In orchestration one workflow calls each service in turn and holds the state of the run. Figure 1 shows the same process wired both ways.
| Choreography | Orchestration | |
|---|---|---|
| Where the process is written | Across the event handlers of the services | In one definition |
| Who knows the state of a run | No single place. It is pieced together from events and logs | The orchestrator |
| Joining two results | A service has to match up two events for the same run | A join |
| Adding a step in the middle | Add a service that listens for the earlier event, and change the next one to listen for the new one | Change the definition |
| Adding a listener for an outcome | No existing service changes | Publish an event from the workflow |
| A step fails | The service publishes a failure event, and every service that already acted has to listen for it and undo its own part | The orchestrator retries the step, or runs the undo steps |
| Waiting for a person or a date | Some service has to hold the wait | It is a step in the workflow |
| What every process depends on | The broker, and each other’s events | The orchestrator |
Each side has a cost. Choreography gets hard to follow as steps are added, because the process exists only as the sum of every handler. Doing it well takes discipline of its own: an outbox, so that an event is published if and only if the change was saved, versioned event schemas, and an ID on every event that ties it to its run.
Orchestration adds a system that every step of every process passes through. Microsoft’s choreography pattern names the risk plainly: an orchestrator can become a bottleneck and a single point of failure. Two different things answer that. For availability, an engine runs as several servers over one store, and a run that was interrupted continues from storage, as described below. The store becomes the part that must not fail, so it has to be a replicated database. If every server is down, nothing is lost and nothing moves. For load, the orchestrator does the coordinating and not the work. The work runs in workers, which scale by themselves. Neither answer is free. An orchestrator is one more system to run well.
The same page gives a rule of thumb that holds up well. Choreograph between bounded contexts, where teams have to stay loosely coupled. Orchestrate inside one, where a process needs an owner.
The two also mix. An orchestrated workflow can start from an event and publish events as it goes, so a service that only needs to hear about an outcome stays decoupled. Our post on orchestration vs choreography goes further into the trade.
How a workflow orchestration engine works: the architecture
(opens the full-size image in a new tab) An engine has five parts.
- The definition lists the steps of a workflow, their order, and the rules for branching, retrying, and timing out. It has a version.
- The evaluator is the part that decides. After every result it reads the definition and the state of the run, and works out which task comes next. Conductor’s architecture docs call it the state machine evaluator.
- Task queues hold the tasks that are ready to run. There is one queue for each kind of task.
- Workers are your programs. A worker asks a queue for work, runs your code, and reports the result.
- The state store keeps every run and every task: its input, its output, its status, and its attempts.
Figure 2 also shows system tasks, which are the steps the engine runs by itself.
One trip around Figure 2 goes like this:
- Your application starts a run and gets its ID back.
- The engine reads the definition and puts the first task on its queue.
- A worker that polls that queue takes the task and runs your code.
- The worker reports the result to the engine.
- The engine saves the result, then decides and schedules the next task.
Three things follow from this design.
- Workers poll. A worker task is never pushed to your code. The worker opens the connection, over HTTP or gRPC in Conductor, so it can run behind a firewall, in another cloud, or on a laptop and still take part. An HTTP task runs the other way: the engine calls your endpoint.
- A worker holds no state. Everything about the run is in the store, so any worker for a task can take the next one. You add capacity by starting more workers.
- Some steps need no worker. An HTTP call, a wait, a branch, or a fork runs inside the engine. Conductor calls these system tasks.
Not every engine is laid out this way. Some push each step to a function instead of waiting for a poll. Others run the workflow as code inside a worker and replay it after a failure, which What is durable execution? compares with the design shown here. The five parts are present in each. They differ in where the parts live.
The life of a task
Every task moves through a small set of states, and the engine saves each change. These are six of the nine statuses in Conductor’s task lifecycle.
| Status | What it means | What happens next |
|---|---|---|
SCHEDULED | The task is on its queue | A worker takes it |
IN_PROGRESS | A worker has it | The worker reports, or a timeout passes |
COMPLETED | The worker reported success | The evaluator schedules the next task |
FAILED | The worker reported a failure | The task is scheduled again after a delay, until its retries run out |
TIMED_OUT | No result arrived in time | The task is retried, or the whole run times out, as the task’s timeout policy says |
FAILED_WITH_TERMINAL_ERROR | The worker said a retry is pointless | No retry |
A task can therefore run more than once. A step that changes something outside the workflow needs an idempotency key, and the durable execution guide explains why and how.
System design: when the engine itself fails
An orchestrator that loses work when it restarts would be the single point of failure its critics describe. The design answer is that the engine keeps nothing that matters in memory. Conductor’s durable execution semantics spell it out.
| What fails | What happens |
|---|---|
| The server restarts in the middle of a run | Every change was written to the store before the next step. A sweeper finds the runs in progress and evaluates them again |
| One server of several fails | The others carry on. Only one server decides the next step of a run at a time, under a lock, and the task queues are in the store |
| A worker dies after taking a task | The response timeout passes, and the task goes back on its queue |
| Worker and server cannot reach each other | The same: the task is queued again, and any worker can take it |
| Every server is down while a run waits | A wait is a record. When a server is back and the timer is due, the run continues |
What the engine cannot do is make a step safe to repeat. The first four rows can all end with a task that runs a second time.
Workflow orchestration patterns
(opens the full-size image in a new tab) Every workflow, however large, is assembled from a small set of patterns. Six of them deserve a note.
- Parallel and fan-out differ in when the branches are known. A fork has a fixed set of branches, written in the definition. A fan-out makes one branch for each item in a list that exists only while the run is going: one for each file, region, or customer.
- A join needs a rule. It can wait for every branch, or go on when the first one finishes. Decide what the join does when one branch fails.
- A loop needs a limit. Give it a condition and a maximum number of rounds, or a bad response can keep it going forever.
- A sub-workflow is a boundary. It has its own definition, its own version, and its own record, so several workflows can call it and one team can own it.
- A wait and a human task are the same mechanism. Both are a record in storage, with no thread held, whether the run waits a minute or a month. See waiting without threads.
- Compensation is a workflow too. When a run fails after some steps have acted, a second workflow undoes them in reverse order. This is the saga pattern, and it has its own section below.
The same patterns under other names
Each engine has its own words for these patterns. This table gives the closest name in three of them.
| Pattern | Conductor | AWS Step Functions | BPMN, as in Camunda |
|---|---|---|---|
| Sequence | Tasks, in order | Next, from one state to another | Sequence flow |
| Parallel | FORK_JOIN and JOIN | Parallel state | Parallel gateway |
| Fan-out | FORK_JOIN_DYNAMIC | Map state | Multi-instance |
| Branch | SWITCH | Choice state | Exclusive gateway |
| Loop | DO_WHILE | A Choice state that points back | A flow back through a gateway |
| Sub-workflow | SUB_WORKFLOW | A task that starts another execution | Call activity |
| Wait | WAIT | Wait state | Timer event |
| Human task | HUMAN | A task that waits for a callback with a task token | User task |
| Compensation | failureWorkflow | Catch, then states that undo | Compensation event |
Three ways to write a workflow
Engines differ most visibly in how you write a workflow down.
| Style | You write | The graph | Examples |
|---|---|---|---|
| A definition | JSON that lists the tasks | Is the definition. It can be drawn before a run, and produced by a program | Conductor, and AWS Step Functions with Amazon States Language |
| Code | A function in a general-purpose language | Appears as the code runs | Temporal, Prefect, and Conductor’s native workflows |
| A visual model | A diagram, usually BPMN | Is the model | Camunda |
The styles are not exclusive. A Conductor definition can be written as JSON, or built in code with an SDK and registered. A native workflow is a plain Java method.
Kinds of workflow orchestration, and their tools
The name is used for at least six kinds of system. They overlap, and a search for workflow orchestration tools returns all of them together.
| Kind | What it coordinates | Written as | A run starts from | Examples |
|---|---|---|---|---|
| Data pipeline orchestration | Jobs that move and transform data | Python | A schedule, or new data | Apache Airflow, Prefect, Dagster |
| Application and service orchestration | Calls between services, with retries, waits, and people | A definition, or code | A request or an event, one run for each | Conductor, Temporal, AWS Step Functions, Google Cloud Workflows, Azure Durable Functions |
| Business process orchestration | Processes modeled with the business, with people in many steps | A BPMN model | A message, a timer, or a signal | Camunda |
| Workload automation | Scheduled jobs across enterprise applications and data | Job definitions | A schedule, or an event | Control-M |
| Container-native workflows | Jobs that each run in a container on Kubernetes | A Kubernetes resource | A submitted resource | Argo Workflows |
| Workflow automation | A trigger in one app that causes actions in others | A visual builder | An event in an app | Zapier, n8n |
The tools also differ in how you get them.
| How you get it | Tools |
|---|---|
| Open source, to run yourself | Conductor, Apache Airflow, Argo Workflows, Prefect, and Dagster under Apache 2.0. Temporal under MIT |
| A cloud service | AWS Step Functions, Google Cloud Workflows |
| Both | Conductor as Orkes Cloud, Temporal as Temporal Cloud |
Three questions tell the kinds apart faster than a feature list.
- What starts a run? A nightly schedule is a data pipeline. One run for each customer request is service orchestration.
- How long does a run live, and does it wait for people? A run that waits days for an approval needs waits that are records, and a place for a person to answer.
- Who has to read and change the workflow? Engineers read code. Operations teams and analysts read a graph or a model.
Workflow orchestration in data engineering
In data engineering a workflow is a pipeline: extract, load, transform, train, report. The parts of the engine are the ones in Figure 2 under other names. Airflow’s architecture has a scheduler, an executor that hands tasks to workers, and a metadata database that stores the state of every task.
Two things are particular to data.
- Time is an input. A pipeline runs for a period, such as one day of orders. Running it again for past periods is a backfill, and a data orchestrator has to make that routine.
- The result can be the unit, in place of the task. Dagster describes a pipeline by its assets: the tables, files, and models that should exist, and how to produce each one.
A service workflow differs on both counts. It starts once for each request, and what matters is that each step happened once.
What is DAG-based workflow orchestration?
A DAG is a directed acyclic graph: steps joined by arrows that never circle back. Data pipeline tools made the word common. Airflow calls a workflow a Dag, and adds branching, sensors that wait, and mapped tasks that fan out over data that exists only at run time.
A Conductor workflow is a DAG too. A loop does not break the rule, because each round of a loop is recorded as new tasks, so the record of a run only ever moves forward.
Workflow orchestration use cases
The pattern is the same in every field: a process that crosses systems, takes longer than one request, and must finish. These teams run theirs on Conductor.
| Field | What is orchestrated | Who |
|---|---|---|
| Lending | Customer payments, collections campaigns, bank reconciliation, and store settlements | Tafi |
| Healthcare | The workflows behind clinical trials, and compliance rules for nurse practitioners and physician assistants | Florence Healthcare, Zivian Health |
| Commerce | Orders, inventory, and warehouse work | Naveo Commerce |
| Data and analytics | Recomputing models and reports after new data lands | Summation |
| Media | The services behind television and streaming | Foxtel |
| Software delivery | Setting up new applications and services | United Wholesale Mortgage |
Workflow orchestration vs related terms
| Term | What it means | How it relates |
|---|---|---|
| Workflow automation | Making a task happen without a person, or linking apps so a trigger causes an action | Automation is about a task. Orchestration coordinates many of them into one process |
| Job scheduling | Starting jobs at set times | A scheduler starts work. An orchestrator also follows it to the end |
| Workflow engine | The software that runs workflows | The engine is the thing. Orchestration is what it does |
| Process orchestration | Orchestration of business processes, often modeled in BPMN | The same idea, named from the side of the business |
| Data orchestration | Orchestration of pipelines that move and transform data | One kind of it |
| Container orchestration | Placing and scaling containers, as Kubernetes does | A different job. It runs programs, and a workflow engine runs processes on top of it |
| Microservice orchestration | Coordinating the calls between services | The kind this guide is mostly about |
| Durable execution | Saving every step so a run survives failure | The guarantee under a reliable orchestrator |
| AI agent orchestration | Coordinating agents, their tools, and the steps around them | Workflow orchestration with steps where a model decides |
A workflow definition, read line by line
A payments company onboards a new merchant. The process has seven steps: create the application, verify the owner’s identity and run a credit check at the same time, score the risk, send risky applications to a compliance officer, open the account, and tell the other systems.
Here is the definition with its first three tasks. The other four are shown one at a time below.
{ "name": "onboard_merchant", "version": 1, "schemaVersion": 2, "ownerEmail": "payments-platform@example.com", "timeoutSeconds": 604800, "failureWorkflow": "close_application", "tasks": [ { "name": "create_application", "taskReferenceName": "application", "type": "HTTP", "inputParameters": { "uri": "https://crm.example.com/applications", "method": "POST", "headers": { "Idempotency-Key": "${workflow.workflowId}" }, "body": { "business": "${workflow.input.business}" } } }, { "name": "checks", "taskReferenceName": "checks", "type": "FORK_JOIN", "forkTasks": [ [ { "name": "verify_identity", "taskReferenceName": "identity", "type": "SIMPLE", "inputParameters": { "applicationId": "${application.output.response.body.id}", "owner": "${workflow.input.owner}" } } ], [ { "name": "credit_check", "taskReferenceName": "credit", "type": "SIMPLE", "inputParameters": { "applicationId": "${application.output.response.body.id}" } } ] ] }, { "name": "checks_done", "taskReferenceName": "checks_done", "type": "JOIN", "joinOn": ["identity", "credit"] } ]}Six things in it carry the design.
typesays who runs the step.HTTPruns on the server.SIMPLEgoes to a queue, and a worker runs it.taskReferenceNameis how later steps refer to this one.${application.output.response.body.id}reads the ID that the first task returned. Data moves between steps through these expressions, so no step calls another.forkTasksis a list of branches. Each branch is a list of tasks, so a branch can be longer than one step.joinOnnames what the join waits for. Here it waits for both checks. If either one fails after its retries, the run fails. A task markedoptionalwould let the run go on without it.- The create call carries an idempotency key. It is the ID of the run, which is the same on every retry, so a repeated call cannot create a second application.
timeoutSecondsandfailureWorkflowbelong to the whole run. If the run is not finished in seven days it times out, and any failure startsclose_application, which undoes what the run did. That workflow is shown below.
A SIMPLE task is your code. This is the identity check as a Python worker. The function’s arguments are the task’s inputs, and what it returns is the task’s output.
from conductor.client.worker.exception import NonRetryableExceptionfrom conductor.client.worker.worker_task import worker_task
@worker_task(task_definition_name="verify_identity")def verify_identity(applicationId: str, owner: dict) -> dict: # the application ID is the same on every retry, so the provider can discard a repeat result = identity_provider.verify(owner, reference=applicationId) if result.unsupported_document: # a retry cannot fix this, so tell the engine not to try raise NonRetryableException("unsupported identity document") return {"verified": result.passed, "checkId": result.id}identity_provider stands for your own client. The worker knows nothing about the workflow it belongs to. It could be written in Java or Go, and the credit check next to it in something else. Its retries and timeouts are set in a task definition, shown under retries.
After the join, an INLINE task combines the two results on the server. It needs no worker.
{ "name": "score_risk", "taskReferenceName": "score_risk", "type": "INLINE", "inputParameters": { "verified": "${identity.output.verified}", "creditScore": "${credit.output.score}", "evaluatorType": "graaljs", "expression": "(function () { return { risk: $.verified && $.creditScore >= 600 ? 'low' : 'review' }; })()" }}A SWITCH reads the risk and sends a risky application to a person. A second switch, inside that branch, treats anything other than an explicit yes as a rejection.
{ "name": "route", "taskReferenceName": "route", "type": "SWITCH", "evaluatorType": "value-param", "expression": "risk", "inputParameters": { "risk": "${score_risk.output.result.risk}" }, "decisionCases": { "review": [ { "name": "compliance_review", "taskReferenceName": "review", "type": "HUMAN" }, { "name": "decision", "taskReferenceName": "decision", "type": "SWITCH", "evaluatorType": "javascript", "expression": "String($.approved) === 'true' ? 'approved' : 'rejected'", "inputParameters": { "approved": "${review.output.approved}" }, "decisionCases": { "rejected": [ { "name": "rejected", "taskReferenceName": "rejected", "type": "TERMINATE", "inputParameters": { "terminationStatus": "FAILED", "terminationReason": "Rejected by compliance" } } ] }, "defaultCase": [] } ] }, "defaultCase": []}The HUMAN task stays in progress until someone completes it, and the run holds nothing in the meantime. Anything other than a yes ends the run as failed, which starts the failure workflow, and the application is withdrawn. The review also has a deadline, set in its task definition:
{ "name": "compliance_review", "retryCount": 0, "responseTimeoutSeconds": 259200, "timeoutSeconds": 259200, "timeoutPolicy": "TIME_OUT_WF"}Both timeouts are three days. A human task has no worker to report progress, so its response timeout has to be as long as the wait. A review that nobody answers by then times out the run.
The account is opened by a workflow that other processes also use, called as one step. It is given the ID of the onboarding run, and records it on the account it opens.
{ "name": "open_account", "taskReferenceName": "account", "type": "SUB_WORKFLOW", "subWorkflowParam": { "name": "open_account", "version": 2 }, "inputParameters": { "applicationId": "${application.output.response.body.id}", "onboardingRun": "${workflow.workflowId}" }}The last step publishes an event, so billing and support hear about the new merchant without being called.
{ "name": "merchant_onboarded", "taskReferenceName": "notify", "type": "EVENT", "sink": "kafka:merchant.onboarded", "optional": true, "inputParameters": { "applicationId": "${application.output.response.body.id}" }}The sink names a Kafka topic. Other prefixes publish to SQS, NATS, AMQP, or Conductor’s own queue. The task is optional, so a failed publish cannot fail a run whose account is already open. The price is that such a failure is quiet: the task ends as COMPLETED_WITH_ERRORS, so alert on that status.
Registering the definition and starting a run are one command each, or one API call each:
conductor workflow create onboard_merchant.jsonconductor workflow start -w onboard_merchant \ -i '{"business": "Acme Bikes", "owner": {"name": "Dana Ruiz"}}'
(opens the full-size image in a new tab) Three things in the record are worth reading closely.
- The identity provider timed out, and only that task ran again. The credit check next to it was not repeated, and neither was the application.
- The review took 26 hours, and the server was deployed in between. The run was a row in storage. When the officer approved, it continued from the same step.
- Opening the account is one row here and a record of its own. The sub-workflow has four tasks, each with its own input, output, and attempts.
Handling failure: retries, timeouts, and sagas
Orchestration earns its place when something breaks. An engine gives you three tools, for failures of three sizes.
Retries: failures that pass
Most failures are temporary. A retry policy belongs to a task, and it applies wherever the task is used. This is the task definition of the identity check.
{ "name": "verify_identity", "retryCount": 3, "retryLogic": "EXPONENTIAL_BACKOFF", "retryDelaySeconds": 5, "responseTimeoutSeconds": 30, "timeoutSeconds": 300, "timeoutPolicy": "RETRY"}The delay between attempts can be fixed, grow in a line, or double each time.
Some failures will never pass. A document type that the provider does not support stays unsupported. The worker above says so by raising NonRetryableException, and the task fails at once, with no retries.
Timeouts: failures that say nothing
A step that hangs is worse than a step that fails, because nothing reports it. Conductor has a timeout for each way a task can go quiet.
| Timeout | It guards against | Field |
|---|---|---|
| Poll | No worker takes the task | pollTimeoutSeconds on the task |
| Response | A worker took the task and went silent | responseTimeoutSeconds on the task |
| Task | The task takes too long from start to finish | timeoutSeconds on the task |
| Workflow | The whole run takes too long | timeoutSeconds on the workflow |
timeoutPolicy says what a task timeout does: retry the task, time out the whole run, or only raise an alert. Timing out the run is the default, so a task that should be retried has to say so.
Sagas and compensation
Some failures are final, and they arrive after earlier steps have already acted. The application exists in the CRM, and the account cannot be opened. No database transaction spans those systems, so nothing rolls the first step back.
A saga is the answer. Every step that changes something has an undo step, called a compensation. When the run fails for good, the compensations run in reverse order.
(opens the full-size image in a new tab) A saga can be choreographed or orchestrated. In a choreographed saga, each service listens for a failure event and undoes its own part. In an orchestrated saga, one workflow knows which steps ran and runs their undo steps. The orchestrated form is short to write, because the engine already holds the record of what completed.
In Conductor the compensation is the failureWorkflow: a second workflow that the engine starts when the first one fails or times out. It receives the input of the failed run, and with it the run’s ID, the reason, and the ID of the task that failed.
{ "name": "close_application", "version": 1, "schemaVersion": 2, "ownerEmail": "payments-platform@example.com", "tasks": [ { "name": "close_account", "taskReferenceName": "close_account", "type": "SIMPLE", "inputParameters": { "onboardingRun": "${workflow.input.workflowId}" } }, { "name": "withdraw_application", "taskReferenceName": "withdraw_application", "type": "SIMPLE", "inputParameters": { "onboardingRun": "${workflow.input.workflowId}", "reason": "${workflow.input.reason}" } } ]}Five rules make a saga hold.
- An undo must be safe when its step did nothing. A step can act and then fail to report, so the failure workflow cannot know whether an account exists.
close_accountlooks for an account that carries the ID of the failed run. It closes that account if there is one, and otherwise does nothing. - An undo is a task like any other. It is retried, so it has to be idempotent.
- A step that only reads has nothing to undo. The two checks are left out.
- Not everything can be undone. A published event cannot be unpublished. Its compensation is a second event that says the onboarding was withdrawn.
- Decide where compensation stops. Here the line is the account. Once it is open, the only step left is the event, and that step is optional, so its failure cannot undo a good account. A failure after that point is fixed forward.
The same tools under other names
Every engine has these three tools, under its own names.
| Conductor | AWS Step Functions | Temporal | Camunda | |
|---|---|---|---|---|
| Retries | retryCount and retryLogic on the task | A Retry rule on the state: interval, attempts, and backoff rate | A Retry Policy on the Activity, on by default | Retries on the job. With none left, an incident waits for a person |
| A step that goes quiet | Poll, response, and task timeouts | TimeoutSeconds and HeartbeatSeconds | Schedule-To-Start, Start-To-Close, and Heartbeat timeouts | A job timeout, after which another worker can take the job |
| Undoing finished steps | A failureWorkflow | Catch, and fallback states that undo | Workflow code that catches the failure and runs the undo steps | Compensation events |
The other classic answer, two-phase commit, needs every system to support a prepare step, which most APIs do not. Two posts go further: the saga pattern, and compensation transaction patterns, which compares sagas with two-phase commit. The durable execution guide writes the same pattern as code.
What the engine handles, and what you still design
An engine takes over a set of problems. Each one leaves a decision with you.
| Problem | What the engine does | What you still design |
|---|---|---|
| A step fails for a while | Retries it, with the policy of that task | Which errors are final |
| A step hangs | Times it out, then retries it or times out the run | A timeout and a timeout policy for each task |
| A worker dies after acting | Runs the task again | An idempotency key, so the second run does nothing |
| The process has to wait | Holds the wait as a record | A deadline, and what happens when it passes |
| A later step fails after earlier ones acted | Starts the failure workflow | The undo for each step |
| The definition changes | Keeps each run on the version it started with | How a changed worker stays compatible |
| One dependency is overloaded | Limits how fast a task is handed out | The limits |
| Something goes wrong at night | Shows the run, and lets an operator retry or rerun it | The alerts, and who answers them |
What is durable execution? covers the first five in depth.
How a run starts, and what it tells other systems
A workflow is not only called. It can start in five ways, and it can report what it did.
| A run starts from | How |
|---|---|
| A request | An API call starts the run and returns its ID |
| A schedule | A cron expression, for work that happens at set times |
| A message | An event handler starts a run for a message on Kafka, SQS, or another broker |
| A webhook | A call from another product, such as a payment or a code push. Incoming webhooks are an Orkes Conductor feature |
| Another workflow | A sub-workflow, or a task that starts a workflow and does not wait for it |
Starting a run returns an ID, not an answer. The caller learns the outcome in one of three ways. It can wait: a short workflow can run synchronously, so the call returns when the run finishes. It can ask, by reading the status of the run with its ID. Or it can be told, by an event or a callback that the workflow sends as its last step.
Going out, an EVENT task publishes a message at a point that you choose, and the engine can publish every change in the status of a run. This is where orchestration and choreography meet. The process is orchestrated, and the services that only need to hear about it stay decoupled. See event-driven orchestration for the brokers and the handlers.
Testing a workflow
A workflow has three things to test, and each needs its own kind of test. Conductor’s testing guide names the layers.
- Validate the definition.
POST /api/metadata/workflow/validatechecks a definition and its graph before you register it. - Test the decisions with mocked tasks.
POST /api/workflow/testruns a workflow with task outputs that you supply by reference name. Worker tasks and HTTP tasks take the mock. Branches, joins, and inline scripts run for real, so the test exercises your own logic. - Run the real thing. A mock does not prove that a worker is polling or that an endpoint answers. Keep one real run for each boundary.
This request tests one decision: a weak credit score has to send the application to review.
{ "name": "onboard_merchant", "version": 1, "input": { "business": "Acme Bikes", "owner": { "name": "Dana Ruiz" } }, "taskRefToMockOutput": { "application": [ { "status": "COMPLETED", "output": { "response": { "body": { "id": "app-7" } } } } ], "identity": [{ "status": "COMPLETED", "output": { "verified": true } }], "credit": [{ "status": "COMPLETED", "output": { "score": 540 } }] }}We ran this request against a Conductor OSS 3.33 server, where both definitions in this guide pass validation. The run that comes back is still running: score_risk returned review, and compliance_review is in progress. Add a mock for review to test each answer. Each reference takes a list of mocks, so a failure followed by a success tests a retry.
A test call creates a real execution on the server. Point it at a development server, and terminate any run that it leaves waiting. Testing workflow routing and agent behavior works through a larger example.
Changing a workflow while runs are in flight
A run that waits a week for a review will outlive several deploys. Two rules keep that safe.
- A definition has versions, and a run keeps the one it started with. New runs take the new version, and old runs finish on the old one.
- Workers are shared by every version. A worker whose input or output changes still serves the old runs. Change it compatibly, or give the changed task a new name.
Workflow versioning and backward compatibility covers the cases in detail.
Dynamic workflows
A definition is data, so it does not have to exist before the run starts. That gives four degrees of dynamic.
- A dynamic fork decides how many branches to run, and which tasks, from the output of an earlier step.
- A dynamic task picks the kind of task to run from a value.
- A sub-workflow can take its definition inline, including one that an earlier task produced. A planning step can write the next workflow, and the engine runs it.
- A whole workflow can be sent with the request that starts it, with no registration and no deploy.
In each case the generated part is still a definition. The engine saves it, draws it, retries it, and records it like any other.
Workflow orchestration and AI agents
An AI agent decides its own next step, which makes it useful and hard to predict. Orchestration gives it a boundary, and the boundary is made of ordinary workflow steps.
Take a refund. The agent has tools that read the order and the policy, and no tool that pays. It returns a proposal. An inline task checks that the amount is no more than the order total, a switch sends anything over a limit to a person, and only then does a worker issue the refund, once, with an idempotency key. The workflow owns the order of the steps and the writes. The model owns the judgment inside its step.
When several agents and services work together, the same patterns apply, with one more question for each step: who decides what runs next, the definition or a model. What is AI agent orchestration? covers that case.
How Orkes Conductor does workflow orchestration
Orkes Conductor is a workflow orchestration platform built on Conductor OSS, the open-source engine created at Netflix to orchestrate its microservices and licensed under Apache 2.0.
- A workflow is a definition. You write it as JSON or build it in code with an SDK, and register it with the server.
- The server runs it. It schedules each task, saves every result, and applies the retry and timeout settings of each task.
- Built-in tasks run on the server: HTTP calls, switches, forks and joins, loops, waits, sub-workflows, and events.
- Your code runs in workers, written with SDKs for Python, Java, JavaScript and TypeScript, Go, C#, Ruby, and Rust. A workflow can mix them.
- Runs start from an API call, a schedule, or a message on Kafka, SQS, and other brokers.
- Operators can see and steer every run. They can search executions, read the input and output of each task, and pause, retry, or rerun from a chosen task.
- Orkes Conductor adds human tasks with forms and assignment, incoming webhooks, role-based access control, and managed clusters with an SLA.
Because every completed task is saved, workflows on Conductor are durable workflows by default. For a side-by-side comparison with sources, see Conductor next to Temporal.
Workflow orchestration best practices: a checklist
- Is each step a unit of work you would not want to repeat, and no smaller?
- Does every step that writes carry an idempotency key built from stable identifiers?
- Does every task have a timeout and a retry policy, and does it know which errors are final?
- Does every wait have a deadline, and a decision about what happens when it passes?
- Does every step that changes something have an undo, and a failure workflow that runs it?
- Does every loop have a limit, and every join a rule for a failed branch?
- Are large payloads passed by reference, and secrets kept out of inputs?
- What happens to runs in flight when you change a definition or a worker?
- Does each sub-workflow have an owner and a version?
- Can you open one run and see every step, input, output, and attempt?
Frequently asked questions
What is a workflow orchestration engine?
The software that runs orchestrated workflows. It reads a workflow’s definition, decides which task runs next, hands tasks to workers, retries the ones that fail, keeps timers, and saves the state of every run. Conductor, Temporal, AWS Step Functions, and Apache Airflow are examples.
What is a workflow orchestration tool or platform?
A product built around an engine. It adds what a team needs to run workflows in production: a way to write and version definitions, a view of every run, access control, and integrations. A platform is the same thing offered as a managed service or a supported product.
What is the difference between a workflow and orchestration?
A workflow is the process: a set of steps with an order. Orchestration is running that process from one place that decides what happens next. A workflow can exist on paper. Orchestration is what executes it and keeps track of it.
Is workflow orchestration the same as workflow automation?
No. Automation makes a task happen without a person. Orchestration coordinates many tasks, automated or not, into one process with state, retries, and recovery. An orchestrated workflow often includes automated steps and steps done by people.
What is the difference between orchestration and choreography?
In orchestration, one coordinator directs the others and holds the state of the process. In choreography there is no coordinator, and each service reacts to events from the others. Orchestration is easier to observe and change. Choreography has no coordinator to depend on, only the broker, and is harder to follow as it grows.
What is the difference between a workflow engine and an orchestrator?
Mostly emphasis. A workflow engine is the software that runs workflows. An orchestrator is an engine that directs other systems, such as services, functions, and people, and does little of the work itself. Most modern workflow engines are orchestrators.
How is workflow orchestration different from process orchestration?
They describe the same thing from two sides. Process orchestration usually means business processes, often modeled in BPMN, with people in many steps. Workflow orchestration is the wider and more technical term, and includes service calls and data pipelines.
What is dynamic workflow orchestration?
Orchestration in which part of the workflow is decided while it runs. The number of parallel branches, the task to run, or a whole sub-workflow comes from the output of an earlier step, or from a model. The generated part is still saved, retried, and recorded by the engine.
What is data workflow orchestration?
Orchestration of pipelines that move and transform data: extract, load, transform, train, report. Runs usually start on a schedule or when new data arrives, and a run can be repeated for past periods. Apache Airflow, which draws a pipeline as a DAG, Prefect, and Dagster are built for it.
Is Kubernetes a workflow orchestrator?
No. Kubernetes is a container orchestrator: it places and scales programs. A workflow orchestrator runs processes made of steps. The two fit together. Workflow engines run on Kubernetes, and Argo Workflows runs each step of a workflow as a container on it.
What is workflow orchestration in AI?
Running the steps around a model as a workflow: retrieve data, call the model, check its answer, ask a person, and write the result. When the model also chooses the next step, it is called AI agent orchestration.
Is there open-source workflow orchestration?
Yes. Conductor, Apache Airflow, Argo Workflows, Prefect, and Dagster are open source under the Apache 2.0 license, and Temporal under MIT. All of them can be run on your own infrastructure. AWS Step Functions and Google Cloud Workflows are offered as cloud services.
Which languages can I write workflows and workers in?
It depends on the engine. An engine that takes a definition leaves the steps to workers in any language it has an SDK for. Conductor has SDKs for Python, Java, JavaScript and TypeScript, Go, C#, Ruby, and Rust, and one workflow can mix them. An engine that runs workflows as code needs an SDK in the language the workflow is written in.
What is the saga pattern in workflow orchestration?
A saga is a way to keep several systems consistent without a transaction that spans them. Every step that changes something has an undo step, called a compensation. If a later step fails for good, the compensations run in reverse order. An orchestrator runs a saga well, because it already knows which steps completed.
What is the difference between an orchestrated and a choreographed saga?
In an orchestrated saga, one workflow runs the steps and, on failure, runs their undo steps. In a choreographed saga there is no coordinator: each service listens for a failure event and undoes its own part. The orchestrated form keeps the whole saga in one place, where it can be read and tested.
Do microservices need an orchestration engine?
Not always. A request that touches two services and can simply fail does not. A process with many steps, partial failures, waits, or undo logic usually does, because otherwise that logic is copied into every service.
Where to go next
- See the workflow orchestration platform page for how Orkes Conductor fits together, and try a first workflow in the free Developer Edition.
- The guarantees: What is durable execution?, and making workflows retry-safe.
- Patterns, built step by step: branching and conditionals, parallelism and reusability, and loops, waits, and human tasks.
- Failure handling, with examples: timeouts, retries, and recovery, task-level resilience, and workflow-level resilience.
- With agents: What is AI agent orchestration?


