Hi I have `main` flow, which calls to a subflow `...
# prefect-community
a
Hi I have
main
flow, which calls to a subflow
go_eat
, each time with different parameters. something of the sort:
Copy code
@flow
def go_eat():
    ...

@flow
def main():
    animals = ['dog', 'cat', 'monkey']
    for animal in animals:
        go_eat(animal)
I want to make those
go_eat
flows to run in parallel, and I wonder how to implement this. it would be best if I could make up to 2 animals to
go_eat
in parallel, but no more than that. I'm not sure if I somehow better use the prefect queue concurrency mechanism, or if I better implement this in pure python. any suggestions?
1
m
Maybe pure python can resolve your problem
t
Hi Asaf, It may also be worth checking out this discorse post on triggering flow runs using prefect client. https://discourse.prefect.io/t/how-to-create-a-flow-run-from-deployment-orchestrator-pattern/803
👍 1
a
if you turn go_eat to a task, you can leverage mapping for parallel execution
💡 1
👍 1