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.

Bulk runs are also available as aio_run_many and its blocking variant run_many on the Workflow object. Pass wait_for_result=False to either one to enqueue the runs and get back run references instead of waiting for the results.

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 November 23, 2026

On this page