Resuming Failed Executions

Resume a failed execution so it restarts at the first phase that did not finish, instead of paying for the phases that already succeeded

The problem

A six-phase workflow dies in phase five. Phases one to four succeeded, cost real money, and produced artifacts you still want. Re-running the workflow from the start throws all of that away and pays for it twice.

Resuming an execution creates a new run that inherits the phases that completed and restarts at the first phase that did not finish. A run that dies in phase five of six costs you phase five onwards, not all six.

A run usually dies inside a phase, and that phase may already have pushed or published something. Re-running it can repeat that, so the resume asks you to say you accept it:

syn execution resume exec-43f430469266 --acknowledge-external-effects
Resumed exec-43f430469266
  New execution: exec-9a1c77e04b12
  Resumes at:    implement
  Not re-run:    premise, plan
  External effects acknowledged
Follow it with: syn execution show exec-9a1c77e04b12

If the resumed phase was never attempted - the run died between phases, and that phase had no earlier try - no flag is needed:

syn execution resume exec-43f430469266

A successful response means admitted

The call returns once the resume has been admitted and recorded on the parent. The child execution is created and started by a background processor, so a success tells you the decision was accepted, not that the child is already running.

Watch the child to see it start:

syn execution show <child-id>

If it never appears, the resume was admitted but its start was refused or is being retried. The platform records that against the parent's resume rather than losing it - a refusal that can only be known at start time (a vanished artifact, for instance) settles as failed after a bounded number of attempts.

You can read that record. syn execution show on the PARENT prints it:

syn execution show exec-43f430469266
Resume start:  failed
  Attempts:    3/3
  Reason:      inherited artifact art-plan-2 resolved to no files

What each status means:

StatusWhat it means
pendingAdmitted, not yet dispatched. The processor picks it up on its next pass
dispatchedA start is in flight. Give it a moment, then look for the child
pausedHeld because admission is closed, usually a deploy draining. It resumes itself
retryableA start failed transiently and will be tried again. Attempts shows how many are left
startedThe child's own stream exists. This is the one you want, and it is settled
failedSettled. Reason says why, and no further attempt will be made

Attempts is used over ceiling. A resume that reaches the ceiling settles as failed carrying its reason rather than retrying forever, so a child that never appears always has an explanation rather than silence.

Over the API the same record is on the parent's detail response under resume_start, with status, status_reason, attempts and max_attempts.

Resume is not fork

Resume continues work that did not finish. It is not a way to re-run a workflow from an arbitrary point. It is not available on a run that completed cleanly; the one completed run that can be resumed is one that ended with unresolved findings (review_verdict: blocked), and it resumes at its repair point (see below).

You wantHowStatus
Pick up a failed or interrupted run where it stoppedsyn execution resume <id>Available
Run another repair round on a completed run with unresolved findingssyn execution resume <id> --acknowledge-external-effectsAvailable
Start a new run from a chosen point of a completed run, the way a git branch is taken from a commit-Not built. Reserved as fork
Run the same workflow again from scratchsyn workflow run <name>Available

Until v0.32 the resume command was called fork, and syn control resume meant un-pausing a paused execution. Pause was removed - nothing ever acted on the pause signal - and resume now means only what this page describes. fork is reserved for the middle row above.

A resume is a new execution with its own id. The parent stays exactly as it was - still failed, still showing what it did. Nothing is rewritten, so the record of what went wrong survives.

What the child inherits

The resume inherits the contiguous run of phases that completed, in order, stopping at the first one that did not. A completed run with unresolved findings is the exception: every phase completed, so the child inherits only the phases before its repair point (see below). Either way:

  • those phases are never re-run
  • their artifacts are handed to the resumed phase, so it reads its predecessors' output
  • the resumed phase restarts from its beginning - there is no mid-phase resume

The handoff is checked but not guaranteed complete. If a phase recorded two artifacts and one has since gone, the resume is still admitted and the resumed phase runs with part of what its predecessor produced. Detecting that needs the artifact query to report which ids it resolved, which it does not yet do (#1460). A phase whose artifacts resolve to nothing is caught and refuses the resume.

Phases the parent skipped because a review certified (see Phase Plan, Progress and Repair Rounds) are not a gap. The child inherits them as skipped (inherited_skipped_phase_ids): they are not run and not counted as work still to do. In the child's phase_plan, inherited phases read inherited and inherited skips read skipped.

A phase that completed after a gap is deliberately not inherited. Its output was built on a predecessor the resume is about to produce again, so carrying it forward would hand the child work resting on something that no longer holds.

What the child runs

The child runs what the parent ran, not the workflow as it stands today. The full phase configuration - provider, model, prompt, timeouts - is pinned on the execution when it starts, so editing the workflow between the original run and the resume cannot silently change what the resume does.

If an inherited phase is missing from that pinned configuration, the resume is refused rather than started on a guess.

Two decisions you have to make out loud

Each defaults to false, and each applicable condition is refused without its flag. A resume that needs neither decision - a failed run whose resumed phase was never attempted - proceeds with no flags at all. The test is whether that phase was ever started, including by an earlier retry, not whether it was the phase the failure named. Neither flag implies the other.

A cancelled execution

A cancel is an instruction to stop - possibly because the run targeted the wrong repository, or its task held a secret. Resuming past that needs a fresh decision:

syn execution resume exec-1234 --override-cancellation

A resume inherits the parent's configuration and inputs, so it cannot correct what the cancel was for. If the run was cancelled because it targeted the wrong repository, or because its task held a secret, resuming reproduces that. Start a fresh execution instead.

A phase that may already have published something

If the phase being restarted had started in the parent, it may already have pushed a branch, opened a pull request or published a package. Re-running it can repeat that. Nothing in the record can prove it did not, so you acknowledge it:

syn execution resume exec-1234 --acknowledge-external-effects

What cannot be resumed

StatusResumable
failedYes, if a phase is left unfinished
interruptedYes, if a phase is left unfinished
cancelledOnly with --override-cancellation
completedOnly when it ended with unresolved findings (review_verdict: blocked); see below. Otherwise no - nothing is left to run
runningNo - resuming would put two runs on one piece of work

Three conditions apply whatever the status. A run with nothing to resume is refused: a failed or interrupted run resumes at its first unfinished phase, so one with no unfinished phase is refused, while a completed run with unresolved findings has no unfinished phase and resumes at its repair point instead. A run whose resumed phase had already started needs --acknowledge-external-effects. And a parent that pinned no phase configuration - an execution from before that was recorded - cannot be resumed at all, because what the child would run could then only be read from the current workflow template.

A resumed child can itself be resumed, when it is otherwise eligible. Each inherited phase's files are read from the execution that actually produced them, which may be an earlier ancestor rather than the immediate parent, so a chain of resumes keeps reaching the right output (#1462).

A parent can be resumed once. Asking twice is refused and names the resume it already has, so a retried request cannot quietly create a second child.

That is why every refusal the platform can know at admission is checked before the resume is recorded: a parent whose one resume was spent on a child that then failed to start cannot be resumed again.

It is not a guarantee that the child will start. Admission is a point-in-time check, and a start can still fail afterwards - an artifact that disappears in between, a read model lagging the parent's own stream, maintenance closing, or an infrastructure fault.

Those failures are recorded against the parent's resume, wherever they are raised. A transient one is retried up to the attempt limit and then settles as failed with the reason; a refusal the domain makes settles as failed immediately; and the child's own start event settles the record as started (#1463). So a child that never appears has a recorded reason rather than an indefinite retry.

Resuming a run with unresolved findings

A workflow with bounded repair rounds (such as sdlc-implement-v3) can complete with review_verdict: blocked: every round ran and the last review still blocked the change. There is no unfinished phase, but the run is still resumable, at its repair point: the fix phase of the last round that ran (fix_2 in sdlc-implement-v3; fix_3 for a run started under the earlier three-round definition).

  • The child inherits every phase before the repair point and re-runs that round's fix, its review, and everything after (finalize_pr).
  • The repair point is decided by the platform from the parent's recorded review verdicts, never by the caller.
  • The fix phase already ran and may have pushed, so the resume needs --acknowledge-external-effects.
  • A completed run that certified, or that nothing reviewed, has nothing to resume and is refused.
syn execution resume exec-43f430469266 --acknowledge-external-effects

Queued resumes

A resumed child starts like any other execution: it claims a slot from the same execution budget (SYN_EXECUTION_MAX_CONCURRENT) as direct starts and trigger dispatches. When every slot is taken, the child waits, first come first served. While it waits, syn execution show <child-id> and GET /executions/{id} report status: queued (or starting once it holds a slot) instead of 404, with a start_queue object: path (resume), position (1 is next), running, waiting, limit, queued_at, and position_display, for example queued 2 of 3 (4/4 running). queued is not an execution status: the child has no event stream yet. A queued start survives an API restart. Maintenance mode also holds it: a resume admitted before a pause starts after admission reopens.

Cancelling a queued start

A direct start (syn workflow run, POST /workflows/{id}/execute) that is still waiting for a slot can be cancelled the same way as a running execution:

syn control cancel <execution-id> --force --reason "no longer needed"
# or
curl -X POST "$SYN_API_URL/api/v1/executions/<execution-id>/cancel" \
  -u "${SYN_API_USER:-admin}:$SYN_API_PASSWORD" \
  -H 'Content-Type: application/json' -d '{"reason": "no longer needed"}'
  • The start's request is withdrawn, durably, before the answer returns. It never runs: not when a slot frees, and not after an API restart.
  • The response (ControlResponse) has success: true, state: "cancelled" and message: "Withdrawn before it started: it will not run". Afterwards syn execution show <execution-id> reports it as cancelled.
  • If the start won the race and began before the withdrawal landed, it is cancelled like any running execution and the response is the ordinary cancel response, never "will not run".
  • syn control cancel refuses without --force (or -f).

Over the API

curl -X POST "$SYN_API_URL/api/v1/executions/exec-1234/resume" \
  -u "${SYN_API_USER:-admin}:$SYN_API_PASSWORD" \
  -H 'Content-Type: application/json' \
  -d '{"override_cancellation": false, "acknowledge_external_effects": false}'
{
  "parent_execution_id": "exec-1234",
  "execution_id": "exec-9a1c77e04b12",
  "resume_phase_id": "implement",
  "inherited_phase_ids": ["premise", "plan"],
  "cancellation_overridden": false,
  "external_effects_acknowledged": false
}
CodeMeaning
200The resume was admitted. The child starts asynchronously.
404No such execution.
409A refusal: the parent's status, a missing decision, a parent already resumed, a snapshot the child cannot start from, or an inheritance that cannot be read. The reason is in detail.
503No unused execution id could be minted. Retry.

A malformed body or field is 422 from request validation, and an infrastructure fault is 500. A refusal is 409 rather than 400 because it is a conflict with what the parent recorded, not a malformed request.

If the child never appears

A successful resume is an admission, and the child is started by a background process. If no child execution shows up:

  1. Check whether the child exists at all: syn execution show <child-id>, using the execution_id the resume returned. If it is there, the start worked and the problem is in the run rather than the resume.
  2. Check whether admission is closed. A held start resumes on its own when maintenance reopens.
  3. Run syn execution show <parent-id> and read Resume start:: its status (pending, paused, retryable, dispatched, started or failed), Attempts and Reason. Over the API it is resume_start on GET /executions/{execution_id} for the parent. The API logs (Background resume start raised exception) carry the stack trace.
  4. Causes worth ruling out in order: maintenance mode, artifact-list projection lag, whether the inherited artifacts still exist, and event-store errors.

Verifying it after a deploy

Worth doing once on a disposable workflow after upgrading:

  1. Confirm /openapi.json contains POST /executions/{execution_id}/resume, and that your syn build matches the API.
  2. Run a workflow that completes one phase and then fails inside the next. Note the parent id and the completed phase's artifacts.
  3. Resume it with no flags. Expect 409 mentioning external effects. A refusal writes nothing: syn execution show <parent-id> shows no Resume start: block, and the next step must still succeed.
  4. Resume it with --acknowledge-external-effects. Expect 200, a new child id, the right resume phase and inherited prefix. Resume the parent again and expect 409 naming the resume it already has.
  5. Follow the child with syn execution show <child-id>: the inherited phases should not re-run, the resumed phase should run with its predecessors' files available, and the parent should still read failed.

Resuming for comparison

Resuming a failed run is what resuming pays for today. The same primitive is what comparison would be built on - a resume starts from a recorded baseline rather than from whatever the workflow says now - but there is no way to vary anything yet.

A resume copies the parent's pinned phases and inputs exactly. The API accepts no overrides, so you cannot currently resume a run with a different model or an edited phase. That is future capability, not a switch you are missing.

The commit each repository was at is recorded on an execution, and a workspace checks each repository out at that commit (a resume at its parent's), refusing to start if origin no longer has it. A repository whose commit could not be resolved at start (for example, a run started without GitHub access) pins nothing and clones the default branch's head. The other exception is the phase a resume resumes: a branch its parent's attempt already pushed is checked out at that branch's current head, so its next push lands on the same PR. A resume also inherits its parent's configuration and inputs, so what can differ between a parent and its resume is which phases ran, the head of any continued branch, and the code of any repository that was never pinned.

See also

On this page