title: How to chain a Celery task that returns a list into a group?
body: <p>I want to create a group from a list returned by a Celery task, so that for each item in the task result set, one task will be added to the group.</p>
  
  <p>Here's a simple code example to explain the use case. The <code>???</code> should be the result from the previous task.</p>
  
  <pre><code>@celery.task
  def get_list(amount):
      # In reality, fetch a list of items from a db
      return [i for i in range(amount)]
  
  @celery.task
  def process_item(item):
      #do stuff
      pass
  
  process_list = (get_list.s(10) | group(process_item.s(i) for i in ???))
  </code></pre>
  
  <p>I'm probably not approaching this correctly, but I'm pretty sure it's not safe to call tasks from within tasks:</p>
  
  <pre><code>@celery.task
  def process_list():
      for i in get_list.delay().get():
          process_item.delay(i)
  </code></pre>
  
  <p>I don't need the result from the seconds task.</p>