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.
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?
@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)