How to retrieve all executions data of a node?

Hello,
I began to use n8n in order to generate some KPI reports over Stripe API.
I manage to handle Stripe pagination but I have struggle to return merged data of my HTTP request node executions.
I used $items(‘My node’) which should return all the data of the different execution for a node according to the doc but it seems not working, may be it’s not the right way to use it.
Can you give me us some hints how to merge all execution data of a specific node?

Here my workflow, if it helps to understand:

Welcome to the community @Kakulukian!

The problem is that the node does not have multiple items it has multiple runs. So you have to iterate over them instead. Here an example how you can do that:

{
  "nodes": [
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$node[\"Increment\"].data[\"counter\"]}}",
              "value2": 5
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        900,
        550
      ]
    },
    {
      "parameters": {},
      "name": "Start Loop",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        500,
        350
      ]
    },
    {
      "parameters": {
        "values": {
          "number": [
            {
              "name": "counter",
              "value": "={{$node[\"Start Loop\"].json[\"counter\"]+1}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Increment",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        700,
        350
      ]
    },
    {
      "parameters": {
        "values": {
          "number": [
            {
              "name": "counter",
              "value": 1
            }
          ]
        },
        "options": {}
      },
      "name": "Init Counter",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        300,
        350
      ]
    },
    {
      "parameters": {
        "functionCode": "const allData = []\n\nlet counter = 0;\ndo {\n  try {\n    const items = $items(\"Increment\", 0, counter).map(item => item.json);\n    allData.push.apply(allData, items);\n    //allData.push($items(\"Increment\", 0, counter));\n  } catch (error) {\n    return [{json: {allData}}];  \n  }\n\n  counter++;\n} while(true);\n\n\n"
      },
      "name": "Merge Data",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1100,
        550
      ]
    }
  ],
  "connections": {
    "IF": {
      "main": [
        [
          {
            "node": "Start Loop",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Loop": {
      "main": [
        [
          {
            "node": "Increment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Increment": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Init Counter": {
      "main": [
        [
          {
            "node": "Start Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Thanks for your answer :slightly_smiling_face:
I came with a solution pretty similar but it iterates over last runIndex of the node, your solution works pretty well too!
Keep up the good work on n8n, can’t wait discover more features :+1:

Ah great to hear that you also found a solution.

Have fun!