I want to build auto-numbering in a Notion database. I catch new records with the Notion trigger and want to run a loop: read saved “current number” from another source and increment it, save this number to the _id property in Notion.
So i have to build a loop with the Split in Batches node. The problem, it’s not working in active mode. Just nothing happens when I add new records.
So i tried some experiments with a simple case - just to set a fixed number in the _id property
The top workflow works ok whith any new records within the polling interval.
The bottom workflow doesn’t work as a trigger. When I run it, the last record is processed, as usual.
Are you activating the workflow? Because if you execute the workflow via de UI (test mode), the node only returns the last record in the database. This is meant for testing purposes only. If you active the workflow (production mode), n8n poll the data from the API using the unit of time you selected from the UI.
@RicardoE105 Yes, of course.
Let me summorize my experiment with loops:
When active, the simple loop (without Split) works, it catches all the new records.
When active, the loop with Split doesn’t fire on any number of new records
To check, if the workflow from (2) is valid, I execute it. It works, processing the last new record
So the problem is that the data from the Trigger doesn’t work properly with the Split node. Actually this means we can’t work with the trigger in many use cases. Like processing the data and saving it to the file. Or auto-numbering. Or processing and saving in a Database. Or synking with other services. All of them require looping.
So far I know for sure one thing. Notion trigger MAY NOT catch all the new items. I run many small experiments. And when added multiple rows, some of them were not processed.
Does it or does not work with Split in Batches? The Split in Batches node should not be an issue. And you probably do not need it for most use cases since n8n automatically iterate for as many inputs as the node has.
Can you record a small video where I can see the issue?
The problem is not in Split in batches. Because in general it works.
Please take a look, 2 records are not processed:
I have to use Split in Batches, because I have multiple operations in the loop. If I counted on automatical iteration, it would iterate onle the first node in the loop, I guess. I marked it with red:
@RicardoE105I I seem to find the problem. If the trigger fired at some minute, it won’t fire in the rest of this minute, if new records added. You can see that I added some data in the same minute the process started. And it just didn’t see the new data (red rectangles). When I waited, it was fine (green rectangles)