Uh Oh… Beware of Recursion in Airtable Automations

I did some testing and and saw it was working. Great! The next day I noticed that my monthly automations were up to 20,000 vs the 30 or so I was expecting. What was causing this? I noticed that the automation above was running several times every minute without any interactions from the user.

The cause? I was watching the same field that I am updating in my script and Airtable saw the update as a reason to run the automation again. This actually makes sense because the update is an asynchronous call and is not aware of its context, but it’s an easy thing to miss.

The Fix

There are a few options.

Using the Same Automation

All I needed to do was stop watching the Completed field. I really only needed to watching the Done field since I really just want to know if a Task is marked Done or not. Doing this fixed the issue.

When Record Enters a View

In that last post, I created a View for Open Tasks an one for Completed Tasks. Another approach would be to create 2 Automations, monitoring the entering of a View. Since my Views are based upon the Done field being checked or not, this is very similar to just watching the Done field. The thing I don’t like about this approach is that it’s difficult to know what you are impacting when editing a View. For this reason, I tend to not use automation logic that is based upon a View unless I create specific views built for that purpose.

Using Formula Fields

Follow the approach that Airtable documents for this. This requires adding some formula fields that track Last Updated Dates of specific fields and then grabbing that value to stamp into the Completed field.

 

Scott Hemmeter

Comments

Related posts

Search Airtable: Creating a CRM (Part 5) – Task Management
Publishing the CRM Template Search