Stay organized with collections
Save and categorize content based on your preferences.
Cloud Run removes the work of managing servers, configuring
software, updating frameworks, and patching operating systems. The software and
infrastructure are fully managed by Google so that you just add code.
Furthermore, provisioning of resources happens automatically in response to
requests or events.
This means that a Cloud Run service automatically scales out from a few
invocations a day to many millions of invocations without any work from you.
You can optionally use manual scaling
if you need more control over your scaling behavior.
When you deploy a function, source code or a container image to
Cloud Run, you receive all of the benefits described in the
Container runtime contract.
Use cases for deploying functions
You can directly deploy a function bound to events in order to implement
asynchronous workloads (such as lightweight ETL) or cloud
automations (such as triggering application builds).
In addition, the automatic provisioning of an HTTPS endpoint makes functions a
perfect candidate for webhooks.
See the following table for additional common use cases for deploying a function
to Cloud Run:
Use case
Description
Streaming data processing / ETL
Listen and respond to Cloud 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 an HTTP 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.
Cloud Run functions provides a connective layer of logic that lets you write
code to connect and extend cloud services. Listen and respond to a file upload
to Cloud Storage, a log change, or an incoming message on a Pub/Sub
topic. Cloud Run functions augments existing cloud services and lets you
address an increasing number of use cases with arbitrary programming logic.
Cloud Run functions have access to the Google Service Account credential and
are 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 numerous
Cloud Client Libraries, which
further simplify these integrations.
If you have existing functions and need to use the gcloud functions deploy
command, the Cloud Functions v2 API, or the
google_cloudfunctions2_function Terraform configuration for backward
compatibility, you can
deploy functions with the gcloud functions command.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# When should I deploy a function to Cloud Run?\n\n| **Note:** Cloud Functions has been renamed to Cloud Run functions. For more information, see the [Cloud Run functions blog post](https://cloud.google.com/blog/products/serverless/google-cloud-functions-is-now-cloud-run-functions).\n\nCloud Run removes the work of managing servers, configuring\nsoftware, updating frameworks, and patching operating systems. The software and\ninfrastructure are fully managed by Google so that you just add code.\nFurthermore, provisioning of resources happens automatically in response to\nrequests or events.\nThis means that a Cloud Run service automatically scales out from a few\ninvocations a day to many millions of invocations without any work from you.\nYou can optionally use [manual scaling](/run/docs/configuring/services/manual-scaling)\nif you need more control over your scaling behavior.\n\nWhen you deploy a function, source code or a container image to\nCloud Run, you receive all of the benefits described in the\n[Container runtime contract](/run/docs/container-contract).\n\nUse cases for deploying functions\n---------------------------------\n\nYou can directly deploy a function bound to events in order to implement\nasynchronous workloads (such as lightweight [ETL](/learn/what-is-etl)) or cloud\nautomations (such as triggering application builds).\nIn addition, the automatic provisioning of an HTTPS endpoint makes functions a\nperfect candidate for webhooks.\n\nSee the following table for additional common use cases for deploying a function\nto Cloud Run:\n\nConnect and extend cloud services\n---------------------------------\n\nCloud Run functions provides a connective layer of logic that lets you write\ncode to connect and extend cloud services. Listen and respond to a file upload\nto Cloud Storage, a log change, or an incoming message on a Pub/Sub\ntopic. Cloud Run functions augments existing cloud services and lets you\naddress an increasing number of use cases with arbitrary programming logic.\nCloud Run functions have access to the Google Service Account credential and\nare thus seamlessly authenticated with the majority of Google Cloud services,\nincluding Cloud Vision, as well as many others. In addition,\nCloud Run functions are supported by numerous\n[Cloud Client Libraries](/apis/docs/cloud-client-libraries), which\nfurther simplify these integrations.\n\nWhat's next\n-----------\n\n- Try the [getting started guide for deploying a function](/run/docs/quickstarts/functions/deploy-functions-console).\n- If you have existing functions and need to use the `gcloud functions deploy` command, the Cloud Functions v2 API, or the `google_cloudfunctions2_function` Terraform configuration for backward compatibility, you can [deploy functions with the `gcloud functions` command](/functions/docs/deploy)."]]