
Defaults to """ get_ip = GetRequestOperator ( task_id = 'get_ip', url = "" ) ( multiple_outputs = True ) def prepare_email ( raw_json : Dict ) -> Dict : external_ip = raw_json return inside a Jinja template.ĭef branch_func ( ti ): xcom_value = int ( ti. datetime ( 2021, 1, 1, tz = "UTC" ), catchup = False, tags =, ) def example_dag_decorator ( email : str = ): """ DAG to send server IP to email. Schedule interval put in place, the logical date is going to indicate the timeĪt which it marks the start of the data interval, where the DAG run’s startĭate would then be the logical date + scheduled ( schedule_interval = None, start_date = pendulum. However, when the DAG is being automatically scheduled, with certain Logical is because of the abstract nature of it having multiple meanings,ĭepending on the context of the DAG run itself.įor example, if a DAG run is manually triggered by the user, its logical date would be theĭate and time of which the DAG run was triggered, and the value should be equal (formally known as execution date), which describes the intended time aĭAG run is scheduled or triggered. Run’s start and end date, there is another date called logical date This period describes the time when the DAG actually ‘ran.’ Aside from the DAG Tasks specified inside a DAG are also instantiated intoĪ DAG run will have a start date when it starts, and end date when it ends. In much the same way a DAG instantiates into a DAG Run every time it’s run, Run will have one data interval covering a single day in that 3 month period,Īnd that data interval is all the tasks, operators and sensors inside the DAG Those DAG Runs will all have been started on the same actual day, but each DAG The previous 3 months of data-no problem, since Airflow can backfill the DAGĪnd run copies of it for every day in those previous 3 months, all at once. It’s been rewritten, and you want to run it on Same DAG, and each has a defined data interval, which identifies the period ofĪs an example of why this is useful, consider writing a DAG that processes aĭaily set of experimental data. If schedule_interval is not enough to express the DAG’s schedule, see Timetables.įor more information on logical date, see Data Interval andĮvery time you run a DAG, you are creating a new instance of that DAG whichĪirflow calls a DAG Run. However, my use case is to have it configured via xcom pull.For more information on schedule_interval values, see DAG Run. Is there a way to pull in xcom variable value into it? Looking at this link - DAG Dependencies, I see that this value is jinja templated i.e.

I want to modify the trigger_dag_id value based on the filename.


Trigger_dependent_dag = TriggerDagRunOperator( Here is how my TriggerDAGRunOperator is configure def _check_file_version(**context):Ĭontext.xcom_push(key="file_name",value="Load Sales") If File Name is Sales, then trigger 'Load Sales' and like wise for Budget / Contracts. In my master DAG, I have two tasks - (1) Check File Name (2) Trigger appropriate dag based on file name. Say, I have the following dags in my system I am building a parent dag that basically does a conditional trigger of another dag depending on a xcom value.
