If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v1 API.
Stay organized with collections
Save and categorize content based on your preferences.
Function timeout (1st gen)
If a function runs for too long, the system takes steps to terminate or
throttle it. This timeout period defaults to 60 seconds, but you can extend or
reduce it when you deploy the function. The maximum timeout duration is nine
minutes (540 seconds).
When function execution reaches its timeout, a response message with an HTTP
error status, generally 408, is immediately returned to the caller; function
execution is halted.
Set a timeout duration
You can set a function's timeout duration at deployment using the
Google Cloud CLI or the Google Cloud console.
gcloud
If you are deploying using the gcloud CLI, use the
--timeout flag:
Expand the Runtime, build... section at the end of the page and click
the Runtime tab.
In the Timeout field, enter a number of seconds.
To edit an existing timeout duration in Google Cloud console, on the functions
overview page click the name of the function to go to its details
page. On the details page click Edit, expand the Runtime, build...
section, and click the Runtime tab, where you can directly edit the
value in the Timeout field.
[[["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-03 UTC."],[[["\u003cp\u003eFunctions have a default timeout of 60 seconds, which can be adjusted during deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe maximum timeout duration for a function is nine minutes (540 seconds).\u003c/p\u003e\n"],["\u003cp\u003eWhen a function exceeds its timeout, an HTTP error (typically 408) is returned, and execution stops.\u003c/p\u003e\n"],["\u003cp\u003eTimeout duration can be set or modified during deployment or through redeployment, using either the Google Cloud CLI or the Google Cloud console.\u003c/p\u003e\n"]]],[],null,["# Function timeout (1st gen)\n==========================\n\nIf a function runs for too long, the system takes steps to terminate or\nthrottle it. This timeout period defaults to 60 seconds, but you can extend or\nreduce it when you deploy the function. The maximum timeout duration is nine\nminutes (540 seconds).\n\nWhen function execution reaches its timeout, a response message with an HTTP\nerror status, generally 408, is immediately returned to the caller; function\nexecution is halted.\n\nSet a timeout duration\n----------------------\n\nYou can set a function's timeout duration at deployment using the\nGoogle Cloud CLI or the Google Cloud console. \n\n### gcloud\n\nIf you are deploying using the gcloud CLI, use the\n[`--timeout`](/sdk/gcloud/reference/functions/deploy#--timeout) flag: \n\n```sh\ngcloud functions deploy YOUR_FUNCTION_NAME --no-gen2 --timeout=TIMEOUT_DURATION ...\n```\n\nTo edit an existing timeout duration with Google Cloud CLI, redeploy the\nfunction with a new timeout value.\n\n### Console\n\nTo set the timeout duration during function creation in the\nGoogle Cloud console:\n\n1. Go to the [Cloud Run functions Overview page](https://console.cloud.google.com/functions/list) in the Google Cloud console.\n2. Click **Create function**.\n3. Fill in the required fields for your function.\n4. Expand the **Runtime, build...** section at the end of the page and click the **Runtime** tab.\n5. In the **Timeout** field, enter a number of seconds.\n\n To edit an existing timeout duration in Google Cloud console, on the functions\n overview page click the name of the function to go to its details\n page. On the details page click **Edit** , expand the **Runtime, build...**\n section, and click the **Runtime** tab, where you can directly edit the\n value in the **Timeout** field."]]