Temporal Serverless Workers on... Note

Temporal Serverless Workers on Cloud Run: Scale workers ahead of demand

The Temporal execution platform, crucial for distributed systems and AI agents, faces challenges in worker deployment and scaling. Traditional methods often involve managing Kubernetes or VMs, leading to continuous costs and scaling lags. Temporal Cloud now offers Serverless Workers on Cloud Run, addressing these issues. These workers are deployed as a "worker pool" that Temporal automatically scales, even down to zero when idle. This eliminates the need for managing clusters or autoscalers, keeping worker code unchanged.Cloud Run worker pools are designed for continuous background tasks, aligning with how Temporal workers operate. Temporal Cloud monitors task queues and adjusts the worker pool size via the Cloud Run Admin API. Each build version of a worker runs in its own pool, allowing older versions to scale to zero until needed. This technology enables autoscaled agentic workers for AI, handles long-running workflows efficiently, and supports bursty batch processing with cost savings.Previously, running Temporal workers on Cloud Run required workarounds for port listeners and instance billing. Worker pools remove these, offering no endpoint management and steady CPU at a lower cost. Scaling doesn't cause revision churn, and Temporal manages growth by monitoring task backlog latency. Scale-in is more conservative to ensure availability, with configurable graceful shutdown for workers.Temporal Serverless Workers on Cloud Run also enforce Temporal Worker Versioning, a critical feature for stateful, deterministic workflows. Deploying new code involves creating distinct worker pools for each version, preventing mid-run errors. Workflows remain on their original version or can be configured for automatic upgrades, depending on the workflow type. Setting up involves containerizing workers, deploying them as a Cloud Run worker pool, granting Temporal Cloud permissions, and creating a Worker Deployment Version. This new feature is currently in preview.
CdXz5zHNQW_Mquaroke6P.png