All posts
Liferay · 12 min read · Mar 26, 2026

Building Multi-Stage Approval Workflows Without Losing Business Context

Multi-stage approval workflow with conditional transitions

A two-step approval is easy. Someone submits, someone approves, done. The difficulty appears at the third stage, when a reviewer needs to know not just that the item reached them but what happened on the way - which items were queried, what the first approver reduced the amount to, whether this is the original submission or the third attempt.

That information is business context, and the mistake that causes most multi-stage workflow pain is assuming the workflow engine will carry it for you. It will carry position reliably. It will carry meaning poorly.

Workflow state and business state are different things

Every workflow-backed process has two parallel states, and confusing them is the root of a long list of downstream problems.

ConcernWorkflow stateBusiness state
AnswersWhere is this item right now?What has been decided about it, and why?
Lives inThe workflow instance and taskYour entity and its related records
LifetimeEnds when the instance completesPermanent
Queryable for reportingAwkward, engine-specificOrdinary database queries
Survives a definition changeNot reliablyYes

That last row is the decisive one. Workflow definitions get versioned and redeployed, and a process that runs for weeks will outlive the definition it started under. Anything you need in six months - approved amounts, decision reasons, who overrode whom - has to live in your own data, not in workflow variables.

Make outcomes explicit, not boolean

The default mental model is approve or reject, and it is almost always wrong. Most real processes have at least three outcomes, and collapsing them loses the distinction that matters most to the applicant.

  • Approve: this stage is satisfied, move forward.
  • Send back for correction: the submission is viable but incomplete; the applicant can fix it and the instance continues.
  • Reject: the submission is not viable; the instance ends and a new one is required.
  • Return to a previous approver: the decision is contested, but the applicant is not at fault.

Send back and reject feel similar in the interface and behave completely differently in the system. One keeps the instance, the history, and the already-verified work alive; the other discards it. Deciding which of the two a business rule actually means, before drawing any diagram, prevents a great deal of rework.

Conditions should read business data, not workflow memory

When a transition depends on something that happened earlier, the reliable source is the entity, not a variable set two tasks ago. A condition that reads the current state of the record is idempotent, testable outside the engine, and still correct if the instance is restarted or the definition is redeployed.

text
// Fragile: depends on a value someone remembered to set upstream
if (workflowContext.get("financeApproved") == true) -> Director

// Durable: reads the record, which is the system of record anyway
if (application.financeDecision == APPROVED
    && application.sanctionedAmount > DIRECTOR_THRESHOLD) -> Director
else -> Disbursement
Conditions that read the entity survive redeployment; conditions that read workflow memory do not.

This also makes the routing rule visible to the business. A threshold that lives on the record and is read by a condition can be shown in a screen, reported on, and changed without touching the workflow definition. A threshold buried in a script inside the definition is invisible until someone asks why a file went to the wrong desk.

Stamp each stage as it completes

The habit that makes multi-stage workflows maintainable is stamping the entity at every stage boundary: who decided, what they decided, when, on what version of the data, and with what comment. It feels redundant while you are building the first two stages. It becomes the backbone of the system by the fifth.

  1. The next approver can see the full decision history without opening the workflow engine.
  2. Escalation and reminder logic can be written as plain queries over timestamps.
  3. Stage duration reporting - where does this process actually get stuck - comes for free.
  4. A support engineer can explain any item's position without engine-specific tooling.

This is also what makes workflow automation measurable rather than merely faster. Nobody can prove a process improved if the only record of the old one is a completed instance with no timestamps attached to anything meaningful.

Rework loops and the amnesia problem

When a stage sends an item back, the item will return - and the engine will route it forward as if it were new. Without deliberate design, the second approver has no idea they are seeing a resubmission, which means they re-review everything and the applicant gets asked about things that were already settled.

Three fields fix most of this: a send-back counter, a pointer to the stage that raised the objection, and a flag on each piece of data indicating whether it changed since the last review. The third is the most valuable, because it lets the interface highlight what is actually new. That turns a full re-review into a targeted one, which is where the time saving in multi-stage processes really comes from.

Parallel approvals and disagreement

Parallel stages are attractive on a diagram and underspecified in practice. As soon as two approvers act at the same time, you owe an answer to a question the diagram does not ask: what happens when they disagree. The options are all reasonable and all different - first rejection wins, all must approve, majority decides, or a named role breaks the tie - but the choice has to be made explicitly and recorded, because the engine will happily implement whichever one you accidentally encode.

Parallel branches also complicate the send-back story. If one branch rejects while another is still deliberating, you have to decide whether the second reviewer's work is discarded, paused, or completed anyway for the record. Deciding that at design time is far cheaper than discovering it in production.

Keep the definition thin

The healthiest multi-stage workflows have thin definitions: tasks, transitions, assignments, and conditions that call out to services. The moment business logic starts living inside the definition - calculations in scripts, validation in transitions, notification content assembled inline - the process becomes untestable and every change requires a redeploy of the definition itself.

Pushing that logic into services keeps it unit-testable and reusable, and it means the same rules apply whether an item was moved by a reviewer, an API call, or a batch job. It is the same principle that makes per-file verification work cleanly: the engine coordinates, your code decides.

Conclusion

Multi-stage approval is a data modelling problem wearing a diagram as a disguise. Let the workflow engine answer where the item is, and make your own entities answer what was decided and why. Give each stage explicit named outcomes, read conditions from the record rather than from workflow memory, stamp every stage boundary, and design the rework loop before you need it. Do that and adding a sixth stage is a configuration change - not the beginning of a rewrite.

Contact

Let’s connect

Have a Liferay or Backend project you’d like to talk through? Fill in the form and I’ll get back to you.

Book Calendar