I have been looking at the airflow documentation for creating a scheduled dag run. My use case is i want to create & schedule a dag run on a specified time only once. This time value i will be getting from datetime column from a database table.
For this we do have schedule/schedule_interval DAG parameter but that accepts a datetime objects and cron expression which is recurring in nature. And if i want to run only once schedule/schedule_interval needs to be set to @once.
My ideal workflow would be
- I'll have a master DAG 1 which scheduled to run every 10mins
- This master dags reads the date time column values
- using the datetime values this dag will create other dags which is scheduled to run on specified time which can vary for each dag here (datetime values)
DAG 1 (lets assume this is running at 9:00AM ) --> create 2 DAGs which run at 9:11 & 9:15
Reference documentaion
https://docs.astronomer.io/learn/dynamically-generating-dags
https://docs.astronomer.io/learn/scheduling-in-airflow#parameters
looking for some good suggestions preferably in python