From c9ddf821fbd85c70660c7106333722153106b7ba Mon Sep 17 00:00:00 2001 From: Andrew Yuan Date: Wed, 18 Feb 2026 15:31:54 -0800 Subject: [PATCH 1/3] Add note --- standalone-activity/helloworld/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/standalone-activity/helloworld/README.md b/standalone-activity/helloworld/README.md index b60cf4cd..5dc27cac 100644 --- a/standalone-activity/helloworld/README.md +++ b/standalone-activity/helloworld/README.md @@ -1,5 +1,7 @@ This sample demonstrates how to use a Standalone Activity (executing an Activity without wrapping it in a Workflow) +## NOTE: This new feature is not ready for use yet. It will only work once we release a special CLI server for pre-release, once that happens, this README will be updated. + ### Steps to run this sample (with expected output): 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 start it in another terminal; this command is blocking and runs until it receives a SIGINT (Ctrl + C) command.) From d4665be1727a03c6f0c80879752f262387013a5f Mon Sep 17 00:00:00 2001 From: Andrew Yuan Date: Mon, 23 Feb 2026 14:15:33 -0800 Subject: [PATCH 2/3] Add ListActivities and CountActivities to sample --- standalone-activity/helloworld/README.md | 20 +++++++++------ .../helloworld/starter/main.go | 25 +++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/standalone-activity/helloworld/README.md b/standalone-activity/helloworld/README.md index 5dc27cac..42fded64 100644 --- a/standalone-activity/helloworld/README.md +++ b/standalone-activity/helloworld/README.md @@ -1,4 +1,5 @@ -This sample demonstrates how to use a Standalone Activity (executing an Activity without wrapping it in a Workflow) +This sample demonstrates how to use a Standalone Activity (executing an Activity without wrapping it in a Workflow). +It also shows you how to use the `ListActivities` and `CountActivities` APIs. ## NOTE: This new feature is not ready for use yet. It will only work once we release a special CLI server for pre-release, once that happens, this README will be updated. @@ -29,7 +30,6 @@ You should see two console log lines: For example: ```bash 2025/12/22 15:00:15 INFO No logger configured for temporal client. Created default one. - 2025/12/22 15:00:16 INFO Started Worker Namespace default TaskQueue standalone-activity-helloworld WorkerID 82087 ``` @@ -41,13 +41,17 @@ For example: go run standalone-activity/helloworld/starter/main.go ``` -You should see two console log lines: 1) Creating the logger, 2) The standalone activity result +You should see something similar to the following output. For example: ```bash -2026/02/05 11:30:47 INFO No logger configured for temporal client. Created default one. - -2026/02/05 11:30:47 Started standalone activity ActivityID standalone_activity_helloworld_ActivityID RunID 019c2f49-1ff1-7a44-beee-7ff4b36ecc27 - -2026/02/05 11:30:47 Activity result: Hello Temporal! +2026/02/23 14:12:00 INFO No logger configured for temporal client. Created default one. +2026/02/23 14:12:00 Started standalone activity ActivityID standalone_activity_helloworld_ActivityID RunID 019c8c8f-324f-7c06-a92e-a9f7e612ce69 +2026/02/23 14:12:00 Activity result: Hello Temporal! +2026/02/23 14:12:00 ListActivity results +2026/02/23 14:12:00 ActivityID: standalone_activity_helloworld_ActivityID, Type: Activity, Status: Completed +2026/02/23 14:12:00 CountActivities: 1 ``` + +If you run the starter code multiple times, you should see additional `ListActivity` results, as more activites are run. +The same goes for the number of activities from `CountActivities`. diff --git a/standalone-activity/helloworld/starter/main.go b/standalone-activity/helloworld/starter/main.go index df4b0bf3..f19cc7c3 100644 --- a/standalone-activity/helloworld/starter/main.go +++ b/standalone-activity/helloworld/starter/main.go @@ -43,4 +43,29 @@ func main() { log.Fatalln("Unable get standalone activity result", err) } log.Println("Activity result:", result) + + resp, err := c.ListActivities(context.Background(), client.ListActivitiesOptions{ + Query: "TaskQueue = 'standalone-activity-helloworld'", + }) + if err != nil { + log.Fatalln("Unable to list activities", err) + } + + log.Println("ListActivity results") + for info, err := range resp.Results { + if err != nil { + log.Fatalln("Error iterating activities", err) + } + log.Printf("\tActivityID: %s, Type: %s, Status: %v\n", + info.ActivityID, info.ActivityType, info.Status) + } + + resp1, err := c.CountActivities(context.Background(), client.CountActivitiesOptions{ + Query: "TaskQueue = 'standalone-activity-helloworld'", + }) + if err != nil { + log.Fatalln("Unable to count activities", err) + } + + log.Println("Total activities:", resp1.Count) } From 15d8de7dbd1dcdd8dca73af9f4b06f1a0ae444d4 Mon Sep 17 00:00:00 2001 From: Andrew Yuan Date: Tue, 24 Feb 2026 16:18:03 -0800 Subject: [PATCH 3/3] stale "workflow" reference --- standalone-activity/helloworld/starter/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standalone-activity/helloworld/starter/main.go b/standalone-activity/helloworld/starter/main.go index f19cc7c3..958d00ec 100644 --- a/standalone-activity/helloworld/starter/main.go +++ b/standalone-activity/helloworld/starter/main.go @@ -31,7 +31,7 @@ func main() { // Normally we would execute a workflow, but in this case we are executing an activity directly. handle, err := c.ExecuteActivity(context.Background(), activityOptions, helloworld.Activity, "Temporal") if err != nil { - log.Fatalln("Unable to execute workflow", err) + log.Fatalln("Unable to execute activity", err) } log.Println("Started standalone activity", "ActivityID", handle.GetID(), "RunID", handle.GetRunID())