"Collector" node?

Is there a way to collect results of a node?

For example. I want to get all today’s events from google calendar and send “agenda” email. For now “GCal” node will produce as many results as much events I have and each individual event gets passed to “email” node.

So. Is there a way to somehow collect results?

Welcome to the community @H1D!

Sadly is there no specific node for that yet. You can however do for now the following:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "const properties = ['summary'];\n\nconst entries = [];\nfor (const item of items) {\n  entries.push(`${item.json.summary} at ${item.json.start.dateTime}`);\n}\n\nreturn [\n  {\n    json: {entries},\n  }\n]\n"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        701,
        446
      ]
    }
  ],
  "connections": {}
}

Ah and if you want to have directly a simply string you can simply change it a little bit. But that could also be done in the expression you reference the data in:

{
  "nodes": [
    {
      "parameters": {
        "functionCode": "const properties = ['summary'];\n\nconst entries = [];\nfor (const item of items) {\n  entries.push(`${item.json.summary} at ${item.json.start.dateTime}`);\n}\n\nreturn [\n  {\n    json: {\n      entries: entries.join('\\n'),\n    },\n  }\n]\n"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        701,
        446
      ]
    }
  ],
  "connections": {}
}

Awesome! Thanks a lot.

You are welcome. Have fun!