Hatchet Cloud Quickstart
Welcome to Hatchet! This guide walks you through getting set up on Hatchet Cloud. If you'd like to self-host Hatchet, please see the self-hosted quickstart instead.
Quickstart
Sign up
If you haven't already signed up for Hatchet Cloud, please register here (opens in a new tab).
Set up your tenant
In Hatchet Cloud, you'll be shown a screen to create your first tenant. A tenant is a logical separation of your environments (e.g. dev
, staging
, production
). Each tenant has its own set of users who can access it.
After creating your tenant, navigate to your Hatchet dashboard and navigate to your settings tab. You should see a section called "API Keys". Click "Create API Key", input a name for the key and copy the key. Place the following in a .env
file:
HATCHET_CLIENT_TOKEN="<your-api-key>"
Run your first worker
Make sure you have the following dependencies installed:
pip install python-dotenv
pip install hatchet-sdk
We are using python-dotenv
(opens in a new tab) to load the environment variables from a .env
file. This isn't required, and you can use your own method to load environment variables.
Create a worker.py
file with the following contents:
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
Run your first workflow
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:
You can now trigger your first workflow by navigating to the Workflows
tab, selecting your workflow, and clicking the top right "Trigger workflow" button:
That's it! You've successfully deployed Hatchet and run your first workflow.
Next Steps
Check out the SDK-specific documentation for more guides on how to integrate with your runtime: