Uh Oh… Beware of Recursion in Airtable Automations

In my last CRM post about Task Management, I suggested an Automation that would monitor for the Done and Completed fields to set the Completed Date on the record.

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.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s