n8n Workflow

Send New Youtube Channel Videos To Telegram

This n8n workflow automates tasks using Other Tools. Send New Youtube Channel Videos To Telegram - ready to import and run in your n8n instance.

n8n workflow.json

About This Script

This n8n workflow automates tasks using Other Tools. Send New Youtube Channel Videos To Telegram - ready to import and run in your n8n instance.
Features:
  • Custom JavaScript function processing
  • Integrates with Other Tools
  • Sends notifications or updates
Source Code
{
    "nodes": [
        {
            "name": "Set",
            "type": "n8n-nodes-base.set",
            "position": [
                500,
                510
            ],
            "parameters": {
                "values": {
                    "string": [
                        {
                            "name": "id",
                            "value": "={{$node[\"GetVideosYT\"].json[\"id\"][\"videoId\"]}}"
                        },
                        {
                            "name": "url",
                            "value": "=https://youtu.be/{{$node[\"GetVideosYT\"].json[\"id\"][\"videoId\"]}}"
                        },
                        {
                            "name": "title",
                            "value": "={{$node[\"GetVideosYT\"].json[\"snippet\"][\"title\"]}}"
                        }
                    ],
                    "boolean": []
                },
                "options": [],
                "keepOnlySet": true
            },
            "typeVersion": 1,
            "id": "783f4095-bee0-459b-aad5-d4bdf01f604a"
        },
        {
            "name": "Function",
            "type": "n8n-nodes-base.function",
            "position": [
                640,
                510
            ],
            "parameters": {
                "functionCode": "const new_items = [];\nconst data = this.getWorkflowStaticData('node');\n\ndata.ids = data.ids || [];\n\nfor (var i=0; i<items.length; i++) {\n  if (data.ids.includes(items[i].json.id)) {\n    break;\n  } else {\n    new_items.push({json: {id: items[i].json.id, url: items[i].json.url, title: items[i].json.title}});\n  }\n}\n\ndata.ids = items.map(item => item.json.id)\nreturn new_items;\n"
            },
            "typeVersion": 1,
            "id": "c67e763d-5fde-47a3-83b6-8e4c9aaa3a61"
        },
        {
            "name": "CheckTime",
            "type": "n8n-nodes-base.interval",
            "position": [
                210,
                510
            ],
            "parameters": {
                "unit": "minutes",
                "interval": 30
            },
            "typeVersion": 1,
            "id": "dcaa9646-4d76-4e74-ae4f-3c3520b8bb09"
        },
        {
            "name": "GetVideosYT",
            "type": "n8n-nodes-base.youTube",
            "position": [
                370,
                510
            ],
            "parameters": {
                "limit": 4,
                "filters": {
                    "channelId": "UCTe5YtigJdZZ3i-za6IkbGQ"
                },
                "options": {
                    "order": "date"
                },
                "resource": "video"
            },
            "credentials": {
                "youTubeOAuth2Api": "tubo"
            },
            "typeVersion": 1,
            "id": "150c9e36-140f-4f2b-93f1-e00afaefc028"
        },
        {
            "name": "SendVideo",
            "type": "n8n-nodes-base.telegram",
            "position": [
                790,
                510
            ],
            "parameters": {
                "text": "=Nuovo video di almi su YouTube!\n<b>{{$node[\"Function\"].json[\"title\"]}}</b>\n\n{{$node[\"Function\"].json[\"url\"]}}",
                "chatId": "-1001178002763",
                "additionalFields": {
                    "parse_mode": "HTML"
                }
            },
            "credentials": {
                "telegramApi": "bot raspino"
            },
            "typeVersion": 1,
            "id": "4bf44c4d-ddbf-4311-b1ec-0ec3488caa90"
        }
    ],
    "connections": {
        "Set": {
            "main": [
                [
                    {
                        "node": "Function",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Function": {
            "main": [
                [
                    {
                        "node": "SendVideo",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "CheckTime": {
            "main": [
                [
                    {
                        "node": "GetVideosYT",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "GetVideosYT": {
            "main": [
                [
                    {
                        "node": "Set",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "n8n_version": "1.5.0"
}
Requirements
n8n instance, Telegram API credentials
Tags
#n8n #automation #workflow
Quick Actions
More in n8n Workflows