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

Python API to cancel workflow #170

Closed
fritzwijaya opened this issue Dec 26, 2024 · 4 comments · Fixed by #180
Closed

Python API to cancel workflow #170

fritzwijaya opened this issue Dec 26, 2024 · 4 comments · Fixed by #180
Assignees

Comments

@fritzwijaya
Copy link

Just scourge the docs, but couldn't find any reference on Python API to cancel the workflow. What is the workaround on this case? When to support the functionality?

@apoliakov
Copy link
Member

Hi @fritzwijaya !

There are some workarounds:

  1. set the number of recovery attempts on the dead letter queue: https://docs.dbos.dev/python/reference/decorators#workflow

  2. edit your workflow state in Postgres:
    https://docs.dbos.dev/explanations/system-tables

@fritzwijaya
Copy link
Author

Hi @apoliakov,

I see. That would work for now. Thanks for the pointers.

It would be great for the python cli have the same function that is available on javascript atm.

Case closed for now. Cheers

@devstein
Copy link

Hi @apoliakov for

edit your workflow state in Postgres:

does that mean just running a SQL query to set status = CANCELLED?

@apoliakov
Copy link
Member

Hi @apoliakov for

edit your workflow state in Postgres:

does that mean just running a SQL query to set status = CANCELLED?

Hi @devstein! Yes, that should do it!

To make things easier in the future we aim to add this functionality to TS-Python within a month or so.

@qianl15 qianl15 linked a pull request Jan 17, 2025 that will close this issue
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 a pull request may close this issue.

4 participants