Repository navigation
Open
sudsk/airflow
#9Labels
kind:featureFeature RequestsFeature Requestsprovider:googleGoogle (including GCP) related issuesGoogle (including GCP) related issues
Description
Description
Add support for filtering/monitoring Dataflow jobs by job_name in DataflowJobStatusSensor (and its corresponding trigger DataflowJobStatusTrigger), rather than requiring job_id.
Currently, DataflowJobStatusSensor strictly requires job_id. Because Dataflow job names are not globally unique, the sensor should look up jobs matching job_name within the specified project/location and target the latest job based on its createTime / startTime.
Use case/motivation
In many CI/CD and production environments:
- Pipelines are triggered externally or via tools that do not automatically pass the generated Dataflow
job_iddownstream via XCom. (I use cloud run job operator to launch dataflow in a java environment that I can manage) - Users follow predictable naming conventions (e.g.,
daily-etl-pipelineordaily-etl-pipeline-{{ ds_nodash }}). - Needing
job_idforces users to write custom Python operators or custom hooks just to fetch the job ID before handing it over toDataflowJobStatusSensor.
Allowing job_name directly in DataflowJobStatusSensor will simplify DAGs and make the sensor consistent with other operators (like DataflowStopJobOperator) that already allow filtering by name.
Proposition
- Update
DataflowJobStatusSensorarguments to makejob_id: str | None = Noneand addjob_name: str | None = None(raising anAirflowExceptionif neither or both are provided). - In
poke()andDataflowJobStatusTrigger:- If
job_nameis provided, callDataflowHook.list_jobs()(or equivalent API) filtered by location/project. - Filter jobs matching
job_nameand sort bycreateTimedescending. - Track the status of the newest job.
- If no job matching
job_nameis found yet, continue sensing until timeout or until the job appears.
- If
Related issues
No response
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
kind:featureFeature RequestsFeature Requestsprovider:googleGoogle (including GCP) related issuesGoogle (including GCP) related issues
Activity
namanjain24-sudo commentedon Sep 10, 2026
take
Merge branch 'main' into fix/apache#72875