Exception Types
Nen defines three exception types:| Exception | Description |
|---|---|
WorkflowError | Base exception for all workflow failures |
RPCError | Communication failure with the orchestrator |
TimeoutError | Operation exceeded its timeout |
Catching Errors
If you want to handle failures gracefully such as for retry or to provide a fallback, wrap calls in try/except.Retry pattern
workflow.py
Conditional recovery
workflow.py
Raising Errors
Raise any exception to signal a workflow failure. The exception message is sent to the error webhook.workflow.py
workflow.py
workflow.py
Uncaught errors
If an exception propagates out ofrun() without being caught, the orchestrator treats the run as a hard failure. Use this intentionally when the workflow encounters a condition it cannot recover from — for example, a required file is missing, an external service is unreachable, or an assertion about the environment fails. The run is marked as failed and the exception message is surfaced to the caller, making the failure visible rather than silently returning a partial or incorrect result.
workflow.py
Error Webhooks
When a workflow fails, the error webhook payload contains the exception message:Any unhandled exception in your
run() function automatically becomes an error webhook. You don’t need to catch and re-raise — just let it propagate.