Is this a Valid Workflow?

Describe the problem/error/question

In this workflow I want to execute/call and API which will return around 100 records in JSON format in each call. This means that all the nodes after this node will get executed 100 times. Am I correct here?

Then I want to check if the data of each returned row exist in DB. It Data Exist then I want to update the data and if Data does not Exist then I want to insert the data.

Here as you can I have linked the HTTP Request Node to Update Row in Supabase and Insert Row in Supabase nodes. I had to do this because I am not able to access the data returned by the HTTP Request node from Supabase Nodes. I don’t know if this is the correct thing to do or not.

Because of this what is happening is that n8n first executes the fist part directly from HTTP Request to Update Row in Supabase and executes the Check if Permit Number Exist node and then again executes Update Row in Supabase followed by Insert Row in Supabase and finally Insert Row in Supabase is executed again and this gets timed out.

What is the error message (if any)?

The workflow is getting timed out.

Please share your workflow

Please help me build the workflow to get it to work properly.

hi @YogiYang

It depends on the output format for your API. If it returns one record as one n8n item, then yes

No, it’s not correct. You should be able to link your HTTP Requests node to the end Supabase nodes without any issues. The only tricky part here is if the HTTP node returns binary data.

That’s because you have linked two arrows to one-input Supabase node. So it means, that it will be executed for 300+10 times for the upper node and 300+290 times for the bottom one

1 Like

Thank you for replying to my queries.

As per what is shown by n8n it is able to recognize and separate each item returned by the API. But I don’t understand why does it execute the API 10 times in one go instead of first executing the HTTP Request then processing next steps and then coming back to HTTP Request.

What mistake am I making here?

The data returned by HTTP Request is in JSON format.
How to link my HTTP Request node to Supabase node?

if I understand you correctly, that happens because the node has more than 1 input item (in the screen you can see that Item List node has outputted 3 items, so the next HTTP node will executes 3 times and outputs 3x100 items to the next node).

Basically, if the node has more than 1 input items, it will be executed for each item and only then the flow will proceed to the next node. You can change this behaviour by using Split in batches node after the first HTTP node and set Split to 1 item, so the next nodes will work only with one item at a time.

2 Likes

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