blob: dd51724053906d10bee58d096faf7736fc541022 [file] [log] [blame]
:py:mod:`airflow.operators.trigger_dagrun`
==========================================
.. py:module:: airflow.operators.trigger_dagrun
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.operators.trigger_dagrun.TriggerDagRunLink
airflow.operators.trigger_dagrun.TriggerDagRunOperator
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.operators.trigger_dagrun.XCOM_EXECUTION_DATE_ISO
airflow.operators.trigger_dagrun.XCOM_RUN_ID
.. py:data:: XCOM_EXECUTION_DATE_ISO
:annotation: = trigger_execution_date_iso
.. py:data:: XCOM_RUN_ID
:annotation: = trigger_run_id
.. py:class:: TriggerDagRunLink
Bases: :py:obj:`airflow.models.baseoperator.BaseOperatorLink`
Operator link for TriggerDagRunOperator. It allows users to access
DAG triggered by task using TriggerDagRunOperator.
.. py:attribute:: name
:annotation: = Triggered DAG
.. py:method:: get_link(operator, *, ti_key)
Link to external system.
Note: The old signature of this function was ``(self, operator, dttm: datetime)``. That is still
supported at runtime but is deprecated.
:param operator: The Airflow operator object this link is associated to.
:param ti_key: TaskInstance ID to return link for.
:return: link to external system
.. py:class:: TriggerDagRunOperator(*, trigger_dag_id, trigger_run_id = None, conf = None, execution_date = None, reset_dag_run = False, wait_for_completion = False, poke_interval = 60, allowed_states = None, failed_states = None, **kwargs)
Bases: :py:obj:`airflow.models.baseoperator.BaseOperator`
Triggers a DAG run for a specified ``dag_id``
:param trigger_dag_id: The dag_id to trigger (templated).
:param trigger_run_id: The run ID to use for the triggered DAG run (templated).
If not provided, a run ID will be automatically generated.
:param conf: Configuration for the DAG run (templated).
:param execution_date: Execution date for the dag (templated).
:param reset_dag_run: Whether or not clear existing dag run if already exists.
This is useful when backfill or rerun an existing dag run.
When reset_dag_run=False and dag run exists, DagRunAlreadyExists will be raised.
When reset_dag_run=True and dag run exists, existing dag run will be cleared to rerun.
:param wait_for_completion: Whether or not wait for dag run completion. (default: False)
:param poke_interval: Poke interval to check dag run status when wait_for_completion=True.
(default: 60)
:param allowed_states: List of allowed states, default is ``['success']``.
:param failed_states: List of failed or dis-allowed states, default is ``None``.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['trigger_dag_id', 'trigger_run_id', 'execution_date', 'conf']
.. py:attribute:: template_fields_renderers
.. py:attribute:: ui_color
:annotation: = #ffefeb
.. py:attribute:: operator_extra_links
.. py:method:: execute(context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.