# README
Hello Temporal | Golang Docker
This is a simple project showcasing the integration of Temporal and Golang within a Docker environment. The project consists of a basic "Hello" application that utilizes Temporal for workflow orchestration.
-
Temporal Dashboard
-
Temporal + Go + Docker = Output
Workflow of temporal
- Start the server
- Define a task(queue) with name
- Execute a workflow and push it to the queue
- Start worker.go file(contains all the registration of workflow and activity)
- Still now the task state is running
- Now worker.go, starts executing all workflow in the given queue like a queue conusmer
- And updates the state in temporal dashboard as "completed" or "failed" according to the execution
How the code executes
- We define the code for the workflow in the project
- Then we start the temporal, connect to temporal server with the specific queue name
- Then execute the workflow in the starter
- Optionally wait for the workflow to complete and give the expected result
- Then worker.go comes, here again we connect worker to temporal
- And register all the workflows and activities
- At last run the worker which then executes Workflow
- Generally worker is made to run first as, we create workflow and it gets connected in parallel
Prerequisites
Make sure you have the following installed on your system:
- Docker
- Go (Golang)
- Temporal Server (Docker Compose is used in this example)
Getting Started
-
Clone this repository:
git clone https://github.com/swarajkumarsingh/hello-temporal-go.git cd hello-temporal-go
-
Start the Temporal Server:
git clone https://github.com/temporalio/docker-compose.git cd docker-compose docker compose up
-
Run the Worker
make start_worker
-
Run the Starter
make start_starter
Usage
- The Hello application will start and execute a simple Temporal workflow, printing "Hello, Temporal!".
Stopping the Environment
To stop the Temporal Server and clean up the environment, run:
docker-compose down
Contributing
If you find any issues or have improvements, feel free to open an issue or submit a pull request. Contributions are welcome!
License
This project is licensed under the MIT License - see the LICENSE file for details.