Problem: loop node doesnt loop through every items provided

Hello everyone,

I am currently developing an n8n workflow that reads all sheets from an Excel (.xls) file and extracts all the data inside it.

I have successfully read all rows from all sheets in the Excel file. However, I am facing two issues during processing.

Problems:

  • First: Loop processes fewer items than expected

    After grouping the extracted data (7,640 program schedules) by day, I end up with 329 items, where each item represents one day.

    When I pass these 329 items into a loop to handle the data day by day, the loop only processes 61 items, as shown in the execution screenshot I attached.

  • Second: Workflow stops before inserting into the database

    All data is correctly passed into the Pass Programs node, but the workflow stops executing at that point and does not insert any records into the database.

    I have already verified the syntax and logic, but the insertion still does not occur.

What I’m looking for

  • An explanation of the looping behavior

  • Suggestions on how to ensure all items are processed

  • Possible reasons why the workflow stops before the database insert

Thank you very much for your time and support. I would really appreciate any help or insights.

Hey @TrinhNhatHuy !

Maybe last iteration had empty result?
Can you check that and see if what the Code node return and stops?

If you enable the “Always output data”, so it can continue even if the output is empty(iy will output an empty array, but it will continue runnig).
Let me know… Cheers!

P.S can t test right now, since i dont have that servixe mysql.:slight_smile:

2 Likes

@Parintele_Damaskin thank you for your response, i have check again and now i have just one issue of passing the output data of previous node to the current one which i have defined in my new topic, you can check it out if you have time.

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