Help

Script Automation takes longer than 30 seconds to run so it fails

469 6
cancel
Showing results for 
Search instead for 
Did you mean: 
liser
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi everyone,

I have an automation that runs a script which sends a recordID to a Make webhook.

Every now and then the automation fails because Airtable sets the script execution limit to 30 seconds. That makes me think that the problem is because of Make, in that the processing in Make takes longer so in return Airtable exceeds the execution time.

Has anyone else experienced this issue? Is there a way for us to resolve this or perhaps a workaround?

Here's my simple script:

 

let inputConfig = input.config();
let webhook = 'https://hook.us1.make.com/jflrewqrewmnmnnqsdfsqsgtewvs'
let queryParams = `/?record=${inputConfig.record}`

fetch(`${webhook}${queryParams}`);

 

6 Replies 6

Perhaps you could try setting up an Airtable automation with the trigger "When webhook received", and you could make your Make scenario hit that webhook instead for the return?  This would allow you to get around the 30 second automation limit

Hi,
I could suggest steps for debug.
fetch is async operation and needs to be called with await.
result must be turned to text or json, in other async step
adjust according to your data and try to run it in scripting extension

try to change responce.json()  to responce.text()  and see what is correct in your case
next, change remoteFetchAsync  to fetch  (as you cannot use first operation inside automation)

 

const responce=await remoteFetchAsync(wbhook,options);
const result=(responce.ok)? await responce.json() : responce.statusText;
console.log(result)

 

After you fix the case, you can install it in automation, maybe in shorter way

const result=await fetch(url_and_options).then(request => request.json())
console.log(result)

So you mean I should remove my initial automation? But I need that that to send the data to Make.

Hmm, I just realized I'm assuming that your script uses the Make response to do something else.  If so, please leave your original automation in place and update it so that it doesn't do that anymore.  Create a new Airtable automation with "When webhook received" and set your Make scenario to respond and hit that new Airtable automation, does that make sense?  That new Airtable automation will then perform the actions needed

Screenshot 2024-06-06 at 11.48.07 PM.png

If your response doesn't need the response from the Make scenario that changes stuff though

Hi @TheTimeSavingCo 

This is Red actually; I work with Lise.

I don't actually have a response in my Make automation. I did not know I needed one. However, my Make scenario performs other stuff which is triggered only by this Airtable automation, so I don't need a new Airtable automation "When webhook received".

For now, my plan is to add the Webhook response module in Make right after the webhook data is received. By doing this, Make responds right away even if other complex processing is not yet completed.

Do you think it will work?

 

Ah sorry, I misunderstood what we were trying to do.  If we're not relying on the Make webhook to return any data then I can't think of a reason why your code would be taking longer than 30 seconds to run.  Adding the response module in this scenario shouldn't matter either

At this point I would follow @Alexey_Gusev's advice to try to debug it and figure out what might be happening