Skip to content

[Fix #1148] Add then flow directive to catch clause#1173

Open
ricardozanini wants to merge 5 commits into
open-workflow-specification:mainfrom
ricardozanini:feat/1148-catch-then-directive
Open

[Fix #1148] Add then flow directive to catch clause#1173
ricardozanini wants to merge 5 commits into
open-workflow-specification:mainfrom
ricardozanini:feat/1148-catch-then-directive

Conversation

@ricardozanini

Copy link
Copy Markdown
Collaborator

Summary

  • Add then property (type flowDirective) to the catch clause of try tasks
  • Enables control flow transitions after catching errors (e.g., then: handleError to jump to a shared error-handling task)
  • Avoids duplicating inline do blocks when multiple try tasks need the same error-handling sequence

Changes

  • schema/workflow.yaml: Added then property referencing flowDirective to TryTaskCatch
  • dsl-reference.md: Added then row to the Catch properties table
  • examples/try-catch-then-directive.yaml: New example demonstrating the then directive in a catch clause

Test plan

  • All 130 validation tests pass (including the new example)

Fixes #1148

…ch clause

Add support for the then flow directive in the catch clause of try
tasks, enabling control flow transitions after catching errors.
This allows multiple try tasks to route to shared error-handling
tasks without duplicating inline do blocks.

Signed-off-by: Ricardo Zanini <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 19:08
@ricardozanini
ricardozanini requested a review from cdavernas as a code owner July 23, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a then flow directive in the catch clause of try tasks in the Serverless Workflow DSL, enabling workflows to transition to a shared error-handling task after an error is caught.

Changes:

  • Extended the workflow schema to allow catch.then (as a flowDirective) on try tasks.
  • Updated the DSL reference to document the new then property for catch.
  • Added a new example workflow demonstrating catch.then.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
schema/workflow.yaml Adds then to TryTaskCatch, referencing the shared flowDirective definition.
dsl-reference.md Documents the new catch.then property in the Catch properties table.
examples/try-catch-then-directive.yaml Adds an example showing then used in a catch clause.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/try-catch-then-directive.yaml
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 23, 2026 19:40
Comment thread examples/try-catch-then-directive.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread schema/workflow.yaml Outdated
Comment thread dsl-reference.md Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 19:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 23, 2026 19:52
Address review feedback: the `do` block handles the error, this task
just records the outcome after catch processing.

Signed-off-by: Ricardo Zanini <[email protected]>
@ricardozanini
ricardozanini force-pushed the feat/1148-catch-then-directive branch from 1535fbc to 045037c Compare July 23, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 23, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add then directive in catch clause for try tasks.

3 participants