title: Airflow DAG Task Dependency in a Loop
body: <p>I have a DAG that needs to recompile this customer lists in various brands.   The script is called with two arguments brand and listtype.</p>
  <p>I need the brands to run concurrently, but the list types to be dependent on the preceding list type, but I can't figure out how to do that in a loop.  Can ya'll help me out?</p>
  <pre><code>BrandsToRun = ['A', 'B', 'C']
  ListTypes = ['1', '2', '3']
  
  # Defining the DAG
  ################################################################################
  with DAG(
          'MusterMaster',
          default_args = default_args,
          description = 'x',        
          # schedule_interval = None
          schedule_interval = '30 4 * * *',
          catchup = False
          ) as MusterMaster:
  
          for Brand in BrandsToRun:
              for ListType in ListTypes:
  
                  ListLoad = BashOperator(
                                          task_id='Load_'+str(Brand)+'_'+str(ListType),
                                          bash_command = &quot;&quot;&quot;python3 '/usr/local/bin/MusterMaster.py' {0} {1}&quot;&quot;&quot;.format(Brand[0], ListType[0]),
                                          pool='logs'
                                          )
  
  ListLoad
  
  </code></pre>
  <p>I want the tasks to have dependency structure like this, but I can't figure it out.   Brand should run concurrently, but ListTypes should be dependent on the preceding ListType.</p>
  <p>Muster A 1 &gt;&gt; Muster A 2 &gt;&gt; Muster A 3</p>
  <p>Muster B 1 &gt;&gt; Muster B 2 &gt;&gt; Muster B 3</p>
  <p>Muster C 1 &gt;&gt; Muster C 2 &gt;&gt; Muster C 3</p>
  <p>How can I best accomplish this?</p>