Skip to main content

Performance & Latency Patterns

View Markdown

Temporal Workflows are durable and reliable, but a default implementation—using regular Activities scheduled through the Temporal server—carries inherent latency. Each regular Activity incurs multiple server round-trips, and each new Workflow begins with a Matching Service routing step. On Temporal Cloud, this baseline can reach 850 ms or more for a typical three-Activity workflow.

This section covers three complementary patterns that each target a different source of latency. They can be applied individually or combined depending on your requirements.

Latency sources in a typical Workflow

SourceOverheadPattern that removes it
Matching Service (first Workflow Task)~30–50 msEager Workflow Start
Activity scheduling round-trip~50 ms per ActivityLocal Activities
Client waiting for full workflowTotal durationEarly Return

Pattern comparison

The numbers below are approximate benchmarks based on a three-Activity transaction workflow running on Temporal Cloud. Actual results vary by region, Activity implementation, and server load.

PatternFirst ResponseTotal LatencySDK Support
Baseline (regular Activities)~850 ms~850 msAll
Early Return~265 ms~850 msAll
Local Activities~275 ms~275 msAll
Early Return + Local Activities~160 ms~275 msAll
Eager Workflow Start + Local Activities~265 ms~265 msGo, Java, Python
Early Return + Local Activities + Eager Start~160 ms~265 msGo, Java, Python

First Response is the time until the client receives an actionable result. Total Latency is the time until the Workflow fully completes.

TypeScript users

Eager Workflow Start is not available in the TypeScript SDK, but the latency gap is small (~30–50 ms per Workflow start). Local Activities and Early Return + Local Activities are fully supported and achieve competitive results: ~275 ms total latency and ~160 ms first-response latency respectively.

Patterns in this section

Choosing a pattern

You only care about total workflow latency (not first-response time): use Local Activities. If co-location is feasible, add Eager Workflow Start for the maximum reduction.

You care most about first-response latency: use Early Return + Local Activities. The client gets its response in ~160 ms; background work continues independently.

You are using TypeScript: use Local Activities and Early Return + Local Activities. Eager Workflow Start is not available in the TypeScript SDK.

You want to start simple: begin with Local Activities. It requires minimal structural change and provides the most straightforward per-Activity improvement.