Files
hatchet/examples/python/bulk_fanout/bulk_trigger.py
Gabe Ruttner 8e80faf2d6 Fe overhaul docs (#1640)
* api changes

* doc changes

* move docs

* generated

* generate

* pkg

* backmerge main

* revert to main

* revert main

* race?

* remove go tests
2025-04-30 14:10:09 -07:00

32 lines
763 B
Python

import asyncio
from examples.bulk_fanout.worker import ParentInput, bulk_parent_wf
from hatchet_sdk import Hatchet
from hatchet_sdk.clients.admin import TriggerWorkflowOptions
hatchet = Hatchet()
async def main() -> None:
results = bulk_parent_wf.run_many(
workflows=[
bulk_parent_wf.create_bulk_run_item(
input=ParentInput(n=i),
options=TriggerWorkflowOptions(
additional_metadata={
"bulk-trigger": i,
"hello-{i}": "earth-{i}",
}
),
)
for i in range(20)
],
)
for result in results:
print(result)
if __name__ == "__main__":
asyncio.run(main())