FlowsBook a callSign inCreate free accountSign up
AI employees and automation

How to run AI tasks in parallel: every city at once, then one combined answer

Split a big job into one run per city, client or site, let several run at the same time, wait for them, and bring the results back together for a single report.

Part of the guide AI employees

By the xMap team · · 5 min read

To run AI tasks in parallel, you split one big job into the same small job repeated for each city, client or site, start several of those runs at the same time, wait for them to finish, and then combine what they found. In xMap Flows the Run another flow block does this: give it a list, choose how many to run at once (3, 5 or 10), and it starts a run of your other flow for each item, waits, and hands the results back in one piece so an AI step can write a single answer from all of them.

This is for analysts, expansion teams, agencies and anyone whose weekly AI work is really one routine repeated a dozen times. It explains when parallel runs help, how to set them up, a made-up example across Latin America, what comes back, and the limits worth knowing before you rely on it.

When doing them one at a time is the problem

Picture a market research routine that takes a few minutes for one city: search the places, score them, write a short summary. Done for twelve cities one after another, the same routine fills most of a morning, and a slow city holds up every city behind it. Nothing about the cities depends on each other, so there is no reason to wait.

Running them side by side changes the clock, not the work. Each city still gets exactly the same steps and instructions. The difference is that five or ten move at once, and the whole job ends about when the slowest city does.

The two flows involved

Parallel work in xMap Flows always uses two flows, which keeps each of them simple:

  • The worker flow does the job for one item. It starts with a From another flow start, so it takes in one city (or client, or site) and runs its steps on it. It is an ordinary flow that you can test on its own.
  • The coordinator flow holds the list and a Run another flow block set to Once per item. Under At the same time you choose One at a time, or 3, 5 or 10 at once.

If the worker flow has no way in yet, the button Let it take items from other flows, under the flow picker, adds the start for you. Because the worker is its own flow, changing its instructions changes every city's run at once, and other coordinators can use it too.

A worked example across eight cities (made up)

Say a coffee chain's expansion team in Mexico City wants a Monday read on eight cities it is weighing: Mexico City, Bogota, Lima, Santiago, Buenos Aires, Sao Paulo, Montevideo and Quito.

  1. The worker flow: From another flow start, then an Area of interest that reads the city from the item as {{city}}, then Nearby places for coffee shops, then an xMap LLM working on the whole list that writes a short summary: how crowded the market looks, chains against independents, and gaps worth a visit.
  2. The coordinator: a Schedule every Monday at 06:00, then My data with a table of the eight cities, one row each.
  3. Run another flow: the worker, Once per item, 5 at the same time, Wait for them up to 15 minutes, and Bring back One item for each run, with its report.
  4. xMap LLM on the whole list reads the eight reports together and writes one comparison: which cities look most open, which most crowded, and what to check next.
  5. Make a report turns it into a PDF for the expansion committee.

On Monday the first five cities start together; as each finishes, the next waits its turn until all eight are done. The coordinator carries on by itself once they end, even with nobody watching, and the committee's report is in the inbox before the team arrives.

What comes back, and how to combine it

Bring back decides the shape of what returns, and each suits a different last step:

  • Every item they found, each marked with the item it ran for in for_item. Use it to build one map or one sheet of every place across every city.
  • One item for each run, with its report: for_item, run_status, items_found and report. The best input for an AI step that compares the runs.
  • Only the reports, joined into one: a single item holding every run's report under the name of its city, ready to email as it is.

A run that did not finish in time comes back marked late, and one that was not run says why. The coordinator does not fail because one city did; the step says how many passed.

Limits to plan around

  • Up to 100 items a run at the same time; one at a time handles up to 25 a run, carrying on in parts when it needs more time.
  • Only real runs start other flows. A test run of the coordinator says what it would do, such as running the worker once for each of 8 items, so test the worker on its own first.
  • Each run gets its share of what the coordinator has left to spend. When the credits do not cover every item, only the covered ones run and the others say why.
  • The worker cannot contain a Wait or an Approval: nothing would carry its result back. Flows can call flows three levels deep, and a private worker must have the same owner as the coordinator.
  • When some runs fail, Retry the failed runs in the run panel starts only those, not the whole list.

Other jobs that split well

The same pattern fits any list whose items do not depend on each other: a site report for every store added to a table, one enrichment pass per client for an agency, a competitor check for each franchise territory, or a hiring scan in each city a recruiter covers. Whenever you notice you are building the same flow again with a different city in it, a worker flow and a coordinator is usually the better shape. The guide to workflow automation covers how flows connect and hand work to each other.

Questions

Is running in parallel more expensive than one at a time?

No. Each run does the same steps either way; running them side by side only changes how long the whole job takes.

What if one city takes much longer than the others?

The coordinator waits up to the time you set, 5 minutes, 15 minutes or an hour. A run not finished by then comes back marked late and the rest carry on.

Can I see each city's run on its own?

Yes. Every run of the worker flow is a run of its own, in its own history, linked from the coordinator's step, and the run panel shows how many are done while they work.

Do I need two flows for this?

Yes: one that does the job for a single item, and one that holds the list and starts them. It keeps the worker easy to test and to reuse from other flows.

Templates that do this

Read next

More on ai employees and automation · Every article · Templates

Put it to work

An AI employee in xMap Flows does this on live data, on its own timetable. Start from a template or describe it in plain words.