Setting function timeouts differently for various functions within the same app depends on the cloud platform you are using:
- AWS Lambda: In AWS Lambda, you can configure the timeout for each function individually. This is done by accessing the Lambda console, selecting the specific function, and adjusting the timeout setting under the Configuration tab. The timeout can be set between 1 and 900 seconds (15 minutes) for each function independently[1].
- Azure Functions: For Azure Functions, the `functionTimeout` property in the `host.json` file applies globally to all functions within an app. However, you can set different timeouts for different functions by using separate function apps or by implementing custom logic within your functions to handle timeouts programmatically. The `functionTimeout` can be set up to 10 minutes for Consumption Plan hosting and is unlimited for Premium and Dedicated Plans[3][7].
- Google Cloud Functions: In Google Cloud, you can set the timeout duration for each function individually during deployment using the `--timeout` flag with the `gcloud functions deploy` command. This allows you to configure different timeouts for different functions within the same project[5].
- App Script: For Google Apps Script, the maximum execution time is fixed at 6 minutes for the free version, and there is no option to set different timeouts for different scripts. However, you can split processing into multiple scripts to avoid timeouts[2].
In summary, while some platforms like AWS Lambda and Google Cloud Functions allow setting different timeouts for each function, others like Azure Functions apply a global timeout setting unless custom logic is implemented.
Citations:
[1] https://docs.aws.amazon.com/lambda/latest/dg/configuration-timeout.html
[2] https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Bot-executes-Script-Trigger-twice-due-to-timeout/m-p/598297
[3] https://build5nines.com/azure-functions-extend-execution-timeout-past-5-minutes/
[4] https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout
[5] https://cloud.google.com/functions/docs/configuring/timeout
[6] https://stackoverflow.com/questions/315078/how-do-you-handle-multiple-instances-of-settimeout
[7] https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/functions-timeout-duration.md
[8] https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale