Best answer

Looping by Zapier run steps sequentially.

  • 28 October 2022
  • 7 replies
  • 626 views

Userlevel 2
Badge

So I just realized that Zap run in parallel rather than sequentially. I tried Delay after Queue, however, this doesn’t seem to guarantee that steps run one after another especially since I am using Storage by Zapier to share data between steps. Is there any way to set this up or is this not possible with Zapier?

icon

Best answer by MohSwellam 1 November 2022, 13:31

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 7
Badge +11

Hi @arkhamknighthell!

That’s a tricky one. Can you elaborate a bit on the setup? What are you running through that Zap? That could help us see if there’s some sort of workaround or workflow that could solve your problem.

Thanks!

Userlevel 2
Badge


Hello @nicksimard,

Yes I’ve noticed that this can be tricky. Basically what I am trying to do is run python in each loop (due to API limitations I can only grab partial results). Then using storage by Zapier accumulate the results from the output of the API call. After that I exit the loop grab all of the results and take an average of them. I can’t internally run a for loop on the single python step due to the timeout of 10 seconds after 2 or 3 API calls. The problem isn’t running them parallel that would be fine if all the loops could all send their results so I could combine them at the end.

 

Userlevel 7
Badge +8

Hi @arkhamknighthell 

 

Maybe you should try Digest by Zapier instead of Storage by Zapier? 

 

Also, what do you mean by exiting the loop? The loop works on the steps after it. From what I can see there is no way to create a separate step after the Loop. 

Userlevel 2
Badge

@MohSwellam 

I was referring to the loop_iteration_is_last item which I can filter and only runs the subsequents steps after the last loop according to https://help.zapier.com/hc/en-us/articles/8496106701453-Loop-your-Zap-actions#frequently-asked-questions-0-4.

Userlevel 7
Badge +8

Thanks for the update @arkhamknighthell . But in this case this step is not being triggered for all the loops so how is the script running or how is the Storage working? What are the steps exactly? 

 

Maybe sue a Webhook to end the zap on the last iteration and another Webhooks to start a new zap that has the storage? Just an idea

Userlevel 4
Badge +7

Hey @arkhamknighthell, I just wanted to toss in an idea -- What about Delay by Zapier using the “Delay by Queue” action?  If you put that in the loop, even if the runs are parallel, they are still not “truly parallel” if you will with regards to how quickly all of the actions will run.  Since it is on the order of milliseconds, to us it is “instant” but Zapier will process each individually as soon as a worker grabs that request and process’ it.  This means that there will be some sort of sequential nature to this since they won't all run at the exact same time in parallel by a single computer.  It might be something neat to try to see if it helps but it could also introduce other issues as well.

Userlevel 2
Badge

@MohSwellam 

Actually digest by Zapier did the trick, there are other issues, but have nothing to do with looping. As for Delay By Queue, I’ll have to try adding it at the end of the queue.