Back to blog
  • ENGINEERING
  • INSIGHTS

What Is Workflow Orchestration? How It Works, Patterns, and Tools

Viren Baraiya Viren Baraiya CTO
Last updated: · 30 mins read

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.

Orchestration vs choreography diagram: in choreography each service reacts to the event of the one before it, and in orchestration one workflow calls each service and holds the state. (opens the full-size image in a new tab)
Figure 1. One process, wired two ways. In choreography the last service has to match up two events before it can act. In orchestration a join does that, and the order of the steps lives in one workflow.

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.

ChoreographyOrchestration
Where the process is writtenAcross the event handlers of the servicesIn one definition
Who knows the state of a runNo single place. It is pieced together from events and logsThe orchestrator
Joining two resultsA service has to match up two events for the same runA join
Adding a step in the middleAdd a service that listens for the earlier event, and change the next one to listen for the new oneChange the definition
Adding a listener for an outcomeNo existing service changesPublish an event from the workflow
A step failsThe service publishes a failure event, and every service that already acted has to listen for it and undo its own partThe orchestrator retries the step, or runs the undo steps
Waiting for a person or a dateSome service has to hold the waitIt is a step in the workflow
What every process depends onThe broker, and each other’s eventsThe 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

Architecture diagram of a workflow orchestration engine: an application starts a run, the engine schedules tasks on queues, workers poll and report results, and a state store saves every step. (opens the full-size image in a new tab)
Figure 2. The parts of a workflow orchestration engine, and one trip around them. A worker asks for work, so your code can run anywhere that can reach the engine.

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:

  1. Your application starts a run and gets its ID back.
  2. The engine reads the definition and puts the first task on its queue.
  3. A worker that polls that queue takes the task and runs your code.
  4. The worker reports the result to the engine.
  5. 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.

StatusWhat it meansWhat happens next
SCHEDULEDThe task is on its queueA worker takes it
IN_PROGRESSA worker has itThe worker reports, or a timeout passes
COMPLETEDThe worker reported successThe evaluator schedules the next task
FAILEDThe worker reported a failureThe task is scheduled again after a delay, until its retries run out
TIMED_OUTNo result arrived in timeThe task is retried, or the whole run times out, as the task’s timeout policy says
FAILED_WITH_TERMINAL_ERRORThe worker said a retry is pointlessNo 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 failsWhat happens
The server restarts in the middle of a runEvery 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 failsThe 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 taskThe response timeout passes, and the task goes back on its queue
Worker and server cannot reach each otherThe same: the task is queued again, and any worker can take it
Every server is down while a run waitsA 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

Nine workflow orchestration patterns: sequence, parallel, fan-out, branch, loop, sub-workflow, wait, human task, and compensation. (opens the full-size image in a new tab)
Figure 3. Nine workflow orchestration patterns, each with the Conductor operator that builds it.

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.

PatternConductorAWS Step FunctionsBPMN, as in Camunda
SequenceTasks, in orderNext, from one state to anotherSequence flow
ParallelFORK_JOIN and JOINParallel stateParallel gateway
Fan-outFORK_JOIN_DYNAMICMap stateMulti-instance
BranchSWITCHChoice stateExclusive gateway
LoopDO_WHILEA Choice state that points backA flow back through a gateway
Sub-workflowSUB_WORKFLOWA task that starts another executionCall activity
WaitWAITWait stateTimer event
Human taskHUMANA task that waits for a callback with a task tokenUser task
CompensationfailureWorkflowCatch, then states that undoCompensation event

Three ways to write a workflow

Engines differ most visibly in how you write a workflow down.

StyleYou writeThe graphExamples
A definitionJSON that lists the tasksIs the definition. It can be drawn before a run, and produced by a programConductor, and AWS Step Functions with Amazon States Language
CodeA function in a general-purpose languageAppears as the code runsTemporal, Prefect, and Conductor’s native workflows
A visual modelA diagram, usually BPMNIs the modelCamunda

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.

KindWhat it coordinatesWritten asA run starts fromExamples
Data pipeline orchestrationJobs that move and transform dataPythonA schedule, or new dataApache Airflow, Prefect, Dagster
Application and service orchestrationCalls between services, with retries, waits, and peopleA definition, or codeA request or an event, one run for eachConductor, Temporal, AWS Step Functions, Google Cloud Workflows, Azure Durable Functions
Business process orchestrationProcesses modeled with the business, with people in many stepsA BPMN modelA message, a timer, or a signalCamunda
Workload automationScheduled jobs across enterprise applications and dataJob definitionsA schedule, or an eventControl-M
Container-native workflowsJobs that each run in a container on KubernetesA Kubernetes resourceA submitted resourceArgo Workflows
Workflow automationA trigger in one app that causes actions in othersA visual builderAn event in an appZapier, n8n

The tools also differ in how you get them.

How you get itTools
Open source, to run yourselfConductor, Apache Airflow, Argo Workflows, Prefect, and Dagster under Apache 2.0. Temporal under MIT
A cloud serviceAWS Step Functions, Google Cloud Workflows
BothConductor 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.

FieldWhat is orchestratedWho
LendingCustomer payments, collections campaigns, bank reconciliation, and store settlementsTafi
HealthcareThe workflows behind clinical trials, and compliance rules for nurse practitioners and physician assistantsFlorence Healthcare, Zivian Health
CommerceOrders, inventory, and warehouse workNaveo Commerce
Data and analyticsRecomputing models and reports after new data landsSummation
MediaThe services behind television and streamingFoxtel
Software deliverySetting up new applications and servicesUnited Wholesale Mortgage
TermWhat it meansHow it relates
Workflow automationMaking a task happen without a person, or linking apps so a trigger causes an actionAutomation is about a task. Orchestration coordinates many of them into one process
Job schedulingStarting jobs at set timesA scheduler starts work. An orchestrator also follows it to the end
Workflow engineThe software that runs workflowsThe engine is the thing. Orchestration is what it does
Process orchestrationOrchestration of business processes, often modeled in BPMNThe same idea, named from the side of the business
Data orchestrationOrchestration of pipelines that move and transform dataOne kind of it
Container orchestrationPlacing and scaling containers, as Kubernetes doesA different job. It runs programs, and a workflow engine runs processes on top of it
Microservice orchestrationCoordinating the calls between servicesThe kind this guide is mostly about
Durable executionSaving every step so a run survives failureThe guarantee under a reliable orchestrator
AI agent orchestrationCoordinating agents, their tools, and the steps around themWorkflow 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.

  • type says who runs the step. HTTP runs on the server. SIMPLE goes to a queue, and a worker runs it.
  • taskReferenceName is 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.
  • forkTasks is a list of branches. Each branch is a list of tasks, so a branch can be longer than one step.
  • joinOn names what the join waits for. Here it waits for both checks. If either one fails after its retries, the run fails. A task marked optional would 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.
  • timeoutSeconds and failureWorkflow belong to the whole run. If the run is not finished in seven days it times out, and any failure starts close_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 NonRetryableException
from 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:

Terminal window
conductor workflow create onboard_merchant.json
conductor workflow start -w onboard_merchant \
-i '{"business": "Acme Bikes", "owner": {"name": "Dana Ruiz"}}'
The record of an orchestrated workflow run that onboards a merchant: an HTTP call, two checks in parallel, a human review that waited 26 hours, a sub-workflow, and an event. (opens the full-size image in a new tab)
Figure 4. The record of that run. One check was retried, and the review waited 26 hours through a deploy.

Three things in the record are worth reading closely.

  1. 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.
  2. 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.
  3. 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.

TimeoutIt guards againstField
PollNo worker takes the taskpollTimeoutSeconds on the task
ResponseA worker took the task and went silentresponseTimeoutSeconds on the task
TaskThe task takes too long from start to finishtimeoutSeconds on the task
WorkflowThe whole run takes too longtimeoutSeconds 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.

Saga pattern diagram in workflow orchestration: when opening the account fails, a failure workflow closes the account and withdraws the application, in reverse order. (opens the full-size image in a new tab)
Figure 5. A saga. The account cannot be opened, so a failure workflow undoes that step and then withdraws the application. The checks only read, so they have nothing to undo.

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_account looks 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.

ConductorAWS Step FunctionsTemporalCamunda
RetriesretryCount and retryLogic on the taskA Retry rule on the state: interval, attempts, and backoff rateA Retry Policy on the Activity, on by defaultRetries on the job. With none left, an incident waits for a person
A step that goes quietPoll, response, and task timeoutsTimeoutSeconds and HeartbeatSecondsSchedule-To-Start, Start-To-Close, and Heartbeat timeoutsA job timeout, after which another worker can take the job
Undoing finished stepsA failureWorkflowCatch, and fallback states that undoWorkflow code that catches the failure and runs the undo stepsCompensation 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.

ProblemWhat the engine doesWhat you still design
A step fails for a whileRetries it, with the policy of that taskWhich errors are final
A step hangsTimes it out, then retries it or times out the runA timeout and a timeout policy for each task
A worker dies after actingRuns the task againAn idempotency key, so the second run does nothing
The process has to waitHolds the wait as a recordA deadline, and what happens when it passes
A later step fails after earlier ones actedStarts the failure workflowThe undo for each step
The definition changesKeeps each run on the version it started withHow a changed worker stays compatible
One dependency is overloadedLimits how fast a task is handed outThe limits
Something goes wrong at nightShows the run, and lets an operator retry or rerun itThe 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 fromHow
A requestAn API call starts the run and returns its ID
A scheduleA cron expression, for work that happens at set times
A messageAn event handler starts a run for a message on Kafka, SQS, or another broker
A webhookA call from another product, such as a payment or a code push. Incoming webhooks are an Orkes Conductor feature
Another workflowA 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.

  1. Validate the definition. POST /api/metadata/workflow/validate checks a definition and its graph before you register it.
  2. Test the decisions with mocked tasks. POST /api/workflow/test runs 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.
  3. 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

  1. Is each step a unit of work you would not want to repeat, and no smaller?
  2. Does every step that writes carry an idempotency key built from stable identifiers?
  3. Does every task have a timeout and a retry policy, and does it know which errors are final?
  4. Does every wait have a deadline, and a decision about what happens when it passes?
  5. Does every step that changes something have an undo, and a failure workflow that runs it?
  6. Does every loop have a limit, and every join a rule for a failed branch?
  7. Are large payloads passed by reference, and secrets kept out of inputs?
  8. What happens to runs in flight when you change a definition or a worker?
  9. Does each sub-workflow have an owner and a version?
  10. 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