|
1 | | -### Steps to run this sample: |
2 | | -1) Run a [Temporal service](https://github.com/temporalio/samples-go/tree/main/#how-to-use). |
3 | | -2) Run the following command to start the worker |
| 1 | +### Steps to run this sample (with expected output): |
| 2 | +1) Run a [Temporal server](https://github.com/temporalio/samples-go/tree/main/#how-to-use). (If you are going to run locally, you will want to open and run in another terminal as the command is a blocking process that runs until it receives a SIGINT (Ctrl + C) command.) |
| 3 | + |
| 4 | + |
| 5 | +You should see initialization logs, the last will will indicate `workflow successfully started`: |
| 6 | +``` |
| 7 | +{"level":"info","ts":"2025-12-22T14:53:19.673-0500","msg":"workflow successfully started","service":"worker","wf-type":"temporal-sys-history-scanner-workflow","logging-call-at":"/repo/temporal/service/worker/scanner/scanner.go:273"} |
| 8 | +``` |
| 9 | + |
| 10 | +2) Create a new namespace named `default` using this command: |
| 11 | +```bash |
| 12 | +temporal operator namespace create -n default |
| 13 | +``` |
| 14 | + |
| 15 | +To confirm the namespace was created successfully you can run: |
| 16 | + |
| 17 | +```bash |
| 18 | +temporal operator namespace list |
| 19 | +``` |
| 20 | + |
| 21 | +You should see a line with `NamespaceInfo.Name` set to `default`. |
| 22 | + |
| 23 | +3) Open another terminal, and Run the following command to start the worker. The worker is also a blocking process that runs until it receives a SIGINT (Ctrl + C) command.) |
4 | 24 | ``` |
5 | 25 | go run helloworld/worker/main.go |
6 | 26 | ``` |
7 | | -3) Run the following command to start the example |
| 27 | + |
| 28 | +You should see two console log lines about 1) Creating the logger and 2) Starting the Worker with Namespace `default`, and TaskQueue `hello-world` and it will list the WorkerID for the created worker. |
| 29 | + |
| 30 | +For example: |
| 31 | +``` |
| 32 | +2025/12/22 15:00:15 INFO No logger configured for temporal client. Created default one. |
| 33 | +
|
| 34 | +2025/12/22 15:00:16 INFO Started Worker Namespace default TaskQueue hello-world WorkerID 82087 |
| 35 | +``` |
| 36 | + |
| 37 | +4) From your terminal window, Run the following command to start the example |
8 | 38 | ``` |
9 | 39 | go run helloworld/starter/main.go |
10 | 40 | ``` |
| 41 | + |
| 42 | +You should see three console log lines about 1) Creating the logger, 2) Starting the workflow, and 3) The workflow result. |
| 43 | + |
| 44 | +For example: |
| 45 | +``` |
| 46 | +2025/12/22 15:07:24 INFO No logger configured for temporal client. Created default one. |
| 47 | +
|
| 48 | +2025/12/22 15:07:25 Started workflow WorkflowID hello_world_workflowID RunID 019b47ac-7c4d-701f-9d35-3acfe171723e |
| 49 | +
|
| 50 | +2025/12/22 15:07:25 Workflow result: Hello Temporal! |
| 51 | +``` |
0 commit comments