Workflow hooks

Registered by Renat Akhmerov

We need to be able to define hooks at workflow level to trigger certain logic based on how state of a workflow changed.

Proposed syntax:

wf:
    input:
        p1: ...
        p2: ...

    on-error:
        action | workflow: my_post_mortem_action arg1=<% $.p1 %> ..

    on-success:
        action | workflow: my_post_success_action arg1=<% $.p1 %> ..

    on-pause:
        action | workflow: my_on_pause_action arg1=<% $.p1 %> ..

    on-cancel:
        action | workflow: my_on_cancel_action arg1=<% $.p1 %> ..

    tasks:
        task1:
        ....

One of the use case this proposal addresses:

We want to notify an external system in case of any workflow state change, whether it got cancelled, failed, paused, or succeeded. Currently existing 'on-error' clause can't be applied here because it handles only action errors, not errors like YAQL/Jinja evaluation errors. But we're interested in doing something on any workflow state change.

Blueprint information

Status:
Not started
Approver:
Renat Akhmerov
Priority:
Medium
Drafter:
Renat Akhmerov
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.