We use cookies

We use cookies and similar technologies for analytics and marketing. You can allow these cookies or continue with only essential cookies.

By clicking "Accept", you agree to our use of cookies.
Learn more.

Running Tasks in Bulk

Often you may want to run a task multiple times with different inputs. There is significant overhead (i.e. network roundtrips) to write the task, so if you're running multiple tasks, it's best to use the bulk run methods.

You can use the aio_run_many method to bulk run a task. This will return a list of results.

greetings = ["Hello, World!", "Hello, Moon!", "Hello, Mars!"]results = await child_task.aio_run_many(    [        # run each greeting as a task in parallel        child_task.create_bulk_run_item(            input=SimpleInput(message=greeting),        )        for greeting in greetings    ])# this will await all results and return a list of resultsprint(results)

Workflow.create_bulk_run_item is a typed helper to create the inputs for each task.

There are additional bulk methods available on the Workflow object.

  • aio_run_many
  • aio_run_many_no_wait

And blocking variants:

  • run_many
  • run_many_no_wait

As with the run methods, you can call bulk methods from within a task and the runs will be associated with the parent task in the dashboard.

Last updated on August 11, 2026

On this page