# taonic/my-samples-go architecture

> Architecture diagram of the GitHub repository taonic/my-samples-go, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/taonic/my-samples-go
- Repository: https://github.com/taonic/my-samples-go

## Overview

This repository is a collection of independently runnable Temporal Go SDK examples, not one integrated application. The common user workflow is to choose and run a sample, which connects to Temporal to demonstrate a workflow pattern, operational capability, or integration. The graph groups the examples by purpose and retains the README’s major capabilities that have corresponding paths in the supplied tree. Some source files were not sampled; their internal call relationships are omitted unless the index or README supports them.

Main entry points: [`mutex_queue/starter/main.go`](https://github.com/taonic/my-samples-go/blob/main/mutex_queue/starter/main.go) (Mutex starter), [`event_stream/starter/main.go`](https://github.com/taonic/my-samples-go/blob/main/event_stream/starter/main.go) (Event stream starter), [`channels/main.go`](https://github.com/taonic/my-samples-go/blob/main/channels/main.go) (Workflow channels), [`concurrent_cancel/workflow.go`](https://github.com/taonic/my-samples-go/blob/main/concurrent_cancel/workflow.go) (Concurrent cancellation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patterns["Workflow patterns"]
  node_channels["Workflow channels<br/>[main.go]"]
  node_cancel["Concurrent cancellation<br/>[workflow.go]"]
  node_fifo["FIFO signals<br/>[main.go]"]
  node_mutex["Distributed mutex queue<br/>[mutex_workflow.go]"]
  node_mutex_starter["Mutex starter<br/>[main.go]"]
  node_event["Event stream workflow<br/>[workflow.go]"]
  node_event_starter["Event stream starter<br/>[main.go]"]
  node_proxied["Proxied activities<br/>[workflows.go]"]
  node_qps["QPS sampling<br/>[qps_workflow.go]"]
  node_hello["Hello workflows<br/>[hello_workflow.go]"]
end

subgraph group_operations["Workflow operations"]
  node_bench["Concurrent workflow benchmark<br/>[main.go]"]
  node_cpu["CPU-intensive activities<br/>[main.go]"]
  node_limits["Activity concurrency limits<br/>[main.go]"]
  node_deadlock["Deadlock prevention<br/>[main.go]"]
  node_detection["Deadlock detection<br/>[main.go]"]
  node_list_wf["List workflows<br/>[main.go]"]
  node_schedule_query["Query schedules<br/>[main.go]"]
  node_schedule_search["Schedules by workflows<br/>[main.go]"]
  node_schedule_rps["Schedule update throughput<br/>[main.go]"]
  node_health["Worker health check<br/>[main.go]"]
end

subgraph group_integrations["Integrations and telemetry"]
  node_cloud["Temporal Cloud usage<br/>[main.go]"]
  node_mtls["mTLS history retrieval<br/>[helloworld.go]"]
  node_otel["OpenTelemetry tracing<br/>[opentelemetry.go]"]
  node_otlp["OTLP metrics<br/>[metrics.go]"]
  node_prom["Prometheus metrics<br/>[prom.go]"]
end

subgraph group_utilities["History and concurrency"]
  node_history["Read event history<br/>[main.go]"]
  node_protobuf["Parse exported history<br/>[main.go]"]
  node_replay["Versioned replay markers<br/>[main.go]"]
  node_race_context["Race context<br/>[main.go]"]
  node_race_query["Race-safe queries<br/>[main.go]"]
  node_race_timer["Race timer activity<br/>[main.go]"]
  node_timeout["Timeout interceptor<br/>[main.go]"]
end

node_user(("Sample user"))
node_temporal{{"Temporal service"}}

node_user -->|"runs sample"| node_channels
node_user -->|"runs sample"| node_cancel
node_user -->|"runs sample"| node_fifo
node_user -->|"runs sample"| node_mutex_starter
node_user -->|"runs sample"| node_event_starter
node_user -->|"runs sample"| node_proxied
node_user -->|"runs sample"| node_qps
node_user -->|"runs sample"| node_bench
node_user -->|"runs sample"| node_cpu
node_user -->|"runs sample"| node_limits
node_user -->|"runs sample"| node_deadlock
node_user -->|"runs sample"| node_detection
node_user -->|"runs sample"| node_list_wf
node_user -->|"runs sample"| node_schedule_query
node_user -->|"runs sample"| node_schedule_search
node_user -->|"runs sample"| node_schedule_rps
node_user -->|"runs sample"| node_cloud
node_user -->|"runs sample"| node_mtls
node_user -->|"runs sample"| node_otel
node_user -->|"runs sample"| node_otlp
node_user -->|"runs sample"| node_history
node_user -->|"runs sample"| node_protobuf
node_user -->|"runs sample"| node_replay
node_user -->|"runs sample"| node_race_context
node_user -->|"runs sample"| node_race_query
node_user -->|"runs sample"| node_race_timer
node_user -->|"runs sample"| node_timeout
node_user -->|"runs sample"| node_health
node_mutex_starter -->|"starts workflow"| node_mutex
node_event_starter -->|"starts workflow"| node_event
node_qps -->|"starts workflows"| node_hello
node_bench -->|"starts executions"| node_temporal
node_channels -.->|"uses SDK"| node_temporal
node_cancel -.->|"uses SDK"| node_temporal
node_fifo -.->|"uses SDK"| node_temporal
node_mutex_starter -->|"starts executions"| node_temporal
node_event_starter -->|"starts execution"| node_temporal
node_list_wf -->|"lists executions"| node_temporal
node_schedule_query -->|"queries schedules"| node_temporal
node_schedule_search -->|"queries schedules"| node_temporal
node_schedule_rps -->|"updates schedules"| node_temporal
node_cloud -.->|"uses Cloud API"| node_temporal
node_mtls -.->|"retrieves history"| node_temporal
node_otel -.->|"traces workflows"| node_temporal
node_otlp -.->|"exports metrics"| node_temporal
node_prom -.->|"exports metrics"| node_temporal
node_history -.->|"reads history"| node_temporal
node_protobuf -->|"decodes export"| node_temporal

click node_channels "https://github.com/taonic/my-samples-go/blob/main/channels/main.go"
click node_cancel "https://github.com/taonic/my-samples-go/blob/main/concurrent_cancel/workflow.go"
click node_fifo "https://github.com/taonic/my-samples-go/blob/main/fifo_signals/main.go"
click node_mutex "https://github.com/taonic/my-samples-go/blob/main/mutex_queue/mutex_workflow.go"
click node_mutex_starter "https://github.com/taonic/my-samples-go/blob/main/mutex_queue/starter/main.go"
click node_event "https://github.com/taonic/my-samples-go/blob/main/event_stream/workflow.go"
click node_event_starter "https://github.com/taonic/my-samples-go/blob/main/event_stream/starter/main.go"
click node_proxied "https://github.com/taonic/my-samples-go/blob/main/proxied_activities/workflows.go"
click node_qps "https://github.com/taonic/my-samples-go/blob/main/qps-sampling/qps_workflow.go"
click node_hello "https://github.com/taonic/my-samples-go/blob/main/qps-sampling/hello_workflow.go"
click node_bench "https://github.com/taonic/my-samples-go/blob/main/bench_concurrent_workflow/main.go"
click node_cpu "https://github.com/taonic/my-samples-go/blob/main/cpu_intensive/main.go"
click node_limits "https://github.com/taonic/my-samples-go/blob/main/max_concurrent_activities/main.go"
click node_deadlock "https://github.com/taonic/my-samples-go/blob/main/deadlock/main.go"
click node_detection "https://github.com/taonic/my-samples-go/blob/main/deadlock_detection/main.go"
click node_list_wf "https://github.com/taonic/my-samples-go/blob/main/list_workflows/main.go"
click node_schedule_query "https://github.com/taonic/my-samples-go/blob/main/list_schedules_with_query/main.go"
click node_schedule_search "https://github.com/taonic/my-samples-go/blob/main/query_schedules_by_workflows/main.go"
click node_schedule_rps "https://github.com/taonic/my-samples-go/blob/main/schedule_update_rps/main.go"
click node_cloud "https://github.com/taonic/my-samples-go/blob/main/cloud-api/getusage/main.go"
click node_mtls "https://github.com/taonic/my-samples-go/blob/main/gethistorymtls/helloworld.go"
click node_otel "https://github.com/taonic/my-samples-go/blob/main/opentelemetry/opentelemetry.go"
click node_otlp "https://github.com/taonic/my-samples-go/blob/main/otlpmetrics/metrics.go"
click node_prom "https://github.com/taonic/my-samples-go/blob/main/lib/prom.go"
click node_history "https://github.com/taonic/my-samples-go/blob/main/read_event_history/main.go"
click node_protobuf "https://github.com/taonic/my-samples-go/blob/main/parse_export_protobuf/main.go"
click node_replay "https://github.com/taonic/my-samples-go/blob/main/replay_with_version_and_marker/main.go"
click node_race_context "https://github.com/taonic/my-samples-go/blob/main/race_context/main.go"
click node_race_query "https://github.com/taonic/my-samples-go/blob/main/race-query/main.go"
click node_race_timer "https://github.com/taonic/my-samples-go/blob/main/race_timer_activity/main.go"
click node_timeout "https://github.com/taonic/my-samples-go/blob/main/timeout_interceptor/main.go"
click node_health "https://github.com/taonic/my-samples-go/blob/main/healthcheck/main.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_channels,node_cancel,node_fifo,node_mutex,node_mutex_starter,node_event,node_event_starter,node_proxied,node_qps,node_hello,node_user toneBlue
class node_bench,node_cpu,node_limits,node_deadlock,node_detection,node_list_wf,node_schedule_query,node_schedule_search,node_schedule_rps,node_health toneAmber
class node_cloud,node_mtls,node_otel,node_otlp,node_prom toneMint
class node_history,node_protobuf,node_replay,node_race_context,node_race_query,node_race_timer,node_timeout toneRose
class node_temporal toneIndigo
```

## Components

### Workflow patterns

- [Workflow channels](https://github.com/taonic/my-samples-go/blob/main/channels/main.go): `channels/main.go`
- [Concurrent cancellation](https://github.com/taonic/my-samples-go/blob/main/concurrent_cancel/workflow.go): `concurrent_cancel/workflow.go`
- [FIFO signals](https://github.com/taonic/my-samples-go/blob/main/fifo_signals/main.go): `fifo_signals/main.go`
- [Distributed mutex queue](https://github.com/taonic/my-samples-go/blob/main/mutex_queue/mutex_workflow.go): `mutex_queue/mutex_workflow.go`
- [Mutex starter](https://github.com/taonic/my-samples-go/blob/main/mutex_queue/starter/main.go): `mutex_queue/starter/main.go`
- [Event stream workflow](https://github.com/taonic/my-samples-go/blob/main/event_stream/workflow.go): `event_stream/workflow.go`
- [Event stream starter](https://github.com/taonic/my-samples-go/blob/main/event_stream/starter/main.go): `event_stream/starter/main.go`
- [Proxied activities](https://github.com/taonic/my-samples-go/blob/main/proxied_activities/workflows.go): `proxied_activities/workflows.go`
- [QPS sampling](https://github.com/taonic/my-samples-go/blob/main/qps-sampling/qps_workflow.go): `qps-sampling/qps_workflow.go`
- [Hello workflows](https://github.com/taonic/my-samples-go/blob/main/qps-sampling/hello_workflow.go): `qps-sampling/hello_workflow.go`

### Workflow operations

- [Concurrent workflow benchmark](https://github.com/taonic/my-samples-go/blob/main/bench_concurrent_workflow/main.go): `bench_concurrent_workflow/main.go`
- [CPU-intensive activities](https://github.com/taonic/my-samples-go/blob/main/cpu_intensive/main.go): `cpu_intensive/main.go`
- [Activity concurrency limits](https://github.com/taonic/my-samples-go/blob/main/max_concurrent_activities/main.go): `max_concurrent_activities/main.go`
- [Deadlock prevention](https://github.com/taonic/my-samples-go/blob/main/deadlock/main.go): `deadlock/main.go`
- [Deadlock detection](https://github.com/taonic/my-samples-go/blob/main/deadlock_detection/main.go): `deadlock_detection/main.go`
- [List workflows](https://github.com/taonic/my-samples-go/blob/main/list_workflows/main.go): `list_workflows/main.go`
- [Query schedules](https://github.com/taonic/my-samples-go/blob/main/list_schedules_with_query/main.go): `list_schedules_with_query/main.go`
- [Schedules by workflows](https://github.com/taonic/my-samples-go/blob/main/query_schedules_by_workflows/main.go): `query_schedules_by_workflows/main.go`
- [Schedule update throughput](https://github.com/taonic/my-samples-go/blob/main/schedule_update_rps/main.go): `schedule_update_rps/main.go`
- [Worker health check](https://github.com/taonic/my-samples-go/blob/main/healthcheck/main.go): `healthcheck/main.go`

### Integrations and telemetry

- [Temporal Cloud usage](https://github.com/taonic/my-samples-go/blob/main/cloud-api/getusage/main.go): `cloud-api/getusage/main.go`
- [mTLS history retrieval](https://github.com/taonic/my-samples-go/blob/main/gethistorymtls/helloworld.go): `gethistorymtls/helloworld.go`
- [OpenTelemetry tracing](https://github.com/taonic/my-samples-go/blob/main/opentelemetry/opentelemetry.go): `opentelemetry/opentelemetry.go`
- [OTLP metrics](https://github.com/taonic/my-samples-go/blob/main/otlpmetrics/metrics.go): `otlpmetrics/metrics.go`
- [Prometheus metrics](https://github.com/taonic/my-samples-go/blob/main/lib/prom.go): `lib/prom.go`

### History and concurrency

- [Read event history](https://github.com/taonic/my-samples-go/blob/main/read_event_history/main.go): `read_event_history/main.go`
- [Parse exported history](https://github.com/taonic/my-samples-go/blob/main/parse_export_protobuf/main.go): `parse_export_protobuf/main.go`
- [Versioned replay markers](https://github.com/taonic/my-samples-go/blob/main/replay_with_version_and_marker/main.go): `replay_with_version_and_marker/main.go`
- [Race context](https://github.com/taonic/my-samples-go/blob/main/race_context/main.go): `race_context/main.go`
- [Race-safe queries](https://github.com/taonic/my-samples-go/blob/main/race-query/main.go): `race-query/main.go`
- [Race timer activity](https://github.com/taonic/my-samples-go/blob/main/race_timer_activity/main.go): `race_timer_activity/main.go`
- [Timeout interceptor](https://github.com/taonic/my-samples-go/blob/main/timeout_interceptor/main.go): `timeout_interceptor/main.go`

### Other components

- **Sample user**
- **Temporal service**

## Connections

- Sample user → Workflow channels: runs sample (evidence: `README.md`)
- Sample user → Concurrent cancellation: runs sample (evidence: `README.md`)
- Sample user → FIFO signals: runs sample (evidence: `README.md`)
- Sample user → Mutex starter: runs sample (evidence: `README.md`)
- Sample user → Event stream starter: runs sample (evidence: `README.md`)
- Sample user → Proxied activities: runs sample (evidence: `README.md`)
- Sample user → QPS sampling: runs sample (evidence: `README.md`)
- Sample user → Concurrent workflow benchmark: runs sample (evidence: `README.md`)
- Sample user → CPU-intensive activities: runs sample (evidence: `README.md`)
- Sample user → Activity concurrency limits: runs sample (evidence: `README.md`)
- Sample user → Deadlock prevention: runs sample (evidence: `README.md`)
- Sample user → Deadlock detection: runs sample (evidence: `README.md`)
- Sample user → List workflows: runs sample (evidence: `README.md`)
- Sample user → Query schedules: runs sample (evidence: `README.md`)
- Sample user → Schedules by workflows: runs sample (evidence: `README.md`)
- Sample user → Schedule update throughput: runs sample (evidence: `README.md`)
- Sample user → Temporal Cloud usage: runs sample (evidence: `README.md`)
- Sample user → mTLS history retrieval: runs sample (evidence: `README.md`)
- Sample user → OpenTelemetry tracing: runs sample (evidence: `README.md`)
- Sample user → OTLP metrics: runs sample (evidence: `README.md`)
- Sample user → Read event history: runs sample (evidence: `README.md`)
- Sample user → Parse exported history: runs sample (evidence: `README.md`)
- Sample user → Versioned replay markers: runs sample (evidence: `README.md`)
- Sample user → Race context: runs sample (evidence: `README.md`)
- Sample user → Race-safe queries: runs sample (evidence: `README.md`)
- Sample user → Race timer activity: runs sample (evidence: `README.md`)
- Sample user → Timeout interceptor: runs sample (evidence: `README.md`)
- Sample user → Worker health check: runs sample (evidence: `README.md`)
- Mutex starter → Distributed mutex queue: starts workflow (evidence: `mutex_queue/starter/main.go`)
- Event stream starter → Event stream workflow: starts workflow (evidence: `event_stream/starter/main.go`)
- QPS sampling → Hello workflows: starts workflows
- Concurrent workflow benchmark → Temporal service: starts executions (evidence: `bench_concurrent_workflow/main.go`)
- Workflow channels → Temporal service: uses SDK
- Concurrent cancellation → Temporal service: uses SDK
- FIFO signals → Temporal service: uses SDK
- Mutex starter → Temporal service: starts executions (evidence: `mutex_queue/starter/main.go`)
- Event stream starter → Temporal service: starts execution (evidence: `event_stream/starter/main.go`)
- List workflows → Temporal service: lists executions (evidence: `list_workflows/main.go`)
- Query schedules → Temporal service: queries schedules (evidence: `list_schedules_with_query/main.go`)
- Schedules by workflows → Temporal service: queries schedules (evidence: `query_schedules_by_workflows/main.go`)
- Schedule update throughput → Temporal service: updates schedules (evidence: `schedule_update_rps/main.go`)
- Temporal Cloud usage → Temporal service: uses Cloud API
- mTLS history retrieval → Temporal service: retrieves history
- OpenTelemetry tracing → Temporal service: traces workflows
- OTLP metrics → Temporal service: exports metrics
- Prometheus metrics → Temporal service: exports metrics
- Read event history → Temporal service: reads history
- Parse exported history → Temporal service: decodes export (evidence: `parse_export_protobuf/main.go`)
