title: Proper way to create dynamic workflows in Airflow
body: <h2>Problem</h2>
  
  <p>Is there any way in Airflow to create a workflow such that the number of tasks B.* is unknown until completion of Task A? I have looked at subdags but it looks like it can only work with a static set of tasks that have to be determined at Dag creation.</p>
  
  <p>Would dag triggers work? And if so could you please provide an example.</p>
  
  <p>I have an issue where it is impossible to know the number of task B's that will be needed to calculate Task C until Task A has been completed. Each Task B.* will take several hours to compute and cannot be combined.</p>
  
  <pre><code>              |---&gt; Task B.1 --|
                |---&gt; Task B.2 --|
   Task A ------|---&gt; Task B.3 --|-----&gt; Task C
                |       ....     |
                |---&gt; Task B.N --|
  </code></pre>
  
  <h2>Idea #1</h2>
  
  <p>I don't like this solution because I have to create a blocking ExternalTaskSensor and all the Task B.* will take between 2-24 hours to complete. So I do not consider this a viable solution. Surely there is an easier way? Or was Airflow not designed for this?</p>
  
  <pre><code>Dag 1
  Task A -&gt; TriggerDagRunOperator(Dag 2) -&gt; ExternalTaskSensor(Dag 2, Task Dummy B) -&gt; Task C
  
  Dag 2 (Dynamically created DAG though python_callable in TriggerDagrunOperator)
                 |-- Task B.1 --|
                 |-- Task B.2 --|
  Task Dummy A --|-- Task B.3 --|-----&gt; Task Dummy B
                 |     ....     |
                 |-- Task B.N --|
  </code></pre>
  
  <h2>Edit 1:</h2>
  
  <p><strong>As of now this question still does not have a great answer</strong>. I have been contacted by several people looking for a solution. </p>