Help

Re: Pause or Delay in Automations

Solved
Jump to Solution
10142 1
cancel
Showing results for 
Search instead for 
Did you mean: 
egordin
7 - App Architect
7 - App Architect

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 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

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.

See Solution in Thread

20 Replies 20
ScottWorld
18 - Pluto
18 - Pluto

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.

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.

egordin
7 - App Architect
7 - App Architect

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.

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!

@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"
) 

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

Mike_Mauer
6 - Interface Innovator
6 - Interface Innovator

@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.

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).

buildsomething
4 - Data Explorer
4 - Data Explorer

I've been looking into ways to fix this problem for myself, and the best thing I came up with was to create 5 steps (check box fields). 

PDF gets generated upon form submission - "Cert In" gets checked when "PDF" not empty - "Step 1" gets checked when "Cert In" is checked- Same for "Step 2" ---> "Step 5". After "Step 5" box is checked AND "PDF" not empty AND "Cert In" is checked, then send "PDF" to user email and mark "Cert Sent" as checked.

Works every time. 

Hi @kuovonne great solution. I have tried it and I think it is what I was looking for. The only thing is that the automation is working only when running test (I have this problem also with other implementations of this automation). Can you or anyone help?

So I have a grid with supply quantity and date of an order. Sometimes not the whole quantity is shipped, so I wanted an easy form (I'm using interfaces), where my colleagues write the shipped quantity. So, to sum up:

- if the shipped quantity is the same as the expected supply quantity, great, nothing happens and the record changes status to "shipped";

- If shipped quantity is different from zero and the difference with the expected quantity is non zero, the record changes to "shipped" status, the field of the expected shipment (it must be it, as it is the visible field in all the interfaces and statistics) should update and a new record in which the expected next shipment amount is the difference between what should have been shipped and what was really shipped.

I hope I explain myself, it's easier to see than to say. So airtable fails to do this operation. Before using the interfaces, my boss would go to the database and change the expected supply with the shipment quantity; an automation would run with no problem and a new record with the remaining amoun would be created.

At first, instead of using a delay system as the one above, I would just change the expected supply field via the form, but I had many Issues as the automation would run before I could finish typing the number, creating many discrepancies.

Thank you


SORRY, missing words

- If shipped quantity is different from zero and the difference with the expected quantity is non zero, the record changes to "shipped" status, the field of the expected shipment (it must be it, as it is the visible field in all the interfaces and statistics) should update and a new record should create in which the expected next shipment amount is the difference between what should have been shipped and what was really shipped.