# Errors and retries

Source: https://openflow.run/en/docs/concepts/errors-and-retries/
Language: en
Product version: 0.1.0-beta.77

Decide which failures can repeat a Task, continue through an error value, or stop the Run.

A retry repeats a complete Task with the same inputs. Error handling can turn a supported final failure into a system error value. They are independent settings and have different consequences.

## Task retries

Code, Connector, OpenAPI, LLM, and AI Decision support `retry`. `maxRetries` is 0–5 additional attempts. `intervalMs` is a whole number of seconds from 1,000 to 60,000 milliseconds.

```json
{
  "op": "node.update",
  "node": "NODE_REFERENCE",
  "set": { "retry": { "maxRetries": 2, "intervalMs": 5000 } }
}
```

A retry may repeat an external operation. It does not reset Run deadlines, bypass limits, or replay an unconfirmed side effect. Agent, workflow calls, Triggers, Wait, and Approval do not support this node retry policy.

## Handle an error

The same five Task types support `onError: "error"`; the default is `"stop"`. If retry is enabled, error handling applies after the final attempt. Supported input or output validation failures can be handled but are not retried.

Success exposes system `error` as null. A handled failure exposes a structured error and continues along the ordinary execution edges. It commits no business outputs for that failed invocation.

```json
{
  "kind": "system",
  "node": "NODE_REFERENCE",
  "port": "error"
}
```

Use Condition to distinguish null from an error object. Downstream business bindings must accept missing or null values where a handled failure can reach them. There is no separate error execution edge.

## Failures that cannot be handled

Cancellation, deadlines, resource limits, isolation failures, persistence failures, and indeterminate effects cannot be converted into ordinary handled business errors.

## Workflow-level handling

[Flow Error](https://openflow.run/en/docs/nodes/error/index.md) starts a separate handler for an eligible production failure. It does not act as a node-level catch, clear the failed source Run, or establish that rerunning its work is safe.

## Sources

*   [docs/authoring/node-authoring.md](https://github.com/oomol-lab/open-flow/blob/e25a738d170322734572a0b8a1323cb00b9d355a/docs/authoring/node-authoring.md#node-retries)
*   [docs/authoring/node-authoring.md](https://github.com/oomol-lab/open-flow/blob/e25a738d170322734572a0b8a1323cb00b9d355a/docs/authoring/node-authoring.md#node-error-handling)
*   [docs/control/contracts/control-api.md](https://github.com/oomol-lab/open-flow/blob/e25a738d170322734572a0b8a1323cb00b9d355a/docs/control/contracts/control-api.md#node-retry-policy)
