Search code examples
airflowairflow-schedulerairflow-2.x

Is there a way to pass a parameter to an airflow dag when triggering it manually


I have an airflow DAG that is triggered externally via cli.

I have a requirement to change order of the execution of tasks based on a Boolean parameter which I would be getting from the CLI.

How do I achieve this?

I understand dag_run.conf can only be used in a template field of an operator.

Thanks in advance.


Solution

  • You can not change tasks dependency with runtime parameter.

    However you can pass runtime parameter (with dag_run.conf) that according to it's value tasks will be executed or be skipped for that you need to place operators in your workflow that can handle this logic for example: ShortCircuitOperator, BranchPythonOperator