Skip to content

Temporal Operations

Operational guide for Temporal workflow orchestration in the fzymgc-house cluster.

PropertyValue
Web UIhttps://temporal.fzymgc.house
Frontend Servicetemporal-frontend.temporal.svc.cluster.local:7233
Namespacetemporal
Auth MethodForward-Auth (shared oauth2-proxy, Keycloak-backed — group temporal-users, ADR hl-1fia)
Workers Repofzymgc-house/temporal-workers
Vault Pathsecret/fzymgc-house/cluster/temporal/*

Temporal uses two separate PostgreSQL databases on the CNPG main cluster:

DatabasePurposeSchema Version
temporalDefault store (workflow state, history)v1.18+
temporal_visibilityVisibility store (workflow search/listing)v1.9+

This separation prevents schema version collisions—each store has its own schema_version table.

ComponentReplicasPurpose
temporal-frontend1API gateway, client connections
temporal-history1Workflow state management
temporal-matching1Task queue routing
temporal-worker1Internal workflows (archival, replication)
temporal-web1Web UI
temporal-admintools1CLI tools (tctl, temporal)

Workers run via the Temporal Worker Controller, which manages TemporalWorkerDeployment CRDs for rainbow deployments (progressive rollout).

┌─────────────────────────────────────────────────────────────┐
│ Temporal Server │
│ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌────────┐ │
│ │ Frontend │ │ History │ │ Matching │ │ Worker │ │
│ └────┬─────┘ └────┬────┘ └────┬─────┘ └────────┘ │
│ │ │ │ │
│ └────────────┴───────────┘ │
│ │ │
│ ┌───────┴───────┐ │
│ │ PostgreSQL │ │
│ │ temporal │ │
│ │ temporal_vis │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────┘
┌────────────┼────────────┐
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Worker │ │ Worker │ │ Worker │
│ (core) │ │ (v2) │ │ (v3) │
└─────────┘ └─────────┘ └─────────┘
Rainbow Deployment (Worker Controller)
Terminal window
# Interactive shell
kubectl exec -it -n temporal deploy/temporal-admintools -- bash
# Single command
kubectl exec -n temporal deploy/temporal-admintools -- tctl <command>
Terminal window
# List namespaces
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns default namespace list
# Create namespace
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns default namespace register --namespace workflows
# Describe namespace
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns workflows namespace describe
Terminal window
# List workflows
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns workflows workflow list
# Execute workflow
kubectl exec -n temporal deploy/temporal-admintools -- \
temporal workflow execute \
--namespace workflows \
--task-queue default \
--type HelloWorkflow \
--input '"World"'
# Get workflow history
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns workflows workflow showid <workflow-id>
# Terminate workflow
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns workflows workflow terminate --workflow_id <id> --reason "manual termination"
Terminal window
# Describe task queue (shows workers)
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl --ns workflows taskqueue describe --taskqueue default
Terminal window
kubectl exec -n temporal deploy/temporal-admintools -- \
tctl cluster health

Expected output: temporal.api.workflowservice.v1.WorkflowService: SERVING

Terminal window
# Default store
kubectl exec -n postgres main-13 -- \
psql -U postgres -d temporal -c "SELECT * FROM schema_version;"
# Visibility store
kubectl exec -n postgres main-13 -- \
psql -U postgres -d temporal_visibility -c "SELECT * FROM schema_version;"
Terminal window
# Default store tables (should have ~39 tables)
kubectl exec -n postgres main-13 -- \
psql -U postgres -d temporal -c "\dt" | wc -l
# Visibility store tables
kubectl exec -n postgres main-13 -- \
psql -U postgres -d temporal_visibility -c "\dt"

Expected visibility tables:

  • executions_visibility
  • schema_update_history
  • schema_version

Error: ListWorkflowExecutions operation failed. Select failed: pq: relation "executions_visibility" does not exist

Cause: Schema migration didn’t run for visibility store. Usually caused by:

  1. Single-database setup where default store schema version blocked visibility migration
  2. Schema job not connecting to correct database

Fix:

  1. Verify two-database architecture is deployed:

    Terminal window
    kubectl get database -n postgres | grep temporal

    Expected: temporal and temporal-visibility

  2. Delete and re-sync schema job:

    Terminal window
    kubectl delete job -n temporal -l app.kubernetes.io/component=schema
    argocd app sync temporal-server
  3. Verify visibility tables exist:

    Terminal window
    kubectl exec -n postgres main-13 -- \
    psql -U postgres -d temporal_visibility -c "\dt"

Symptoms: Workflows stuck in “Running” state, no progress

Checks:

  1. Worker pod running:

    Terminal window
    kubectl get pods -n temporal -l app.kubernetes.io/name=temporal-worker
  2. Worker connected to task queue:

    Terminal window
    kubectl exec -n temporal deploy/temporal-admintools -- \
    tctl --ns workflows taskqueue describe --taskqueue default
  3. Worker logs:

    Terminal window
    kubectl logs -n temporal -l app.kubernetes.io/name=temporal-worker --tail=100

Check logs:

Terminal window
kubectl logs -n temporal deploy/temporal-frontend --tail=100
kubectl logs -n temporal deploy/temporal-history --tail=100

Common causes:

  • Database connection issues (check CNPG cluster health)
  • Secret not synced (check ExternalSecret status)
  • Schema not applied (check schema job completion)

Check job status:

Terminal window
kubectl get jobs -n temporal
kubectl describe job temporal-schema-1 -n temporal

Check init container logs:

Terminal window
kubectl logs -n temporal job/temporal-schema-1 -c setup-default-store
kubectl logs -n temporal job/temporal-schema-1 -c setup-visibility-store

If job is immutable and needs recreation:

Terminal window
kubectl delete job temporal-schema-1 -n temporal
argocd app sync temporal-server
PathContents
fzymgc-house/cluster/postgres/users/main-temporalDatabase credentials
fzymgc-house/cluster/temporal/*Worker secrets
SecretNamespaceSource
temporal-db-secrettemporalExternalSecret → Vault
temporal-worker-secretstemporalExternalSecret → Vault