Error Handling
Error handling is not a special action - it is built into every step. Any step can hit an unexpected runtime failure, and metamorphOS lets you decide, per step, what should happen when it does.
Every step can be error-handled
From any step you can connect an error path to one or more follow-up steps. That path runs when the step errors at runtime.
This is independent of a step’s own outcomes. A Conditional Branching
step routes success or failure as part of its normal logic; an error path is
the additional route taken when the step itself fails unexpectedly. Steps that
have no logical branch of their own - like Push to Array
- can still be error-handled the same way.
A logical failure (“the condition wasn’t met”) and a runtime error
(“the step couldn’t run”) are different things. Handle them separately.
Handled vs. unhandled
- Handled - you connected an error path. When the step errors, the process continues down that path.
- Unhandled - no error path is connected. The step’s error stops that branch of the instance, and the failure surfaces in the Monitor.
Because the choice is per step, you decide where robustness matters and where a hard stop is the right behavior.
What to do on an error path
An error path is just more process. Common patterns:
- Notify - alert a person or channel that something failed.
- Clean up - undo or compensate partial work.
- Fall back - try an alternative route or a default value.
- Escalate - hand off to a human task for manual resolution.
- Retry - loop back and attempt the step again.
Where errors show up
- The Monitor shows failed instances and where they stopped.
- Steps that can produce diagnostics expose them as outputs - for example, Run Script writes an Error Message and Logs you can route and inspect.
Best practices
- Add error paths to the steps that realistically fail - external calls, scripts, document generation - not to every trivial step.
- Keep a clear catch path that makes failures visible to someone.
- Don’t swallow errors silently; route them somewhere a person will see.
Related
- Monitor - find and inspect failed instances.
- Branching and Merging - how outcomes route to successor steps.
- Run Script - capture an error message and logs to drive an error path.