Hi Jeremy,
We rate-limit blocks to 15 writes per second and batch methods allow modification of 50 records in one call. Your current code looks like it does a separate API call for each person, so you’re running into the 15 writes per second limit.
You could switch your code to use the batch createRecordsAsync
instead of createRecordAsync
to get around this. You could also do what you suggested (split the calls and await
each previous one). The time it takes for the write to complete (while you await
) should be long enough that you wouldn’t need to include an additional timeout.
For the first option, it’d look like this:
peopleHolidaysTable.createRecordsAsync(people.map(person => ...))
For the second option, we have an example on how to that in the “Size limits & rate limits” section of this guide: Airtable Blocks SDK as well as in the Wikipedia Enhancement example block: https://github.com/Airtable/blocks/blob/master/examples/wikipedia-enrichment-block/frontend/index.js#L117
Sorry for the late response, hope this is still helpful!
Hi Jeremy,
We rate-limit blocks to 15 writes per second and batch methods allow modification of 50 records in one call. Your current code looks like it does a separate API call for each person, so you’re running into the 15 writes per second limit.
You could switch your code to use the batch createRecordsAsync
instead of createRecordAsync
to get around this. You could also do what you suggested (split the calls and await
each previous one). The time it takes for the write to complete (while you await
) should be long enough that you wouldn’t need to include an additional timeout.
For the first option, it’d look like this:
peopleHolidaysTable.createRecordsAsync(people.map(person => ...))
For the second option, we have an example on how to that in the “Size limits & rate limits” section of this guide: Airtable Blocks SDK as well as in the Wikipedia Enhancement example block: https://github.com/Airtable/blocks/blob/master/examples/wikipedia-enrichment-block/frontend/index.js#L117
Sorry for the late response, hope this is still helpful!
Very helpful — thank you, @Emma_Yeap!