This directory will host ports of the most expressive Temporal Go samples rewritten with the sdk ergonomics.
Each port will highlight how the actor-centric API removes boilerplate, improves safety, or simplifies deployment compared to the raw Go SDK.
We will work through the following high-impact scenarios first:
- DSL Workflow (
dsl) - File Processing (
fileprocessing) - Expense Request (
expense) - Saga Pattern (
saga) - Request/Response with Updates (
reqrespupdate) - Worker Versioning (
worker-versioning) - Workflow Updates (
update) - Nexus Interop (
nexus) - Codec Server (
codec-server) - Particle Swarm Optimization (
pso) - Durable Cron (
cron) - Await Signals (
await-signals) - Timer Notification (
timer) - Mutex Locking (
mutex) - Polling Strategies (
polling)
Additional SDK examples from the sdk/examples directory now live under examples/:
control, greeter, hello-system, orders, spawn, telegram, and ticketing.
Each sample will include:
- A self-contained implementation inside
samples-sdk/<sample-name>. - Documentation comparing the new SDK usage to the original Temporal sample.
- Tests or scripts that prove the scenario end-to-end.
Progress will be tracked by checking the boxes above as ports land.
Use the bundled docker-compose.yml to boot a Temporal cluster with Postgres, Admin Tools, and the UI:
docker compose up -d db temporal temporal-admin-tools temporal-ui- Frontend:
localhost:7233(samples target this address by default) - UI:
http://localhost:7234 - Admin tools:
docker compose run --rm temporal-admin-tools tctl --ns default workflow list
The compose file uses the default Temporal namespace (default) so every sample and example works without extra configuration. If you want to override the target, set TEMPORAL_ADDRESS (for example export TEMPORAL_ADDRESS=localhost:7233) before running a sample.
- Start the Temporal stack as above.
- From a sample directory, run
go test ./...or the sample-specific runner script (see eachREADMEundersamples-sdk/<sample>). - Use the Temporal UI or
tctlfrom Admin Tools to observe workflow state under thedefaultnamespace.
Every sample and example has a compose service that runs its test suite against the mounted repo using the golang:1.23 image and the shared Temporal stack. Examples:
- Single sample:
docker compose up -d sample-dsl - Single example:
docker compose up -d example-orders - Entire suite:
docker compose up -d samples-all - Inspect output:
docker compose logs -f sample-dsl
The services reuse ./.cache for Go build/module caches and default to TEMPORAL_ADDRESS=temporal:7233 with the default namespace, so no extra wiring is needed.
Use bootstrap.RegisterSamples with runtime.WorkerSet to register every actor, including the DSL branch worker and the Nexus handler queue, in one place. Worker versioning defaults to the auto-upgrade V2 build and the pinned V1 build; override them with options if you want a different rollout.
package main
import (
"context"
"log"
"os"
"os/signal"
"syscall"
"github.com/tactors/samples-sdk/bootstrap"
"github.com/tactors/sdk/runtime"
"go.temporal.io/sdk/client"
)
func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
cli, err := client.Dial(client.Options{
HostPort: getenv("TEMPORAL_ADDRESS", "localhost:7233"),
Namespace: getenv("TEMPORAL_NAMESPACE", "default"),
DataConverter: runtime.DataConverter(),
})
if err != nil {
log.Fatalf("dial temporal: %v", err)
}
set := runtime.NewWorkerSet(cli)
regs, err := bootstrap.RegisterSamples(set)
if err != nil {
log.Fatalf("register samples: %v", err)
}
log.Printf("workers ready: %+v", regs)
if err := set.StartAll(ctx); err != nil {
log.Fatalf("start workers: %v", err)
}
<-ctx.Done()
}
func getenv(key, fallback string) string {
if val := os.Getenv(key); val != "" {
return val
}
return fallback
}For the worker-versioning sample, swap builds by passing bootstrap.WithAutoUpgradeWorker(workerversioning.AutoUpgradeWorkerV1()) or bootstrap.WithPinnedWorker(workerversioning.PinnedWorkerV2()) when calling RegisterSamples.
- Temporal product docs: https://docs.temporal.io
- Temporal CLI (tctl) reference: https://docs.temporal.io/reference/tctl/
- Samples source for comparison:
samples-temporal/<sample>