SDK Reference
Python SDK
Cron Workflows

Running Cron Workflows

You can declare a cron schedule by passing on_crons to the hatchet.workflow decorator. For example, to trigger a workflow every 5 minutes, you can do the following:

from hatchet_sdk import Hatchet
 
hatchet = Hatchet()
 
@hatchet.workflow(on_crons=["*/5 * * * *"])
class MyWorkflow:
    @hatchet.step()
    def step1(self, context):
        print("executed step1")
        pass
 
    @hatchet.step(parents=["step1"])
    def step2(self, context):
        print("executed step2")
        pass