Failure classification
When a node fails, Fabro classifies the failure into one of six categories. These classes drive retry decisions, circuit breaker logic, and edge routing.
Classification happens automatically. Fabro inspects SDK error types, HTTP status codes, and error message patterns to assign the right class. The
failure_class is written to context after each stage, so you can route on it in edge conditions:
Human gates fail closed when unanswered
Human approval gates are special: lack of an answer is treated as a failure, not as an implicit approval. If a prompt ends because stdin is closed, the user cancels it, a web session disconnects, or a test/replay interviewer has no answer available, the human stage returns a failure outcome instead of selecting an unconditional branch. That means an unanswered gate will only continue if you model that path explicitly, for example:outcome=failed edge or retry_target exists, the run stops rather than advancing past the approval gate.
Stop linear workflows on failure
By default, Fabro useson_failure="route". A failed node can take an unconditional edge when no explicit route matches. This compatibility default lets existing workflows decide how later nodes handle the failure.
Set graph-level on_failure="exit" to stop a linear workflow at a failed node:
stop-on-failure.fabro
condition="outcome=failed", before it applies this policy. Matching preferred labels and suggested next node IDs also remain explicit routes. If no explicit edge matches, exit skips the unconditional edge and checks retry targets. The run ends as failed only when no retry target exists.
Set on_failure on a node to control that node alone. The node-level attribute overrides the graph level, in both directions: a node can opt out of a graph-level exit with on_failure="route", or stop the run on its own failure with on_failure="exit" while the rest of the graph keeps the default. A node without the attribute inherits the graph policy. See Failed-node routing policy.
The policy applies only to failed. Other outcomes keep their normal routing behavior. For parallel nodes, the policy uses the completed parallel node’s final outcome. It does not stop or cancel individual branches early.
Treat a failed node as succeeded
Seton_failure="succeed" on a best-effort node so its failure never blocks the workflow. This pairs well with a strict graph default:
best-effort-node.fabro
optional_scan fails, Fabro first checks explicit recovery routes with the failed outcome. If none match, it rewrites the outcome to succeeded and routes the node as a success. Retries still run first; only the final outcome changes. The original failure stays on the stage.completed event and in the checkpoint, and the outcome’s notes record the promotion. A promoted outcome satisfies a goal gate. Setting on_failure="succeed" on the graph applies it to every node.
succeed applies only to failed. It does not change a partially_succeeded outcome. auto_status=true is the deprecated spelling of this policy; validation warns and suggests on_failure="succeed".
Retry layers
Fabro retries failures at three levels: LLM retries handle transient API errors inside a single model call, turn-level retries recover from dropped streams mid-response, and node retries re-execute the entire node handler when the first two levels aren’t enough. These layers are independent — a node retry re-runs the full handler, which gets its own fresh set of LLM and turn-level retries.LLM retries
Every LLM call (within an agent session or a one-shot prompt node) has a built-in retry loop for transient API errors. This is invisible to the workflow — it happens inside the model call itself.
Only transient errors are retried: rate limits, server errors (5xx), timeouts, network failures, and stream interruptions. Permanent errors like authentication failures or invalid requests fail immediately.
If the provider returns a
Retry-After header, Fabro respects it — unless the delay exceeds 60 seconds, in which case the call fails rather than blocking the run.
Turn-level retries
When an LLM stream drops mid-response (common under high concurrency), Fabro retries the same agent turn up to 3 times instead of failing the entire session. Conversation history is preserved across retries, and any partial assistant output from the interrupted stream is replayed so the model can continue where it left off. This avoids restarting the full stage from scratch for transient stream failures.Node retries
When a node handler fails (after LLM and turn-level retries are exhausted), the engine can retry the entire node. This is controlled by retry policies.Retry policies
Set a retry policy on a node with theretry_policy attribute:
All policies apply random jitter (0.5x–1.5x) and cap individual delays at 60 seconds.
Setting retries without a policy
You can also set just the retry count usingmax_retries:
Resolution order
The engine resolves retry configuration in this order:- Node attribute
retry_policy— named preset - Node attribute
max_retries— count only, default backoff - Graph attribute
default_max_retries— applies to all nodes without explicit config (default: 3)
What gets retried
Not all errors trigger a node retry. The handler’sshould_retry check must return true — generally, only errors classified as transient are retried. Deterministic errors (auth failures, bad config) fail immediately without consuming retry attempts.
When a handler reports a retryable failure, retries always proceed if attempts remain. If retries are exhausted and the node has allow_partial=true, the outcome is promoted to partially_succeeded instead of failed. See Node Outcomes — Retry loop for a detailed flow diagram.
Model fallbacks
When a model provider fails with a provider-local error, Fabro can automatically switch to another target. Configure one fixed chain for each requested model in your run configuration:run.toml
- A bare provider token such as
"gemini"selects that provider’s closest compatible model. - A qualified selector such as
"openrouter:gpt-56-sol"resolves only within that provider. The selector may be a canonical model ID, alias, or provider API ID such as"openrouter:moonshotai/kimi-k3". - A bare model slug or alias considers ready providers and uses provider priority.
"openai:gpt-5.6-sol" pins the direct OpenAI offering. Legacy provider/model fallback references remain accepted for compatibility.
Fabro selects the chain by the original requested model. A target in that chain never activates the target model’s own chain. The same chain position is retained across structured-output repairs and cached agent sessions.
The primary provider and model were already resolved and persisted when the run was created; resuming does not re-run primary selection. Fallbacks are only considered after an eligible runtime failure. If the fallback model does not support the requested reasoning level, Fabro uses the nearest supported level and rounds equal-distance choices up.
What triggers failover
Failover is a superset of LLM retry eligibility:
Quota errors are the key distinction — they aren’t retried against the same provider (the quota won’t reset) but are eligible for failover to a provider with its own quota.
Loop detection
Fabro has two independent mechanisms for detecting stuck loops: node visit limits that catch workflow-level cycles, and tool call pattern detection that catches agent-level repetition.Node visit limits
Themax_node_visits graph attribute sets the maximum number of times any single node can execute before the run is terminated:
example.fabro
When a node hits the limit, the run fails immediately:
Per-node overrides
You can setmax_visits on individual nodes to override the graph-level limit for that node:
example.fabro
max_visits takes precedence over max_node_visits (and the dry-run default of 10). This is useful when specific nodes — like a fix-and-verify loop — should have a tighter limit than the rest of the workflow:
Tool call loop detection
Inside an agent session, Fabro monitors the last 10 assistant turns for repeating tool call patterns. It detects patterns of length 1 (same call repeated), 2 (A-B-A-B), or 3 (A-B-C-A-B-C). Every complete group in the window must match for detection to trigger. When a loop is detected, Fabro injects a steering message into the conversation:WARNING: Loop detected. You appear to be repeating the same tool calls. Please try a different approach or ask for clarification.This gives the agent a chance to break out of the loop without failing the node.
Failure signatures and circuit breakers
Failure signatures are a deduplication mechanism that prevents the same failure from recurring indefinitely across loop iterations. They are particularly important for workflows with retry loops (implement → verify → fix → verify → …).How signatures work
After each failed node, Fabro constructs a failure signature — a normalized fingerprint combining the node ID, failure class, and error message:<hex>, replacing digits with <n>, and truncating to 240 characters. This groups failures with the same root cause even when details like line numbers or timestamps vary.
Circuit breaker
Fabro tracks signature counts across the run. When the same signature repeats 3 times (configurable vialoop_restart_signature_limit), the run is terminated:
deterministic and structural failures are tracked — transient failures are excluded because they may genuinely resolve on retry.
Failure signature counts are never reset on success. This is intentional — it prevents cycles like “implement succeeds → verify fails → fix → implement succeeds → verify fails” from running indefinitely.
Loop restart edges
Taking an edge marked withloop_restart=true restarts the workflow from the edge’s target node. A restart is more than a jump: the completed-stage history, per-node outcomes, and retry counts are cleared, and the run context is replaced with a fresh, empty context — the target node starts over as if the run had just begun there, with no preamble of prior stages. Node visit counts are the one thing preserved, so max_visits and max_node_visits still bound how many times a restart loop can run.
A successful outcome may take a loop_restart edge freely. This is the “start another round from a clean slate” pattern — for example, a self-loop that begins a fresh batch of work and re-derives its remaining work from the repository state rather than from accumulated context.
A failed outcome faces an additional guard: only transient_infra failures may cross a loop_restart edge. If the failure class is anything else, the run is terminated:
restart_failure_signatures) that enforces the same signature limit.
Goal gates
Goal gates are quality checkpoints that are enforced when the workflow reaches an exit node. A node marked withgoal_gate=true must have completed with succeeded or partially_succeeded — otherwise the run cannot finish. See Node Outcomes — Goal gate interaction for how partially_succeeded and allow_partial interact with goal gates.
- Failed node’s
retry_targetattribute - Failed node’s
fallback_retry_targetattribute - Graph-level
retry_targetattribute - Graph-level
fallback_retry_targetattribute
example.fabro
Stall watchdog
Fabro runs a background watchdog that monitors event activity. If no events are emitted for longer than the stall timeout, the run is canceled. This catches cases where a handler hangs indefinitely without producing errors.example.fabro
When failures become fatal
A node failure does not automatically terminate the run. Fabro follows this escalation path:- LLM retries — transient API errors are retried inside the model call (up to 3 retries)
- Turn-level retries — dropped streams retry the same agent turn (up to 3 retries), preserving conversation history
- Provider failover — if configured, switch to a fallback provider
- Node retries — re-execute the entire handler (per the retry policy)
- Direct jump — use
jump_to_nodewhen the outcome supplies one - Explicit edge routing — look for a matching condition, preferred label, or suggested next node
- Failure policy — with no explicit route, apply the effective
on_failure(node-levelon_failurefirst, then graph-level):exitskips the unconditional edge,succeedpromotes the outcome tosucceededand routes it as a success, androute(or no attribute) keeps normal fallback routing - Unconditional edge — in
routemode, or after asucceedpromotion, use an edge without a condition as the fallback - Retry target — if no edge was selected, check
retry_targetandfallback_retry_targeton the node, then on the graph - Run failure — if none of the above produces a path forward, the run terminates
max_node_visits or node-level max_visits to stop an unbounded cycle.
The run also terminates immediately for:
- Node visit limit exceeded — a node has been visited too many times
- Circuit breaker tripped — the same failure signature has repeated too many times
- Loop restart blocked — a non-transient failure tried to cross a
loop_restartedge - Goal gate failure with no retry target — a required gate was unsatisfied at the exit node
- Stall timeout — no events for too long
- Cancellation — user or system cancel signal