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

22 lines
373 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()