Do same job for different parameters (like function)

Hey,

I am trying to accomplish automatic adding new videos from specified yt channels to playlist.

{
  "nodes": [
    {
      "parameters": {
        "unit": "minutes"
      },
      "name": "Interval",
      "type": "n8n-nodes-base.interval",
      "typeVersion": 1,
      "position": [
        230,
        170
      ]
    },
    {
      "parameters": {
        "resource": "playlistItem",
        "playlistId": "PL_WPKr-S7UlUQVzImLrwdhPUuhuiyKPd_",
        "videoId": "={{$json[\"ID\"]}}",
        "options": {}
      },
      "name": "YouTube",
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        980,
        170
      ],
      "credentials": {
        "youTubeOAuth2Api": "[email protected]"
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$node[\"Get data\"].json[\"id\"].substr(9)}}"
            },
            {
              "name": "title",
              "value": "={{$node[\"Get data\"].json[\"title\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        170
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return items;\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 9)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data",
      "type": "n8n-nodes-base.function",
      "position": [
        830,
        170
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      ID: \"UCFBH3Bdhgh3_cCToEQsUp6Q\"\n    }\n  },\n  {\n    json: {\n      ID: \"UCKd4IDX1J5MJA0UdekJeOug\"\n    }\n  },\n  {\n    json: {\n      ID: \"UCAE3hyVGBraXyYZYSOS-GeQ|\"\n    }\n  }\n]\n\n\n\n\n\n\n\n\n\n\n"
      },
      "name": "YT ids",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        380,
        170
      ]
    },
    {
      "parameters": {
        "url": "=https://www.youtube.com/feeds/videos.xml?channel_id={{$json[\"ID\"]}}"
      },
      "name": "Get data",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        530,
        170
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    }
  ],
  "connections": {
    "Interval": {
      "main": [
        [
          {
            "node": "YT ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns": {
      "main": [
        [
          {
            "node": "Remove old data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data": {
      "main": [
        [
          {
            "node": "YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YT ids": {
      "main": [
        [
          {
            "node": "Get data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data": {
      "main": [
        [
          {
            "node": "Reduce columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

This was working cool for one channel but when I tried to make the same thing for several channels it doesn’t work at all ;/

How to deal with multiply run same nodes but with different input? I tried sth like this, but it was working only for 1st one:

{
  "nodes": [
    {
      "parameters": {
        "unit": "minutes"
      },
      "name": "Interval1",
      "type": "n8n-nodes-base.interval",
      "typeVersion": 1,
      "position": [
        320,
        470
      ]
    },
    {
      "parameters": {
        "resource": "playlistItem",
        "playlistId": "PL_WPKr-S7UlUQVzImLrwdhPUuhuiyKPd_",
        "videoId": "={{$json[\"ID\"]}}",
        "options": {}
      },
      "name": "YouTube1",
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        1200,
        460
      ],
      "credentials": {
        "youTubeOAuth2Api": "[email protected]"
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$node[\"Get data1\"].json[\"id\"].substr(9)}}"
            },
            {
              "name": "title",
              "value": "={{$node[\"Get data1\"].json[\"title\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns1",
      "type": "n8n-nodes-base.set",
      "position": [
        910,
        470
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return items;\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 9)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data1",
      "type": "n8n-nodes-base.function",
      "position": [
        1050,
        460
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCKd4IDX1J5MJA0UdekJeOug"
      },
      "name": "Get data1",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        610,
        390
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCFBH3Bdhgh3_cCToEQsUp6Q"
      },
      "name": "Get data2",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        610,
        540
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    }
  ],
  "connections": {
    "Interval1": {
      "main": [
        [
          {
            "node": "Get data1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns1": {
      "main": [
        [
          {
            "node": "Remove old data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data1": {
      "main": [
        [
          {
            "node": "YouTube1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data1": {
      "main": [
        [
          {
            "node": "Reduce columns1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data2": {
      "main": [
        [
          {
            "node": "Reduce columns1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Thanks in advance!

Saw that you are using static data. Did you active the workflow? because static data it’s only persisted when the workflow is active.

Yes sir,

It’s do nothing, I see it is working but nothing really happen:

But if I will put channel id manually instead of giving it as expression then it’s working

Did you inspect the execution? You can click on the orange folder like button in the right and check the values each node returned. Perhaps, that helps you find what might be happening.

1 Like

Hey @Shirobachi!

I inspected your workflow and found out that you’re referencing only the Get data1 RSS node in your Reduce Columns1 node. There are two different ways you can resolve this. I am sharing both the solutions here.

  1. Add a NoOp node
    Currently, you’re referring to the data only from one of the RSS nodes. Add a NoOp node between the RSS nodes and the Set node and refer to the values from the Current Node under the Variable Selector section.
    Here’s the updated workflow
{
  "nodes": [
    {
      "parameters": {
        "unit": "minutes"
      },
      "name": "Interval1",
      "type": "n8n-nodes-base.interval",
      "typeVersion": 1,
      "position": [
        477,
        364
      ]
    },
    {
      "parameters": {
        "resource": "playlistItem",
        "playlistId": "PL_WPKr-S7UlUQVzImLrwdhPUuhuiyKPd_",
        "videoId": "={{$json[\"ID\"]}}",
        "options": {}
      },
      "name": "YouTube1",
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        1600,
        350
      ],
      "credentials": {
        "youTubeOAuth2Api": "[email protected]"
      }
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$json[\"id\"].substr(9)}}"
            },
            {
              "name": "title",
              "value": "={{$json[\"title\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns1",
      "type": "n8n-nodes-base.set",
      "position": [
        1200,
        350
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return items;\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 9)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data1",
      "type": "n8n-nodes-base.function",
      "position": [
        1400,
        350
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCKd4IDX1J5MJA0UdekJeOug"
      },
      "name": "Get data1",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        767,
        284
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCFBH3Bdhgh3_cCToEQsUp6Q"
      },
      "name": "Get data2",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        767,
        434
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1000,
        350
      ]
    }
  ],
  "connections": {
    "Interval1": {
      "main": [
        [
          {
            "node": "Get data1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns1": {
      "main": [
        [
          {
            "node": "Remove old data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data1": {
      "main": [
        [
          {
            "node": "YouTube1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data1": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data2": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NoOp": {
      "main": [
        [
          {
            "node": "Reduce columns1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
  1. Fetch the ID from a db
    I would store the URL (or just the ID) of the channels in a DB (Airtable) and fetch it using the respective node. This allows me to add multiple channels without adding multiple RSS nodes. The workflow for it would look like the image below.

Hope this helps :slight_smile:

I am sorry I missed you message, I did not know that I can do that. Thanks a lot, this gonna help me a lot!

1 Like

Thank you for this, the 1st solution work for me the best!

For future user, I will share nodes with loremRSS:

{
  "nodes": [
    {
      "parameters": {
        "interval": 10
      },
      "name": "Interval1",
      "type": "n8n-nodes-base.interval",
      "typeVersion": 1,
      "position": [
        450,
        270
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$json[\"guid\"]}}"
            },
            {
              "name": "title",
              "value": "={{$json[\"pubDate\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns1",
      "type": "n8n-nodes-base.set",
      "position": [
        1170,
        260
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return [items[0]];\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 9)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data1",
      "type": "n8n-nodes-base.function",
      "position": [
        1370,
        260
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://lorem-rss.herokuapp.com/feed?interval=2&length=20&unit=second"
      },
      "name": "Get data1",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        740,
        190
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {
        "url": "https://lorem-rss.herokuapp.com/feed?interval=3&length=20&unit=second"
      },
      "name": "Get data2",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        740,
        340
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {},
      "name": "NoOp",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        970,
        260
      ]
    },
    {
      "parameters": {
        "webhookUri": "https://discord.com/api/webhooks/814217605581373480/1n0tSrP1w0a_ETZhYWLFjMsry2Z8iPDTVrKAW6chBkerJD50YvBT0SJwsFFfuSYIzc87",
        "text": "={{$json[\"title\"]}}"
      },
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 1,
      "position": [
        1570,
        260
      ]
    }
  ],
  "connections": {
    "Interval1": {
      "main": [
        [
          {
            "node": "Get data1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get data2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns1": {
      "main": [
        [
          {
            "node": "Remove old data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data1": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data1": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data2": {
      "main": [
        [
          {
            "node": "NoOp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NoOp": {
      "main": [
        [
          {
            "node": "Reduce columns1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Again thanks a lot <3

2 Likes

Thanks @Shirobachi for sharing the solution! :sparkling_heart:

I am sorry, I just wanted to ask again for help with some think,

I just don’t understand why your second solution work, but mine wasn’t. Your first solution is great, I just wanted to use the mock data I’ve got this

{
  "nodes": [
    {
      "parameters": {
        "interval": 10
      },
      "name": "Interval1",
      "type": "n8n-nodes-base.interval",
      "typeVersion": 1,
      "position": [
        340,
        230
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$json[\"guid\"]}}"
            },
            {
              "name": "title",
              "value": "={{$json[\"pubDate\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns1",
      "type": "n8n-nodes-base.set",
      "position": [
        940,
        230
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return [items[0]];\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 9)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data1",
      "type": "n8n-nodes-base.function",
      "position": [
        1120,
        230
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "={{$json[\"ID\"]}}"
      },
      "name": "Get data1",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        740,
        230
      ],
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    },
    {
      "parameters": {
        "webhookUri": "https://discord.com/api/webhooks/814217605581373480/1n0tSrP1w0a_ETZhYWLFjMsry2Z8iPDTVrKAW6chBkerJD50YvBT0SJwsFFfuSYIzc87",
        "text": "={{$json[\"title\"]}}"
      },
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 1,
      "position": [
        1280,
        230
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      ID: \"https://lorem-rss.herokuapp.com/feed?interval=2&length=20&unit=second\"\n    }\n  },\n  {\n    json: {\n      ID: \"https://lorem-rss.herokuapp.com/feed?interval=3&length=20&unit=second\"\n    }\n  }\n]\n"
      },
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        550,
        230
      ]
    }
  ],
  "connections": {
    "Interval1": {
      "main": [
        [
          {
            "node": "Function1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns1": {
      "main": [
        [
          {
            "node": "Remove old data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data1": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get data1": {
      "main": [
        [
          {
            "node": "Reduce columns1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function1": {
      "main": [
        [
          {
            "node": "Get data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

When N8N know that should loop over all items like you’ve done for me and when do like here that take only first one.

Can I found in the web something what will let me better understand it?

Thanks

Hey @Shirobachi,

The RSS node doesn’t handle looping currently. You can find other exceptions here: Looping in n8n | Docs (The RSS node is not mentioned there, we’ll update the docs soon!)

1 Like

I made some changes what maybe be helpful for someone:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        -740,
        390
      ],
      "disabled": true
    },
    {
      "parameters": {},
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -570,
        380
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "webhookUri": "https://discord.com/api/webhooks/814217605581373480/1n0tSrP1w0a_ETZhYWLFjMsry2Z8iPDTVrKAW6chBkerJD50YvBT0SJwsFFfuSYIzc87",
        "text": "=The workflow named '{{$json[\"workflow\"][\"name\"]}}' with the ID {{$json[\"workflow\"][\"id\"]}} has encountered an error. The last node that was executed was {{$json[\"execution\"][\"lastNodeExecuted\"]}}."
      },
      "name": "Error info",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 1,
      "position": [
        -420,
        380
      ]
    },
    {
      "parameters": {
        "webhookUri": "https://discord.com/api/webhooks/814217605581373480/1n0tSrP1w0a_ETZhYWLFjMsry2Z8iPDTVrKAW6chBkerJD50YvBT0SJwsFFfuSYIzc87",
        "text": "={{$json[\"title\"]}}"
      },
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "typeVersion": 1,
      "position": [
        530,
        730
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "ID",
              "value": "={{$json[\"pubDate\"].substr(9)}}"
            },
            {
              "name": "title",
              "value": "={{$json[\"title\"]}}"
            }
          ],
          "number": []
        },
        "options": {}
      },
      "name": "Reduce columns",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        740
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIDs = items.map(item => item.json[\"ID\"]);\nconst oldIDs = staticData.data; \n\nif (!oldIDs) {\n  staticData.data = newIDs;\n  return [items[0]];\n}\n\nconst actualNewIDs = newIDs.filter(id => !oldIDs.includes(id));\nconst actualNewData = items.filter((data) => actualNewIDs.includes(data.json['ID']));\nstaticData.data = [...actualNewIDs, ...oldIDs];\n\nif(actualNewData.length > 99)\n  return actualNewData.slice(0,1)\n\nreturn actualNewData;\n"
      },
      "name": "Remove old data",
      "type": "n8n-nodes-base.function",
      "position": [
        330,
        720
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        -770,
        720
      ]
    },
    {
      "parameters": {
        "functionCode": "\n\treturn [\n\t\t{\n\t\t\tjson: {\n\t\t\t\turl: \"https://lorem-rss.herokuapp.com/feed?unit=second&interval=2\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tjson: {\n\t\t\t\turl: \"https://lorem-rss.herokuapp.com/feed?unit=second&interval=3\"\n\t\t\t}\n\t\t}\n\t]\n"
      },
      "name": "Source list",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        -630,
        720
      ]
    },
    {
      "parameters": {
        "functionCode": "const staticData = this.getWorkflowStaticData(\"node\");\n\nif (items.length > 1 && items[0].json.url != undefined){\n  result = items.pop()\n  staticData.data = items\n  return [ result ]\n}\nelse if(staticData.data.length > 0){\n  return [ staticData.data.pop() ]\n}\nelse{\n  return []\n}\n"
      },
      "name": "Looper",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        -430,
        720
      ]
    },
    {
      "parameters": {
        "url": "={{$json[\"url\"]}}"
      },
      "name": "RSS get",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1,
      "position": [
        -170,
        570
      ],
      "retryOnFail": true,
      "continueOnFail": true,
      "notes": "https://socialnewsify.com/get-channel-id-by-username-youtube/"
    }
  ],
  "connections": {
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Error info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reduce columns": {
      "main": [
        [
          {
            "node": "Remove old data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove old data": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron": {
      "main": [
        [
          {
            "node": "Source list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Source list": {
      "main": [
        [
          {
            "node": "Looper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Looper": {
      "main": [
        [
          {
            "node": "RSS get",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RSS get": {
      "main": [
        [
          {
            "node": "Reduce columns",
            "type": "main",
            "index": 0
          },
          {
            "node": "Looper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
2 Likes