Send multiple Post requests to HTTP Module

HI,

I wanted to know if it’s possible to send multiple POST requests to an HTTP module

My scenario is like this: Google add row (sends a Chapter from a story) → Chat GPT module (Creates 15 prompts to create images based on the Chapter received from add row module - Json output) → Parse Json Module ->Google Sheet Update Row Module (To update the google sheet) → HTTP module (POST request to generate image using Replicate API)

Everything works as it should if i use only one prompt, and use that to make the API call, I wanted to know, how would I set it up to go through all 15 prompts and send them one by one to the HTTP module?

I have tried to play around with the repeater but I can’t seem to be able to pass through the different prompts.

Any help would be much appreciated!

Thanks

@Andrea_Rossi
Hi, when ChatGPT generates 15 prompts, I think it is making them reply in JSON.
It seems to me that using the following structure for the JSON and using an Iterator after the Parse JSON Module would solve the problem.

{
  "prompts":[
    {
      "promptId":1,
      "prompt": "test1"
    },
    {
      "promptId":2,
      "prompt": "test2"
    },
...
    {
      "promptId":15,
      "prompt": "test15"
    }
  ]
}

I could be wrong and there may be a better way, but I’d be happy to give you some ideas.

3 Likes

yes that works exactly how I wanted, I was thinking about formatting the Json structure differently but I wasn’t sure how to go about it. I appreciate the help, thanks!

4 Likes