Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow finalizer / abort hook #3674

Open
gabriel-farache opened this issue Sep 19, 2024 · 2 comments
Open

Workflow finalizer / abort hook #3674

gabriel-farache opened this issue Sep 19, 2024 · 2 comments
Assignees

Comments

@gabriel-farache
Copy link
Contributor

Description

The way we currently to it is by updating the state via a graphQL mutation request sent to the DI so there is no known way to me to execute a state that is executed before aborting the workflow.

This would be nice to be able to set a finalizer / abort hook that is always executed when canceling the workflow: if the workflow already started some external execution or made some changes, it would be nice to be able to revert those.

Implementation ideas

No response

@gabriel-farache
Copy link
Contributor Author

gabriel-farache commented Sep 20, 2024

If the DELETE call that abort a workflow would throw an exception, then by configuring a global, or by state, onErrors catching the thrown exception would solve the issue:

"extensions" : [ {
      "extensionid": "global-onErrors",
      "onErrors": [{
         "errorRef" : "abort",
         "transition": "compensateState"
     }]
  ]

@fjtirado fjtirado self-assigned this Sep 20, 2024
@fjtirado
Copy link
Contributor

After discussing this issue further, I think we can automatically execute compesating states if the workflow is aborted by calling delete endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants