Run long workflows that survive a deploy
Per-node checkpointing, so a killed worker does not redo side effects.
The problem
A long automation runs inside one job. Halfway through, the worker is killed — a deploy, a timeout, an out-of-memory. The retry starts the whole thing again.
For a pure calculation that is wasted time. For a step that sent an email, opened a pull request or charged a card, the retry does it a second time. "Run it again" is not a safe default once a step touches the outside world.
What you are building
Live surfaces, not screenshots — every one composed from the same components you would install.
Durable runs
A paused run is a database row, not a held process, so it survives a deploy.
| Run | Workflow | State | Waiting on | Age |
|---|---|---|---|---|
| run_8f21 | Expense approval | Awaiting approval | M. Iyer | 2h |
| run_8f19 | Expense approval | Completed | — | 5h |
| run_8f04 | Onboarding | Resumed after restart | — | 1d |
| run_8ef7 | Nightly digest | Failed · retrying | — | 1d |
A paused run is a database row, not a held process — which is why it survives a deploy.
The code
// This is the whole trick. Nothing is held in memory between steps, so a deploy,
// a crash or a queue restart cannot lose a run that is waiting on a person.
Schema::create('flow_runs', function (Blueprint $table) {
$table->id();
$table->string('workflow');
$table->string('status'); // running | awaiting_input | done | failed
$table->json('state'); // everything needed to resume
$table->timestamps();
});composer require particle-academy/fancy-flow-phpHow to solve it
Install the PHP runtime
The durable runner executes a workflow as queued jobs rather than one long-running process.
Run thisbash composer require particle-academy/fancy-flow-phpCheckpoint per node, not per run
One job computes which nodes are ready and dispatches them; another claims a single node and checkpoints it when it completes. A resume picks up from the last completed node instead of the start.
Declare which steps must not be replayed
A node marked unsafe to replay gets one attempt regardless of the retry setting, because retrying it would repeat the side effect rather than recover from it.
Let a claim be a race, safely
Node claims are enforced by a unique constraint rather than a check-then-act, so two workers racing for the same node produce a no-op, not a double run.
