Pattern is useful when you want to trigger many copies of the same DAG with different parameters.
This dag is run on a schedule, fetches the appropriate configurations needed and then triggers the external DAG as a configuration.
There is a final "wait" step that is optional that simply ensures there is a blocking step at the end of the submissions to ensure that
concurrency is kept at "1" for the parameterized DAG. This pattern uses the dynamic task mapping paradigm to determine how many external
dags should be triggered during execution. As a general note, the generate_list
task could be replaced with any operator even ones that
use external service calls to determine if a specific configuration should be run at this execution cycle.
A thin wrapper around the TriggerDagRun operator that allows us to take a iterable of dicts and split it out between multiple args needed by the base TriggerDagRun operator.
This is the DAG that actually does the work. It takes a config dictionary in and uses the arguements in that dictionary to change the marginal behavior of called operators. It should not be scheduled, but does need to be activated, in order to function.