Files
hatchet/examples/go/quickstart
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
..
2025-04-30 14:10:09 -07:00
2025-04-30 14:10:09 -07:00
2025-04-30 14:10:09 -07:00
2025-04-30 14:10:09 -07:00

Hatchet First Workflow Example

This is an example project demonstrating how to use Hatchet with Go. For detailed setup instructions, see the Hatchet Setup Guide.

Prerequisites

Before running this project, make sure you have the following:

  1. Go v1.22 or higher

Setup

  1. Clone the repository:
git clone https://github.com/hatchet-dev/hatchet-go-quickstart.git
cd hatchet-go-quickstart
  1. Set the required environment variable HATCHET_CLIENT_TOKEN created in the Getting Started Guide.
export HATCHET_CLIENT_TOKEN=<token>

Note: If you're self hosting you may need to set HATCHET_CLIENT_TLS_STRATEGY=none to disable TLS

  1. Install the project dependencies:
go mod tidy

Running an example

  1. Start a Hatchet worker:
go run cmd/worker/main.go
  1. In a new terminal, run the example task:
go run cmd/run/main.go

This will trigger the task on the worker running in the first terminal and print the output to the second terminal.