Typed Runtime Errors
Smithers runtime failures use typedSmithersError objects. Built-in errors expose:
code— machine-readable discriminatorsummary— raw human-readable messagemessage— the summary plus a docs linkdocsUrl— direct link to the error reference
KnownSmithersErrorCode and keep the full code list synced from Error Reference.
Retries
Set theretries prop to retry a task on failure. The value is the number of additional attempts after the first failure — so retries={2} means up to 3 total attempts:
_smithers_attempts. Previous attempts are never overwritten — you can inspect every failure after the fact. Between the failure and the next attempt, a NodeRetrying event is emitted.
The task is marked failed only after all retries are exhausted.
Schema validation retries
Here is a subtlety that will save you retry budget. When the agent returns JSON that does not match the output schema, Smithers does not immediately burn aretries count. Instead, it sends up to 2 follow-up prompts within the same attempt, appending the validation errors so the agent can fix its response.
Only if those schema retries also fail does the attempt fail — and then the retries mechanism takes over (if configured).
So retries={2} with schema validation gives you up to 9 chances to get a valid response: 3 attempts, each with 3 schema tries. That is usually more than enough.
Timeouts
SettimeoutMs to limit how long a single attempt can take:
retries is set, the task retries. This is your guard against agent calls that hang indefinitely — a rate-limited API that never responds, a model that gets stuck in a reasoning loop, a network partition.
continueOnFail
By default, when a task fails (after exhausting all retries), the workflow stops. Sometimes that is not what you want. Linting is nice to have but should not block the final report. Telemetry should not take down your pipeline. SetcontinueOnFail to let subsequent tasks proceed:
report task executes even if optional-lint fails. The failed task’s node state is failed, but the workflow continues. Use this for non-critical steps — linting, optional analysis passes, telemetry.
skipIf
Sometimes you know at render time that a task should not run. Maybe you are in “quick” mode and do not need a deep analysis.skipIf handles this:
skipIf evaluates to true, the task is marked skipped immediately. It will not run even if the condition changes on a later render cycle.
Important: skipIf is evaluated during rendering, not during execution. For tasks that should only run after a prerequisite completes, use conditional rendering instead:
skipIf says “this task exists but should not run.” Conditional rendering says “this task does not exist yet.”
Branch for Error Recovery
What if a task might fail, and you want to take a different path depending on the outcome? That is what<Branch> is for:
risky is undefined so ok is false — but the risky task runs first because it appears earlier in the <Sequence>. After risky completes, the workflow re-renders, ok resolves to the actual value, and the appropriate branch is taken.
The <Branch> component does not introduce any magic. It is just conditional rendering with a name.
Combining Patterns
Real workflows combine multiple error handling patterns. Here is one that uses all of them:continueOnFail — nice to have, not essential. The report uses skipIf — unnecessary in quick mode. The final summary always runs.
Error Handling Summary
| Mechanism | Prop | Effect |
|---|---|---|
| Retries | retries={N} | Retry up to N times after failure. Each attempt is recorded. |
| Timeout | timeoutMs={N} | Fail the attempt after N milliseconds. Combines with retries. |
| Continue on fail | continueOnFail | Let subsequent tasks run even if this task fails. |
| Skip | skipIf={boolean} | Skip the task at render time. Evaluated once per render cycle. |
| Branch | <Branch if={...} then={...} else={...} /> | Route to different tasks based on a condition. |
| Conditional rendering | {condition ? <Task /> : null} | Mount tasks only when prerequisites are available. |
Next Steps
- Resumability — How failed runs can be resumed after fixing issues.
- Debugging — Inspect failed attempts and error details.
- Error Reference — Exhaustive built-in runtime error codes and details.
- Execution Model — How retries and node states work internally.