Skip to main content

Hello Zapier community!

I’m working on a Zap that can get triggered within seconds of each other frequently due to the use of a webhook trigger. To avoid race conditions within my Zap, I’ve implemented a “Delay after queue” with sufficient time to give the Zap enough time to finish before the next one starts.

However, I feel this is a complex solution for an easy issue. Is there any third party application/zappier tool that acts as a simple queue?

Example of the simple queue I’m looking for: If a zap is triggered one after the other within a small timeframe, one goes through and the other one waits until the first one has ended before continuing the flow.

Thanks in advance!

Hi ​@AutomatedVC 

It won’t be a simple solution per se, but doable.

For sequential queue processing, you can configure that logic with multiple Zaps using webhooks and Zapier Tables.

Plus, Zapier Tables counts as 0 Tasks in Zap Runs.

 

Zap 1

Used to add records to the 2 queues.

  1. Trigger: Webhook - Catch Hook
  2. Action: Zapier Table - Create Record
    1. Table: Queue - Records
  3. Action: Zapier Table - Find Record
    1. Table: Queue - Control
    2. Enable the checkbox to Create Record if not found (screenshot)
      1. Search by the same value each time.
        1. Field: XXX
        2. Value: TRUE
    3. That way a new record will only be created if there are 0 existing records.

Zap 2
Used to trigger Zap 3 when there is a new record in Table: Queue - Control

  1. Trigger: Zapier Table - New Record
    1. Table: Queue - Control
  2. Action: Webhook - POST
    1. Use the webhook url from Zap 3, Step 1
    2. Include a timestamp parameter
      1. Help: https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field

Zap 3
Used to cycle thru the existing queue of records to process until none are found.

  1. Trigger: Webhook - Catch Hook
  2. Action: Zapier Table - Find Record
    1. Table: Queue - Records
  3. Action: Paths
    1. Action: Path A
      1. Action: Filter
        1. Continue if Step 2 records count > 0
      2. Action: oAPP] - PEVENT]
        1. UP TO YOU
      3. Action: Zapier Table - Delete Record
        1. Table: Queue - Records
      4. Action: Webhook - POST
        1. This will retrigger the same Zap 3
        2. Use the webhook url from Zap 3, Step 1
        3. Include a timestamp parameter
          1. Help: https://zapier.com/help/create/customize/insert-the-time-your-zap-runs-into-a-field
    2. Action: Path B
      1. Action: Filter
        1. Continue if Step 2 records count = 0
      2. Action: Zapier Table - Find Record
        1. Table: Queue - Control
      3. Action: Zapier Table - Delete Record
        1. Table: Queue - Control
          1. Used to delete the existing record

Hello ​@Troy Tessalone,

Thank you for the detailed, step-by-step response to be able to implement a sequential queue processing system within Zapier, especially making it so we don’t use tasks to use it! 🤓

As you mention, your solution is complex, and for my use case it would add too much complexity without much benefit (for my specific use case, waiting 30-45 seconds to get our result doesn’t affect negatively our user experience, making a simple delay after queue enough to fulfill the sequential requirement).

Nevertheless, thank you for showing me how you would implement it! If anyone else has an easier approach, please share it as well! 


Reply