{
  "name": "Auto-track YouTube stats & channel data in Notion database",
  "nodes": [
    {
      "id": "02c8e1dc-ac9a-4090-9fef-e07ec92b87f3",
      "name": "New Video URL (Notion Trigger)",
      "type": "n8n-nodes-base.notionTrigger",
      "position": [
        -1472,
        80
      ]
    },
    {
      "id": "6945d42d-45b9-46a5-8bef-13e68b84e0f9",
      "name": "Extract YouTube Video ID",
      "type": "n8n-nodes-base.set",
      "position": [
        -1200,
        80
      ]
    },
    {
      "id": "1c3af437-6151-403b-bf96-98f9ac36d987",
      "name": "Fetch Video Data (YouTube API)",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -976,
        80
      ]
    },
    {
      "id": "2017b4ae-428c-483c-8d76-8e061239e93a",
      "name": "Fetch Channel Info (YouTube API)",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -832,
        400
      ]
    },
    {
      "id": "0b3df2d9-b6f5-4112-9723-e3c6c3e9ac94",
      "name": "Format Video Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -480,
        80
      ]
    },
    {
      "id": "7f986f0d-dc08-4ce2-b8af-15f3f564348b",
      "name": "Format Channel Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -480,
        400
      ]
    },
    {
      "id": "8872828f-e24f-4a5f-8778-8dbecec88c51",
      "name": "Merge Video + Channel Info",
      "type": "n8n-nodes-base.merge",
      "position": [
        -256,
        96
      ]
    },
    {
      "id": "dc3937c8-99e6-4147-861c-6616bcc731ed",
      "name": "Update Notion Page",
      "type": "n8n-nodes-base.notion",
      "position": [
        -16,
        96
      ]
    },
    {
      "id": "28f40051-1ce3-48fe-b8e2-a459f37b43be",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -1104
      ],
      "parameters": {
        "width": 848,
        "height": 848,
        "content": "# **Information**\n\n## **Who it's for**\nYouTube creators, content marketers, and anyone who wants to automatically enrich YouTube links added to a Notion database.\n\n## **What it does**\nAutomatically ex"
      }
    },
    {
      "id": "a79cb90d-055a-4fc9-bfcc-eb2522332b13",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -64
      ],
      "parameters": {
        "width": 208,
        "height": 576,
        "content": "Triggers the workflow when a new page is added to the Notion database.\nReads the YT Link field so the workflow knows which video to process."
      }
    },
    {
      "id": "76ca3d9a-bef1-4a7b-ab21-770ca28c3423",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -752
      ],
      "parameters": {
        "width": 768,
        "height": 496,
        "content": "# Watch the walkthrough on YouTube\n[![](https://img.youtube.com/vi/pAuKTI-n8G4/hqdefault.jpg)](https://www.youtube.com/watch?v=pAuKTI-n8G4)"
      }
    },
    {
      "id": "5eac24b0-c2df-4e51-9c99-6e5c174af39f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        -64
      ],
      "parameters": {
        "width": 208,
        "height": 576,
        "content": "Extracts the video ID from the YouTube URL so the YouTube API can get stats."
      }
    },
    {
      "id": "47b1d9ba-2430-438b-9222-f2df979200a1",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        256
      ],
      "parameters": {
        "width": 192,
        "height": 256,
        "content": "Gets channel-level data including channel name and subscriber count."
      }
    },
    {
      "id": "12513564-bb10-455c-b67c-e0daf2884e44",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -64
      ],
      "parameters": {
        "width": 192,
        "height": 256,
        "content": "Cleans and structures video fields (views, likes, comments, thumbnail) into a consistent format for updating Notion."
      }
    },
    {
      "id": "02abd7f1-14bc-499c-a3cc-9840911eea98",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        256
      ],
      "parameters": {
        "width": 192,
        "height": 256,
        "content": "Prepares channel-related fields (channel name, subscribers) for merging with video data."
      }
    },
    {
      "id": "b1af7244-2c8d-4ed0-90c7-15776bb49015",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -64
      ],
      "parameters": {
        "width": 192,
        "height": 576,
        "content": "Combines the formatted video and channel data into a single payload used to update Notion.\n"
      }
    },
    {
      "id": "0131fe0c-235b-46a1-a98e-f7f0eb5e7045",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -64
      ],
      "parameters": {
        "width": 192,
        "height": 576,
        "content": "Updates the same Notion page with all enriched fields: title, views, likes, comments, thumbnail, subscribers, channel name, and viral score.\n"
      }
    },
    {
      "id": "710d1d45-14c5-4d4b-a629-f6b04b9064a9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -240
      ],
      "parameters": {
        "width": 464,
        "height": null,
        "content": "Starts the workflow when a new Notion page is added and extracts the YouTube video ID from the provided URL."
      }
    },
    {
      "id": "61c6ebca-f35c-4825-82bb-075e3b6532b6",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -240
      ],
      "parameters": {
        "width": 352,
        "height": null,
        "content": "Calls the YouTube API twice to retrieve video statistics and channel-level information needed for enrichment."
      }
    },
    {
      "id": "8b44ce20-01e3-4b90-b272-df94ad929827",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -240
      ],
      "parameters": {
        "width": 304,
        "height": null,
        "content": "Cleans and structures both video and channel fields so they can be merged into a single, consistent payload."
      }
    },
    {
      "id": "bef3938a-afd3-439c-ba40-a8dcf91ba304",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -240
      ],
      "parameters": {
        "width": 432,
        "height": null,
        "content": "Combines all formatted fields and updates the same Notion row with enriched video and channel data."
      }
    },
    {
      "id": "1491d1b4-3ead-44a8-9bbf-c0ea6384b2ac",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -64
      ],
      "parameters": {
        "width": 192,
        "height": 256,
        "content": "Uses the YouTube API to fetch video details including title, views, likes, comments, and thumbnail."
      }
    }
  ],
  "connections": {
    "Format Video Data": {
      "main": [
        [
          {
            "node": "Merge Video + Channel Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Channel Data": {
      "main": [
        [
          {
            "node": "Merge Video + Channel Info",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract YouTube Video ID": {
      "main": [
        [
          {
            "node": "Fetch Video Data (YouTube API)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Video + Channel Info": {
      "main": [
        [
          {
            "node": "Update Notion Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Video Data (YouTube API)": {
      "main": [
        [
          {
            "node": "Format Video Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Channel Info (YouTube API)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Video URL (Notion Trigger)": {
      "main": [
        [
          {
            "node": "Extract YouTube Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Channel Info (YouTube API)": {
      "main": [
        [
          {
            "node": "Format Channel Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}