You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Brian Greene <br...@heisenbergwoodworking.com> on 2018/01/26 01:16:01 UTC

how to pass parameters to subdag operator from triggered dag

Good evening,

Here's the setup -

I'm following a "trigger dag -> called(processing) dag" kind of structure.
Then I set timespans, catchups, etc on the triggering dag.  This allows me
to separate the scheduling from the execution, and so far is working great.

The triggered dag uses parameters passed to it to execute.  This has been
easy so far as I've been using python operators and the context from the
operator is passed (including getting at the parameters passed from the
trigger in **kwargs).

Now I'd like to use a subdag operator in the called dag.  I've passed
parameters to a subdag, but only when the parent wasn't "triggered".  Now
I'm in the called DAG, and I'd like access to the parameters from the
trigger to pass to the subdag... and I'm stuck.

I've looked at the subdag operator source code, the trigger operator,
python operator... all trying to find how to get at the context. (perhaps
the wrong word in this case, but it's the idea of the context from the
trigger that I'm after... )

I'm sure I'm missing something simple, and would appreciate any pointers.

Thanks,
Brian