Skip to content

API for marking the running DAG state to success or failure #16412

Description

@MAHESH-HASBI

Description

Like how we are able to turn OFF the DAG or turn ON the DAG using airflow API, we need a feature where we can mark the running DAG as FAILED or SUCCESS. This feature is needed for us.

I see two methods set_dag_run_state_to_failed and set_dag_run_state_to_success already present in code like how we want. It would be good if we have an API for it.

API's something like below
GET /api/experimental/dags/<DAG_ID>/dag_runs/string:execution_date/SUCCESS
GET /api/experimental/dags/<DAG_ID>/dag_runs/string:execution_date/FAILED

Use case / motivation
In my application, airflow DAGs are getting stuck in a running state for some reason, we want to mark them as FAILED or SUCCESS and trigger a fresh DAG run, and sometimes while the DAG is in running state we want to abort it based on some predefined conditions. Currently, we are doing this by using airflow UI but we want to use API instead.

Are you willing to submit a PR?

No, I'm not willing to contribute.

Related Issues

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions