User Guide
Quick Start
Running your first Step

Running your first Step

After completing your installation and setup, create a worker.py file with the following contents:

worker.py
from hatchet_sdk import Hatchet
from dotenv import load_dotenv
 
load_dotenv()
 
hatchet = Hatchet(debug=True)
 
@hatchet.workflow(name="first-python-workflow",on_events=["user:create"])
class MyWorkflow:
    @hatchet.step()
    def step1(self, context):
        return {
            "result": "success"
        }
 
worker = hatchet.worker('first-worker')
worker.register_workflow(MyWorkflow())
 
worker.start()

Open a new terminal and start the worker with:

python3 worker.py

The worker is now running and listening for steps to execute. You should see your first worker registered in the Workers tab of the Hatchet dashboard:

Quickstart 1

You can now trigger this workflow by clicking the top right "Trigger workflow" button when viewing the workflow:

Quickstart 2

There are multiple ways you can interact with Hatchet workflows:

  • Trigger workflows from your existing APIs
  • Trigger workflows from the dashboard
  • Replay steps in workflows from the dashboard

Next Steps

Now that you have your first workflow running, you can start to build more complex workflows and integrate them into your existing systems. Check out the language-specific SDKs for more information on how to build workflows.