Help

Scripting

Solved
Jump to Solution
2199 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Yaniv_Amesllem-
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,
I am trying to debug why a certain script I wrote for automations failed because it takes more than the allowed 30 seconds. It seems that Airtable JavaScript environment doesn't support parallel execution of asynchronous tasks. Is that correct ? What can I don if I want to perform this kind of code: await Promise.all([ updateRemoteDB(), updateRemoteDB() ])

Thanks,
Yaniv

1 Solution

Accepted Solutions

So just update each remote DB in it's own script step.
when I wrote about 'output.set', I supposed you are querying some data from Airtable in the script, like
let query=await selectRecordAsync...
since script variables (like 'query') will be inavailable in other steps, to avoid querying many times, you can pass your data as output variable

See Solution in Thread

6 Replies 6

Hi,
Once I tried to make a script with complex evaluation that continues to run while program awaiting for some user input and finally I had to refactor it, as it seems like Airtable has some limitations with asynchronous threads.
On your place, I would break the task into several steps. You can pass json-stringified data with 'output.set'

Thanks for you answer Alexey. 

Indeed sounds like an Airtable limitation. 
Can you please elaborate on your suggestion on breaking it down to tasks, using output.set? I am not sure I understand what do you mean.

it depends on what is updateRemoteDB() and why are you breaking it into several updates

Yaniv_Amesllem-
5 - Automation Enthusiast
5 - Automation Enthusiast

In the question I removed un necessary data,
UpdateRemoteDB is called with different parameters for different remote DB's

So just update each remote DB in it's own script step.
when I wrote about 'output.set', I supposed you are querying some data from Airtable in the script, like
let query=await selectRecordAsync...
since script variables (like 'query') will be inavailable in other steps, to avoid querying many times, you can pass your data as output variable

Now I get it, thanks.

For some reason I didn't think that adding multiple actions with script is an option. 

All the best,
Yaniv