Memory issues with HTTP request (when scheduled only)

Describe the problem/error/question

So I’m using the Notion API from a HTTP Request node (using the pagination support built-in and page size of 100) and getting out of memory issues when my workflow runs on a schedule (once per hour). Oddly, when I run this manually it runs, and I do see a spike (watching with top from the terminal) on both memory and CPU but then it returns back to “normal” (with node process using about 20% of 1gb of memory). Now I know this machine is not very powerful and I might need to upsize it (1GB memory / shared GPU) but it’s really odd that when I run this manually, it just works!! There are only 2 other Workflows on the machine and are trigger-based so it’s not that the machine is getting swamped. I can see reliably that manual executions work and scheduled ones do not. See attached.

Yes, this is getting nearly 1000 results from the Notion API but again, manages fine in manual mode. I’ve tried changing the pagination page size but that didn’t seem to impact anything. I see recommendations for using a sub-workflow but that would be just for the HTTP Request module: there’s no loop in here, just the pagination capability at work to manage all the “pages”. So I’ve not followed that recommendation.

What is the error message (if any)?

“errorMessage”: “Execution stopped at this node”,
“errorDescription”: “n8n may have run out of memory while running this execution. More context and tips on how to avoid this in the docs”,

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

{
“meta”: {
“instanceId”: “31c842be26f68a85fb03c0cff20f4d057b50612c22b56cb9e78d06cff8eab281”
},
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“field”: “hours”,
“triggerAtMinute”: 40
}
]
}
},
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
-440,
-120
],
“id”: “025a7895-8383-4a63-954f-a1d1e09cdfa3”,
“name”: “Schedule Trigger”
},
{
“parameters”: {
“operation”: “delete”,
“tableId”: “notion_table”,
“matchType”: “allFilters”,
“filters”: {
“conditions”: [
{
“keyName”: “notion_id”,
“condition”: “neq”,
“keyValue”: “={{‘fake-value-no-rows-will-match’}}”
}
]
}
},
“id”: “11f4a4f4-b972-4b47-8bb7-2050ed212485”,
“name”: “Delete all existing records”,
“type”: “n8n-nodes-base.supabase”,
“typeVersion”: 1,
“position”: [
-100,
-280
],
“alwaysOutputData”: true,
“retryOnFail”: true,
“credentials”: {
“supabaseApi”: {
“id”: “id123”,
“name”: “Supabase_Notion”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://api.notion.com/v1/search”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Authorization”,
“value”: “Bearer secret_Junk”
},
{
“name”: “Notion-Version”,
“value”: “2022-06-28”
}
]
},
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “{\n "query": "",\n "page_size": 50,\n "filter": {\n "value": "page",\n "property": "object"\n },\n "sort": {\n "direction": "descending",\n "timestamp": "last_edited_time"\n }\n}”,
“options”: {
“pagination”: {
“pagination”: {
“parameters”: {
“parameters”: [
{
“type”: “body”,
“name”: “start_cursor”,
“value”: “={{ $response.body["next_cursor"] }}”
}
]
},
“paginationCompleteWhen”: “other”,
“completeExpression”: “={{ $response.body["has_more"] == false}}”
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
220,
-120
],
“id”: “b3e796d2-bc26-4bf0-a68c-3b2fcfa5d243”,
“name”: “Get Notion pages”
}
],
“connections”: {
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Delete all existing records”,
“type”: “main”,
“index”: 0
}
]
]
},
“Delete all existing records”: {
“main”: [
[
{
“node”: “Get Notion pages”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}

Share the output returned by the last node

{

“errorMessage”: “Execution stopped at this node”,
“errorDescription”: “n8n may have run out of memory while running this execution. More context and tips on how to avoid this in the docs”,
“errorDetails”: {},
“n8nDetails”: {
“time”: “11/29/2024, 11:18:46 AM”,
“n8nVersion”: “1.66.0 (Self Hosted)”,
“binaryDataMode”: “default”,
“cause”: {
“level”: “error”,
“tags”: {}
}
}
}

Information on your n8n setup

  • n8n version: 1.66
  • Database (default: SQLite): not sure (n8n docker image)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): not sure (n8n docker image)
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n Docker image / self hosted on Digital Ocean
  • Operating system: Ubuntu