Files
hatchet/sdks/python/examples/simple/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

22 lines
379 B
Python

# ❓ Simple
from hatchet_sdk import Context, EmptyModel, Hatchet
hatchet = Hatchet(debug=True)
@hatchet.task(name="SimpleWorkflow")
def step1(input: EmptyModel, ctx: Context) -> None:
print("executed step1")
def main() -> None:
worker = hatchet.worker("test-worker", slots=1, workflows=[step1])
worker.start()
# ‼️
if __name__ == "__main__":
main()