Files
hatchet/sdks/python/examples/events/worker.py
Matt Kaye 5062bf1e3e V1 SDKs and Docs (#1361)
New SDKs and docs for the v1 release.
2025-03-25 15:45:07 -07:00

13 lines
291 B
Python

from hatchet_sdk import Context, EmptyModel, Hatchet
hatchet = Hatchet()
# ❓ Event trigger
event_workflow = hatchet.workflow(name="EventWorkflow", on_events=["user:create"])
# ‼️
@event_workflow.task()
def task(input: EmptyModel, ctx: Context) -> None:
print("event received")