We received the “Request to Webtask exceeded allowed execution time” error from the
/authorize endpoint or the
The “Request to Webtask exceeded allowed execution time” error means the webtask (e.g. rules/hooks/actions/custom DB scripts) cannot be completed within the execution limit, which is 20 seconds.
The possible causes for the webtask to timeout could be:
- Your webtask code not calling the
- Auth0 webtask platform is not responding
- Your webtask calling an external API and the external API timeout
- AWS/Azure cloud outage
Here is some general guidance on each of the causes.
1. Your webtask code is not calling the
The webtask is completed by calling the
callback() function. If the
callback() is missing, the webtask will keep running until the execution time runs out, thus the “Request to Webtask exceeded allowed execution time” error is thrown.
If your webtask code has many
if...else... statements, ensure the
callback() function is called at the end under every condition.
2. Auth0 webtask platform is not responding
If the webtask platform is malfunctioning, that could cause the timeout. It usually impacts multiple tenants or even all the tenants in the same region. Please open a support ticket or create a community topic if that happens.
3. If your webtask is calling an external API and the external API timeout.
Your external API service may be taking too much time or even not responding, which causes the webtask to timeout.
Usually, you would use an NPM package such as
request, etc, to make the external API calls. These libraries support the
- If you are not using the
timeoutsetting, the default timeout of these libraries could be 60 seconds (e.g. request) or unlimited (e.g.
axios). So if the external API service times out, the webtask is doomed to timeout.
- If you have configured the
timeoutsetting to be less than 20 seconds, please check if you are making multiple external API calls in series and if the total
timeoutsettings could exceed 20 seconds. For example, you make 4 external API calls in all the rules in series, each is configured with the
timeoutof 5 seconds, and if all 4 API calls times out, it could cause the webtask to timeout.
4) AWS/Azure cloud outage
If neither Auth0 nor your external API service is responsible for the timeout. The cloud infrastructure (e.g. AWS, Azure, or GCP) network blip or outage could cause this error as well.
There are 2 cases:
a) The cloud infrastructure that hosts the Auth0 webtask platform has an outage
b) The cloud infrastructure that hosts your external API service has an outage.
So you may need to search on social media (e.g. Tweet) for AWS outages to know if there is an outage on AWS or use a 3rd-party platform such as https://stop.lying.cloud.