Skip to main content

Serverless Workers

View Markdown

Serverless Workers let you run Temporal Workers on serverless compute. Deploy your Worker code to a serverless provider, configure a compute provider for the Worker Deployment Version, and Temporal starts and stops Workers in response to work on the Task Queue. There is no always-on Worker fleet to provision or scale.

Temporal monitors Task Queues that have a compute provider configured. When a Task arrives and no Worker is free to take it, the Worker Controller Instance (WCI) starts compute. How it starts compute is where the providers differ. On AWS Lambda the WCI invokes a function per unit of work, and the Worker exits when the invocation window ends. On GCP Cloud Run it resizes a Worker Pool of long-lived instances that poll continuously.

Supported providers

  • AWS Lambda - Deploy a Serverless Worker as a Lambda function. Temporal assumes an IAM role in your AWS account to invoke the function when Tasks arrive.
  • GCP Cloud Run - Deploy a Serverless Worker to a Cloud Run Worker Pool. Temporal impersonates a service account in your GCP project to scale the pool as Tasks arrive and drain.