Pause or Delay in Automations

Is it possible to delay an action from happening? I really like Slack notifications for new records, but I’d like the action to wait say, 1 minute after the record is created so that I can finish adding all of the fields. Is that possible?

1 Like

Instead of using a “New Record” trigger, change your trigger to “New Record In View”.

Then, you could create some sort of a criteria (such as checking a checkbox, or a formula that yields a value after a certain amount of time has passed since the creation date) to make your record appear in the view.

When your records appears in the view, the automation will trigger.

2 Likes

You can also use the When a record matches conditions trigger. It is similar to the New Record in View trigger, without having to actually create a view. Note that you may still have to deal with a record meeting conditions before you finish entering the data, especially with text fields and numeric fields.

5 Likes

Thank you @ScottWorld and @kuovonne! Both of these are excellent solutions. I really appreciate your help!

Can you explain this in greater detail please? How do you create a formula that yields a certain value after, for example, 1 minute passes? I know you can reference CREATED_TIME() and NOW() but my understanding is that NOW() only updates when you manually change the record.

Good question — it looks like they’ve changed the behavior of the NOW() functionality, and that it no longer is designed to update continuously in the background. So I wouldn’t depend on that.

At the moment, I would trigger your automation based on something else instead of time.

To open the question back up here since the previous solution isn’t applicable anymore - Does anyone know any way to delay an action?

The most obvious use-case here is how Automations might handle image attachments. It takes ~15-30 seconds for an image to upload, however a placeholder (a generic thumbnail image) is uploaded immediately.

The issue here is that you can’t sequence automations involving uploading image attachments. Normally you would do “[Image attachment field] is not Blank” to trigger the next action after the image uploads, but due to the placeholder image that’s added, it ends up triggering immediately.

To be more specific to my use case - you can’t issue a simple (1) “Upload URL to attachment field” > (2) “Post that attachment to Facebook” automation since the “Post to Facebook” automation triggers as soon as step 1 starts, not finishes.

So the solution would be to delay Step 2 by 30 seconds or so to ensure the image upload finishes first.

Things that I have tried:

  • Creating a date/time field that is offset by 1 minute so the triggers for the 2 automations are staggered. However, view filters and trigger conditions only give you the option of filtering by Day (e.g. “before Today”, etc), but not by time (e.g. “before Now”).

  • Using NOW() is not applicable for the reason mentioned in a previous post. NOW() only updates once the record is viewed or edited, not in real-time.

  • SetTimeout() is a Javascript function that can be used to write a delay script. However that command is not recognized or accepted by Airtable Scripting for some reason and just throws an error.

  • As mentioned above, simply sequencing it by saying “After the image attachment field is NOT blank, run Step 2” doesn’t work because the image attachment field adds a placeholder while uploading which triggers Step 2 immediately.

This does seem to be a fairly large limitation since there are 4 acceptable solutions above but none of them actually work.

I hope someone has a solution, since being able to simply delay an automation by X seconds seems like a fairly standard use-case.

1 Like

Actually, I was slightly incorrect, due to incorrect information that Airtable has listed on their formula reference page. The NOW() and TODAY() functions WILL update silently on their own in the background, every 7-15 minutes.

However, if you’re really looking for accurate scheduling & timing of your automations, I would recommend taking a look at Integromat, which has excellent scheduling features.

I’m sure other people will have some ideas for you as well.

But — couldn’t you just check a checkbox when you’re ready for the record to be sent through your automation? That’s the easiest way to do it.

Thanks, Scott. Good to know about that 7-15 minutes…that could work! Where do you see that information? I was referencing the same formula page that you were.

To answer your question for my specific use-case - I’m creating a form that can choose a pre-defined attachment image based on a single-select field. So the single-select field is something like “Photo 1”, “Photo 2”, “Photo 3”, etc and the image that posts to Facebook is based on the selection during the form.

Automations can’t accept IF/THEN statements (e.g. “If ‘Photo 1’ use Photo1_attachment field, if ‘Photo 2’ use Photo2_attachment field, etc”), so an automation has to handle that logic first and upload it to a singular “Social Media Image” field that is then referenced by the Facebook Post Automation.

So the user flow is: User selects “Photo 2” and submits the form > Automation takes Photo2_attachment field and uploads it as an attachment to “Social Media Image” > Facebook Automation posts using the “Social Media Image” attachment as the image.

Bigger picture, I’m working on a simple social scheduler that can accept pre-defined fields (like pre-defined images). It seems like its 90% there, but the fact you can’t delay an automation is making it difficult to roll out.

But bigger picture, outside of my specific need, there really should be a simple way to delay automations.

@Mike_Mauer

Ah, the discovery about the 7-15 minute delay just came from personal testing that some of the people in this community had done on their own, and then I tested it out on my own as well.

You’re right that Automations can’t handle IF/THEN logic yet, but that is probably coming in the near future.

But this is what I would do: Your automation doesn’t really need to run on a schedule. It sounds like your first automation runs just fine, correct? Based on the selection that the user makes in the form, the proper photo is uploaded into your “Social Media Image” field, correct? This part works fine?

So your 2nd automation just needs to wait long enough until your “Social Media Image” has an image in it, correct? If so, then I would just change your trigger to “When a record matches conditions”, and have it trigger as soon as your social media image field is no longer empty.

Let me know if that works for you!

1 Like

@ScottWorld

Thanks Scott, I appreciate it!

I tried exactly what you suggested but the problem is what I previously described - a placeholder image is uploaded immediately while the actual file uploads in the background, so it triggers the “Attachment field is not blank” filter before it’s done uploading.

I suspect the placeholder image is done as a UI thing so you know that a file is uploading, but the result is that you can’t actually write a rule that says “Run this action when the file is finished uploading”.

Uploading of attachments can be a bit tricky. As @Mike_Mauer mentioned, there is a delay between when an attachment field is no longer considered blank and when the image is actually uploaded. And in some cases, if Airtable cannot retrieve the attachment from the url, the image might not ever become fully attached.

setTimeout does work in a scripting app (even though the editor complains about it), but it needs to be called correctly. However, I wouldn’t use setTimeout in a Scripting action for an automation. Scripting actions must complete within 30 seconds.

Instead, I would go about this with a slightly different technique. I would create a new formula field that checks to make sure that there is an attachment and that the last updated time was a couple of minutes before NOW(). Then I would run the automation off of the when a record meets conditions on the formula field. The automation might not run until several minutes after the attachment is actually uploaded (due to the delays in when NOW is recalculated, but it will run automatically, and it won’t run unless the attachment is present.

IF(
  AND(
    {Attachment},
    DATETIME_DIFF(
      NOW(),
      LAST_MODIFIED_TIME(Attachment),
      'minutes'
    ) > 1
  ),
  "run automation"
) 
2 Likes

Great solution, @kuovonne! :sunglasses::raised_hands:

@kuovonne

This is very clever, thank you! I’ll give it a shot tonight and report back.

I just put an explanation and working demo of this setup on my website.

1 Like

This is awesome, @kuovonne!!

Just tested it out and it works! Very clever solution, thank you.

I’m not 100% sure we can consider this completely resolved, but for anyone who is reading this in the future here is the current status:

You can not pause or delay automations by a specific amount of time in Airtable. What you can do, however, is use @kuovonne’s method, which will allow you do delay things in increments of 5-15 minutes (the range is dependant on how often Airtable refreshed your NOW() command).

2 Likes

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.