Skip to main content
Question

Zapier Loop is not waiting for ChatGPT to finish

  • January 4, 2024
  • 3 replies
  • 89 views

Vlado

Hi! 

I have an GSheet with the pipeline of prompts for chatGPT and they should be feed into the ChatGPT conversation after each other. For example of the simplified GSheet might look like this:

ID Prompt
prompt1 Calculate 1 + 1
prompt2 Add 5 to the result
prompt3 Multiply the result by 3

(oversimplification, there is a prompt engineering reason I need that this way)

 

So I’ve decided to use “Loop” by Zapier to loop through the prompt rows in the GSheet, in hope that the loop would wait for the answer from ChatGPT before it continues to the next step. After a few hours solving errors I’ve realized that the “Loop” is not waiting for the ChatGPT to finish it’s output and it right away continues to the next prompt and unsuccessfully tries to feed it into the ChatGPT conversation that is already running. The “loop” doesn’t behave like a loop but rather like a multithreading. Is this behavior intentional?

 

Please, do you have any ideas how to create a workaround for this? 

 

 

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

3 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • January 4, 2024

Hi @Vlado 

You will need to introduce a Delay For or Delay After Queue within the Loop.

https://zapier.com/help/create/customize/add-delays-to-zaps#delay-after-queue

 

Check this out:

 


Vlado
  • Author
  • New
  • January 5, 2024

Hey @Troy Tessalone, thank you for fast reply! With your tweet you gave me an idea not only how to solve the issue but even how to make the process cheaper.

There is one more issue that comes with it, each ChatGPT call is taking a different amount of time to generate the response and sometimes when it’s overloaded it may take even longer than expected. Because I have 20 steps in this loop, and I’d make delay for let’s say 5 minutes a single task that usually takes about 6 minutes would now take up to 1 hour and 42 minutes. Is there any way to make the loop continue only after ChatGPT process finishes, without guessing the time?


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • January 5, 2024

@Vlado

You’d have to configure the Zap different to create a chain reaction so that it runs asap. (basically webhook relay)

Check these out: