Your workflow just crashed halfway through, again. The Cloud Run service scaled down, the Temporal worker lost its lease, and your carefully orchestrated saga is now sitting in limbo. This is the point where every DevOps engineer quietly whispers, “There must be a better way.”
Cloud Run and Temporal both solve hard problems, just not the same ones. Cloud Run gives you fast, fully managed containers that scale to zero and wake on demand. Temporal gives you reliable, stateful workflows that don’t forget their place in a process, even when the world restarts. Together, they can turn chaos into choreography—if you connect them right.
The key idea behind a Cloud Run Temporal setup is persistence meets elasticity. Cloud Run runs short-lived worker containers. Temporal expects long-lived workflow executors. The trick is treating workflow tasks like independent jobs: Cloud Run containers pick up Temporal tasks, execute them fast, report completion, then vanish. Temporal’s history service keeps state so no step is lost. It’s durable logic running on ephemeral infra.
When integrating, focus on three flows: identity, communication, and scaling. Use service accounts tied to Cloud Run revisions for authentication. Temporal supports secure connections via TLS and mTLS, which pairs well with Cloud Run’s private networking. Scaling comes free—workers scale up with task backlog and scale down to zero when idle. You pay only for computation that actually runs.
A small best practice: map Temporal namespaces to business domains, not services. It clarifies accountability. Rotate credentials tied to Cloud Run every thirty days with IAM or Secret Manager. Log retries and cancellations in Temporal’s Web UI for transparency before an incident review demands it.