When should I deploy a function to Cloud Run? Stay organized with collections Save and categorize content based on your preferences.
Cloud Run removes the work of managing servers, configuringsoftware, updating frameworks, and patching operating systems. The software andinfrastructure are fully managed by Google so that you just add code.Furthermore, provisioning of resources happens automatically in response torequests or events.This means that a Cloud Run service automatically scales out from a fewinvocations a day to many millions of invocations without any work from you.You can optionally usemanual scalingif you need more control over your scaling behavior.
When you deploy a function, source code or a container image toCloud Run, you receive all of the benefits described in theContainer runtime contract.
Use cases for deploying functions
You can directly deploy a function bound to events in order to implementasynchronous workloads (such as lightweightETL) or cloudautomations (such as triggering application builds).In addition, the automatic provisioning of an HTTPS endpoint makes functions aperfect candidate for webhooks.
See the following table for additional common use cases for deploying a functionto Cloud Run:
| Use case | Description |
|---|---|
| Streaming data processing / ETL | Listen and respond toCloud Storage events such as when a file is created, changed, or removed. Process images, perform video transcoding, validate and transform data, and invoke any service on the internet from Cloud Run. |
| Webhooks | Using anHTTP trigger, respond to events originating from 3rd party systems like GitHub, Slack, Stripe, or from anywhere that can send HTTP requests. |
| Mobile backend | Use Google's mobile platform for app developers,Firebase, and write your mobile backend in Cloud Run functions. Listen and respond to events from Firebase Analytics, Realtime Database, Authentication, and Storage. |
| IoT | Imagine tens or hundreds of thousands of devices streaming data into Pub/Sub, thereby launching Cloud Run functions to process, transform and store data. Cloud Run lets you do it in a way that's completely serverless. |
| AI/ML | Create a scalable image processing service with theCloud Vision API, or post process output data from aVertex AI custom-trained model. |
Connect and extend cloud services
Cloud Run functions provides a connective layer of logic that lets you writecode to connect and extend cloud services. Listen and respond to a file uploadto Cloud Storage, a log change, or an incoming message on a Pub/Subtopic. Cloud Run functions augments existing cloud services and lets youaddress an increasing number of use cases with arbitrary programming logic.Cloud Run functions have access to the Google Service Account credential andare thus seamlessly authenticated with the majority of Google Cloud services,including Cloud Vision, as well as many others. In addition,Cloud Run functions are supported by numerousCloud Client Libraries, whichfurther simplify these integrations.
What's next
- Try thegetting started guide for deploying a function.
- If you have existing functions and need to use the
gcloud functions deploycommand, the Cloud Functions v2 API, or thegoogle_cloudfunctions2_functionTerraform configuration for backwardcompatibility, you candeploy functions with thegcloud functionscommand.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.