run step judges the result, and the gate
sends the agent back until the check passes.
The gate schema
A gate is declared on a run step under thegate key:
A CEL expression that decides success. The only variable available is
exit_code — the step’s process exit code. Examples: exit_code == 0,
exit_code < 5. Required unless on_failure is present.The
key of an earlier step in the same job to restart from when the gate
fails (set key: on the target step). Execution resumes at that step.An optional message recorded with the restart decision, shown in the run
timeline.
Gates are valid on both run steps and agent steps —
success_if always
evaluates the step’s exit_code. The most reliable loop still puts the gate on a
run step that objectively verifies the agent’s work (tests, a linter), with
restart_from pointing back at the agent.How a gate is evaluated
After a gated step finishes, Shipfox evaluates the gate and reaches one of three outcomes:| Outcome | When | Result |
|---|---|---|
| Passed | success_if evaluates true | The step succeeds; the job continues |
| Failed | success_if is false | Restart from restart_from if the budget allows; otherwise the job fails |
| Uncheckable | No exit code, or the CEL expression errors | The job fails immediately — never restarts |
Loop bounds
Gates create loops, so Shipfox bounds them for you — there is no way to author an unbounded retry.- Per-step restart cap. A gating step is allowed 3 attempts by default (one initial run plus two restarts). When the cap is exhausted and the gate still fails, the step is marked failed and the whole job stops.
- Job execution timeout. Independently, the job-level
execution_timeoutbounds total wall-clock time (default 6 hours). Whichever bound is reached first ends the loop.
Related pages
Gate and retry guide
A worked example that retries a step until it passes.
Jobs & Steps
Step kinds, job isolation, and
execution_timeout.