How to build a Polling Loop?

Hi everyone,

I’m building a workflow where I need to wait for an external API (specifically D-ID) to finish processing a video. The API returns a status field, which eventually becomes "done" once the video is ready. Until then, it returns "created" or "pending".

I’d like to create a loop that checks the video status every 5 seconds and continues the workflow only when the status equals "done".

As you can see in my workflow, I’m trying to create a loop using an IF node and a Wait node that repeatedly calls get_video and checks whether the video is already finished.

I’m using a Merge node to reconnect the loop, but I have a feeling that this might not be the right approach. Unfortunately, I couldn’t think of a better way.

I’m still quite new to n8n, so I’m always happy to learn new tricks from the pros here in the n8n community.

Thanks for your time.

you don’t need merge, simple connect the false branch to http block

Thy, Ill try that.

1 Like

If that works, you can mark my answer as solution

I guess the wait need to connect to set field _ video_id

Connecting to get_video directly. It won’t get the data from video_id node.

If you are using {{ $json.video_id }} something like this in the get_video node.

It worked very well. Thank you all for your advice!

2 Likes

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