Notion Trigger not working with Split in Batches (for auto-numbering)

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.

Here’s the code

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:

  1. When active, the simple loop (without Split) works, it catches all the new records.
  2. When active, the loop with Split doesn’t fire on any number of new records
  3. 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.

Don’t know how, but the Split thing seems to work. Don’t know why it didn’t work yesterday. I’ll conduct some more tests.

1 Like

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.

Like here. They were added in a couple of seconds

Another case. I think, it’s some edge cases either for notion timer of for n8n timer

@RicardoE105, can you have a look at this problem? I know you worked with Notion a lot

What poll time are you using?

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?

I use 1 min poll time.

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:

Another test also gave one unchanged record, whose timing was on the edge, I guess

Here is the Notion page I worked with:

And here is the workflow:

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

So, as long as you do not add data the exact minute the trigger was activated, you should be fine?

I think, yes — the errors happens not always, but when happened I saw this difference in updated time.

My guess is that the “lasr updated time” has some issues to be used as a trigger event.

Maybe there shold be some other approach. Such as storing pages id-s somewhere and comparing them by polling with current pages in the database.

Fot now we have evidences that not all new items are seen by the trigger.

This issue might be related to this one.

1 Like