What is a workflow engine, and when do you need one?
A workflow engine remembers where a process got to. That single property is what separates it from a cron job and a queue, and it is the reason to adopt one — or not.
On this page
- What we'll cover
- The property that defines it
- What it gives you beyond state
- The signals that you need one
- When you do not
- Defining a workflow
- Versioning, which is the hard part
- Human steps, and how they fit
- Who operates it once it is running
- Building workflows with CodeWords
- What to get right first
- Frequently asked questions
- Related reading
A workflow engine runs multi-step processes and remembers where each one got to. That memory is the whole point. A queue moves work between systems and forgets it; a scheduler starts things and forgets them; a workflow engine holds the state of a process that may run for minutes, days, or months, and knows exactly which step each instance is on.
The question worth answering is not what one is. It is whether the processes you are running actually need that memory, because a workflow engine is a substantial thing to adopt and plenty of work does not need one.
What we'll cover
- The property that defines it
- What it gives you beyond state
- The signals that you need one
- When you do not
- Defining a workflow
- Versioning, which is the hard part
- Human steps, and how they fit
- Who operates it once it is running
- Building workflows with CodeWords
- What to get right first
- Frequently asked questions
The property that defines it
It persists the state of each running instance. Not the definition — the individual run, including which step it reached and what it learned along the way.
It survives restarts. A process paused waiting for an approval continues after a deployment, because its state is in storage rather than in memory.
It can wait for a long time. Days or months, without holding a connection, a thread, or anything else expensive.
It handles failure per step. A step that fails can be retried without rerunning the steps before it, which is the difference between resuming and starting over.
It knows what is in flight. At any moment you can ask how many instances exist and where each one is, which is a question a queue-and-cron architecture cannot answer at all.
Everything else a workflow engine offers follows from these. If none of them is a problem you have, you do not need one.
What it gives you beyond state
Visibility. A list of running processes, each with its current step and history, which is the thing operations teams most consistently lack.
Retries with backoff per step, configured rather than coded, so a flaky external call is handled without bespoke logic in every integration.
Timeouts and escalation. A step that has been waiting too long can escalate, which is how approvals stop disappearing.
Compensation. When a later step fails, earlier steps can be undone in a defined order, which is how you get something approaching transactional behaviour across systems that have no shared transaction.
An audit trail. What happened, when, and in what order, per instance, which is frequently a compliance requirement rather than a convenience.
Concurrency control. Limiting how many instances of a process run at once, or ensuring only one runs per customer, which is awkward to build and easy to configure.
The signals that you need one
A practical checklist, and one or two matches is usually enough.
Processes that span days, waiting for a person, a delivery, or an external event.
Steps that must not repeat when a later step fails, which means resuming rather than restarting.
Somebody asks "where is order 4471" and nobody can answer without reading logs.
Compensating actions — refunds, cancellations, reversals — that must run in a defined order when something goes wrong midway.
Approvals that currently live in email threads and get lost.
A cron job with a status column that has grown conditionals, retry logic, and a table tracking which records are at which stage. That table is a workflow engine written badly, and recognising it is usually the moment to adopt a real one.
When you do not
Single-step work. A webhook that transforms and forwards does not need orchestration.
Fire-and-forget processing where a failure means discard and move on.
Anything that completes in seconds and can simply be retried whole.
Low volume with a human already watching. A process that runs eleven times a month and has an owner who notices problems does not need infrastructure.
When nobody will maintain the definitions. A workflow engine with abandoned workflow definitions is worse than a cron job, because the failure is less visible.
The honest test: if restarting a failed process from the beginning is acceptable, you probably do not need one.
Defining a workflow
Definitions come in a few shapes and the choice has consequences.
Code-based definitions live in your repository, get reviewed, and can be tested. The strongest option for engineering teams and the reason most modern engines work this way.
Declarative definitions in a configuration format are readable by non-engineers and constrain what can be expressed, which is sometimes a feature.
Visual builders are accessible to people who will not write code, and become difficult to review once a process has thirty steps and nested conditions.
Whatever the format, version it. A workflow definition is logic, and logic that cannot be diffed is logic nobody can safely change.
Keep steps small and named for what they do, because the step names are what appears in the operational view somebody reads during an incident.
Versioning, which is the hard part
The problem unique to long-running processes, and the one people meet three months in.
Instances outlive definitions. A process that runs for six weeks will still be running when you deploy a changed version of it.
Changing a definition mid-flight is dangerous. An instance that has completed step three under the old definition may find step four no longer exists.
Most engines pin instances to the version they started on, which is the safest behaviour and means old versions must be kept.
Plan for migration of long-running instances, or accept that a change only applies to new ones — and be explicit about which, because "we deployed the fix" means something different for each.
Avoid changing step semantics. Adding a step at the end is safe; reordering or removing steps in the middle is where instances break.
Human steps, and how they fit
Most real processes include a person, and how that is modelled determines whether the engine helps.
A waiting step is just state. The workflow pauses, costs nothing, and resumes when the answer arrives — which is what makes an engine better than a polling script.
Give the person context, not a link. An approval request with the relevant detail is answered; one that requires opening three systems is deferred.
Set a timeout and an escalation on every human step, because the alternative is a process waiting forever and nobody noticing.
Record who decided and when, which is usually the reason the process is being tracked at all.
Do not automate the decision to make the workflow tidier. The point of modelling a human step is that the judgement is genuinely required.
Who operates it once it is running
The part that decides whether a workflow engine improves things a year later.
Somebody has to watch the stuck instances. An engine surfaces them; it does not resolve them, and a list nobody reads is the same as no list.
Give each workflow an owner, named, because a definition without one is the first to rot when the person who wrote it moves on.
Decide who can retry and who can cancel. Both are operational actions with real consequences, and a process cancelled by somebody who did not understand its compensation is a mess.
Make the operational view readable by non-engineers, since the person who knows whether an order should be retried is usually not the person who deployed the workflow.
Report the instances that have been running longest, weekly. That list is short, it is always interesting, and nothing else surfaces a process that stopped without failing.
Review abandoned definitions. Workflows outlive the projects that created them, and an engine full of definitions nobody runs makes the ones that matter harder to find.
Building workflows with CodeWords
CodeWords connects to more than 3,000 integrations, and the orchestration — state, retries, waiting for people — is part of how an automation is built rather than infrastructure to run.
- Open CodeWords and start a new automation.
- Describe the process in plain language to Cody, the automation builder: the steps in order, what each one needs, and where a person is involved.
- Describe the exceptions: a step that fails, an approval that does not come, an input that arrives twice.
- Connect the systems each step touches, once, and reuse the connections.
You describe the outcome; Cody builds it, connects it, and deploys it. The free plan covers light use, with Pro at $39 per month and Business at $100 per month as usage grows; details are on the pricing page.
What to get right first
The state model: what the distinct states of your process are, what moves it between them, and what should happen if it stops in each one. Write that down before choosing any tool, because it is the part that transfers regardless of what you adopt and it is where most of the thinking is.
Two habits make the difference. Name steps for the business meaning rather than the technical action, since those names are what somebody reads during an incident at an awkward hour. And put a timeout on every step that waits for something external, because a process with no timeout does not fail — it simply stops, which is considerably harder to notice.
Frequently asked questions
How is a workflow engine different from a queue?
A queue moves work and forgets it. An engine remembers the state of each running process, so it can resume rather than restart, wait for days, and answer where a specific instance got to.
Is a cron job plus a status column a workflow engine?
It is an early version of one. Once that table has grown retry counts, stage columns, and conditionals, you have built an engine without the visibility, versioning, or timeout handling — which is usually the point to adopt a real one.
What happens to running processes when I change the definition?
Most engines pin each instance to the version it started under, so changes apply only to new instances. That is the safe behaviour, and it means "we deployed the fix" does not mean what people assume for in-flight work.
Can a workflow wait for a person?
Yes, and it is one of the better reasons to use one. A waiting step costs nothing while it waits, resumes when the answer arrives, and can escalate on a timeout — which an email thread cannot.
Do I need one for a single-step automation?
No. If restarting from the beginning after a failure is acceptable, and nothing waits on a person or an external event, orchestration is overhead without a corresponding benefit.
What is compensation?
Undoing earlier steps in a defined order when a later one fails — a refund after a failed fulfilment, for instance. It is how you approximate transactional behaviour across systems that share no transaction.
What breaks most often in practice?
Steps that wait with no timeout. They do not fail, they stop, and a stopped process produces no error anywhere — so it is found when somebody asks why an order from three weeks ago never completed.
Who should own a workflow definition?
A named person, recorded somewhere visible. Definitions outlive the projects that created them, and one with no owner is the first to rot — and the hardest to safely change when somebody eventually has to.
What operational report is worth having?
The longest-running instances, weekly. It is a short list, it is always interesting, and it is the only thing that surfaces a process which stopped without failing — which produces no error anywhere.