Programmatically terminate runs #8509
Unanswered
Replies: 1 comment
-
You can use GraphQL API for this. Here's an example query for Terminate an in-progress run. Or, you can also cancel a run via the following dagster instance methods: if instance.run_coordinator.can_cancel_run(run_id):
instance.run_coordinator.cancel_run(run_id)
# fetch the run to see if its state has changed since calling cancel
run = instance.get_run_by_id(run_id)
if not run.is_finished:
# just mark run as canceled
instance.report_run_canceled(run) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
is there a way to programmatically terminate runs? I’m trying to figure out how to build a sensor that will terminate runs if they are taking longer than expected
The question was originally asked in Dagster Slack.
Beta Was this translation helpful? Give feedback.
All reactions