Looping - Data just passing by without a new HTTP request

Describe the problem/error/question

I am trying to create a loop. The node IF should check if pdf is already generated by the system, if not then wait 5 seconds and then make the http request again.

The problem: it’s just passing the same information over and over again instead of doing a new request at http node.

In the end it becomes an endless loop without any result

Did I miss something to create a loop?

Please share your workflow

Information on your n8n setup

  • n8n version: 0.236.2
  • Database (default: SQLite): MariaDB
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: QNAP

Hi @chrisade - looking at your email trigger node, it’s not downloading attachments - how is the PDF being pulled into the n8n workflow? It looks like your HTTP Request node is the one checking to see if the invoice already exists?

PDF will not pulled into n8n. I just need the link for that pdf.

Yes it’s true, Email trigger will just passing the email, because what I need is only the subject from the email. It will be like this:
"subject": "Your Reservation #589"

That number is the Reservation ID, so in HTTP node, it will parsing that number and make a request to pull some data for that ID.
The output is something like this:

"invoice": "https://www.domain.com/invoices/generated/586_1906867222.pdf"

but sometimes

"invoice": ""

Why empty? because there is a cronjob that running the invoice generator. I set the cronjob to run every Minutes.

Here comes the tricky part. When the invoice is empty, I want tocheck every 5 seconds if the link for that invoice is there. However, when I implement this, I’m encountering an issue. Instead of making a new request after the wait period, the system seems to be stuck in an infinite loop, repeatedly passing the same empty invoice data ("invoice": "").

Question: Why it’s doing so? I wish a new request in HTTP node after wait node.

Hey @chrisade,

Can you try the below workflow and let me know if that works.


Hey @Jon , it works!
Thank you very much!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.