# Temporal

Deploy Temporal on Render with this template. Get a production-ready cluster with independent autoscaling and advanced visibility via Elasticsearch.

- Repository: https://github.com/render-examples/temporal
- Stack: go
- Tags: cluster, search
- URL: https://render.com/templates/temporal

## Why deploy Temporal on Render?

Temporal is a durable execution platform that manages the state, retries, and orchestration of long-running workflows and distributed systems. It solves the problem of building reliable applications that need to handle failures, timeouts, and complex multi-step processes without manually implementing retry logic, state persistence, or recovery mechanisms.

This template deploys a complete Temporal cluster with eight interconnected services—frontend, history, matching, and worker components—plus Elasticsearch for advanced visibility, two managed Postgres databases, and a sample Go app to trigger workflows. Setting this up manually means configuring service discovery between components, wiring database connections, and getting the auto-setup scripts right; here it's all pre-configured to work together on deploy. Each Temporal service runs as a separate Render service, so you can independently scale matching or history based on actual load rather than scaling the entire cluster.

## Architecture

```mermaid
flowchart LR
    classDef default fill:#1a1a2e,stroke:#a78bfa,color:#fff

    User([User])
    
    User --> app-workflow-trigger[app-workflow-trigger]
    app-workflow-trigger -->|gRPC| temporal-frontend((temporal-frontend))
    
    app-worker[[app-worker]] -->|gRPC| temporal-frontend
    
    temporal-frontend --> temporal-history((temporal-history))
    temporal-frontend --> temporal-matching((temporal-matching))
    temporal-frontend --> temporal-worker((temporal-worker))
    
    temporal-history --> temporal-db[(temporal-db)]
    temporal-matching --> temporal-db
    temporal-worker --> temporal-db
    temporal-frontend --> temporal-db
    
    temporal-history --> temporal-elasticsearch((temporal-elasticsearch))
    temporal-matching --> temporal-elasticsearch
    temporal-worker --> temporal-elasticsearch
    temporal-frontend --> temporal-elasticsearch
    
    temporal-ui((temporal-ui)) -->|gRPC| temporal-frontend
```

## What you can build

After deploying, you'll have a production-ready Temporal cluster with independently scalable services and Elasticsearch-backed visibility for querying workflow state. The template includes a sample Go app so you can immediately trigger and execute workflows. You can use this as a foundation for building durable, long-running workflows without managing the orchestration infrastructure yourself.

## Key features

- *Independent service autoscaling*: Each Temporal service (frontend, matching, history, worker) can be scaled independently based on workload demands.
- *Elasticsearch advanced visibility*: Includes pre-configured Elasticsearch integration enabling advanced workflow search and filtering capabilities.
- *Production-ready cluster setup*: Provides a complete multi-service Temporal deployment architecture designed for production use on Render.
- *Example Go workflow app*: Includes a sample Go application demonstrating how to trigger and execute Temporal workflows.
- *One-click Render deployment*: Configured with render.yaml for automated infrastructure provisioning via Render's deploy button.

## Use cases

- Backend engineer deploys fault-tolerant workflow orchestration without managing infrastructure
- Platform team runs autoscaling Temporal cluster with Elasticsearch-backed workflow visibility
- DevOps engineer migrates long-running payment workflows to production-ready managed hosting
- Startup founder ships reliable order processing pipelines using pre-configured Go example

## What's included

| Service | Type | Purpose |
|---------|------|---------|
| esdata | Private Service | Application service |
| temporal-frontend | Private Service | Serves the user interface |
| temporal-history | Private Service | Application service |
| temporal-matching | Private Service | Application service |
| temporal-worker | Private Service | Application service |
| temporal-ui | Private Service | Application service |
| app-workflow-trigger | Web Service | Application service |
| app-worker | Background Worker | Application service |
| temporal-db | PostgreSQL | Primary database |
| temporal-shared | PostgreSQL | Primary database |

## Next steps

1. Open the Temporal Web UI service URL — You should see the Temporal dashboard with the default namespace listed and no workflow executions yet
2. Test the example Go worker by triggering a workflow using the Temporal CLI or SDK against your frontend service URL — You should see the workflow appear in the Web UI with a 'Completed' status within a few seconds
3. Configure your application's Temporal client to connect to the frontend service URL and run a sample workflow — You should see the workflow execution logged in the Web UI's workflow list with full execution history available

## Resources

- [Temporal official site](https://temporal.io)
