Skip to content

Add flow-level defaultOnError strategy #93

@ameet

Description

@ameet

Description

Currently, error handling must be specified on every individual step:

{
  "id": "step1",
  "onError": {"strategy": "continue"},
  ...
},
{
  "id": "step2",
  "onError": {"strategy": "continue"},
  ...
}

For flows where most steps should continue on error (e.g., document formatting, visual rendering), this creates boilerplate and is easy to miss — one step without `onError` crashes the entire flow.

Suggestion

Add a flow-level default:

{
  "key": "my-formatting-flow",
  "defaultOnError": {"strategy": "continue"},
  "steps": [
    {"id": "criticalStep", "onError": {"strategy": "fail"}, ...},
    {"id": "step2", ...},
    {"id": "step3", ...}
  ]
}

Steps inherit the flow-level default unless they explicitly override it. This:

  1. Reduces boilerplate (one declaration vs N per step)
  2. Prevents accidental flow crashes from missing `onError` on non-critical steps
  3. Makes the error handling strategy visible at the flow level

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions