Splitting an item into 2 and then looping via split batch

Hi all ,

I am working with the below workflow.

I have split 1 item with 2 binary files (PDFs) into 2 separate items using a code block. However, when i send those 2 items to an HTTP node via a split in batches node, both the items get sent to the HTTP node rather than looping around. I have also tested this with a wait node in between the HTTP and the split in batches node and both files are sent to the wait node once (wait only executes once rather than twice in a loop) rather that iteratively looping twice.

How do i fix?

I have modified the Batch size to 1, however what im seeing now is that only 1 item (the first one) is passed to the HTTP node, and then it skips the “done” route completely and moves down to a branch below. The second item/file is just not passing the the HTTP node at all.

I also tried connecting the HTTP output back to the input of split batch but this results in a continuously loop of the first item, and the second item appears to just be ignored.

Below you can see what im trying to explain. Note the fact that only 1 item is passed to HTTP, and that Wait4 is completely unexecuted and once the HTTP node has executed for the first item the flow moves to the set in the bottom branch (where theres an error).

After aimlessly changing setting and pushing buttons (which is how i generally solve problems) I seem to have got it to work as intended.

The Wait5 and subsequent HTTPs nodes now run sequentially for each item coming out of the Code node into the Split in Batches node. What seems to have ultimately solved the issue is looping back after the HTTPS to the split block. I could have sworn i tried this configuration previously with no success, unsure why it didnt work then but works now.

Screenshot 2023-08-31 at 4.28.34 pm

Self high five for the (painful and many hours wasted) self-solve

1 Like

Hi @Nikto655,

Nice to see you have managed to work it out, Out of interest while working on this did you check the docs or workflow templates at all? I am just trying to work out if we need to make the looping process clearer in the docs or if it was maybe just missed.

Needs to be clearer imho. Although im relatively speaking a noob so maybe it just wasnt super clear for me. I looked at the docs.

I did not need the data from the loop to pass back to the start of the loop so in my mind it should have ran in for all the inputs until all the input data to the Split in batches was done WITHOUT needing to loop it back with the connector from the HTTP node.

What also didnt help, although not something you control, is that Chatgpt kept telling me if i do not need to loop the output data of the HTTP block back, i dont need to loop the connector.

Ill also say that there are things in your docs that are not clear (perhaps again to the uninitiated like me), for example:

*** Reset: if set to true, the node will reset.**

I still do not understand what this means. My only solution is to run tests to try to figure out what the difference is between having this on/off, which burns a lot of time.

1 Like

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