{
  "name": "YouTube to Raindrop",
  "nodes": [
    {
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -610,
        160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "YouTube",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -440,
        240
      ],
      "parameters": {
        "part": [
          "snippet"
        ],
        "options": {},
        "resource": "playlistItem",
        "operation": "getAll",
        "playlistId": "CHANGE_ME"
      },
      "typeVersion": 1
    },
    {
      "name": "Filter new items",
      "type": "n8n-nodes-base.function",
      "position": [
        -120,
        240
      ],
      "parameters": {
        "functionCode": "const staticData = getWorkflowStaticData('global');\nconst newIds = items.map(item => item.json[\"resourceId\"][\"videoId\"]);\nconst oldIds = staticData.oldIds; \n\nif (!oldIds) {\n  staticData.oldIds = newIds;\n  return items;\n}\n\n\nconst actualNewIds = newIds.filter((id) => !oldIds.includes(id));\nconst actualNew = items.filter((data) => actualNewIds.includes(data.json[\"resourceId\"][\"videoId\"]));\nstaticData.oldIds = [...actualNewIds, ...oldIds];\n\nreturn actualNew;\n"
      },
      "typeVersion": 1
    },
    {
      "name": "Flatten JSON",
      "type": "n8n-nodes-base.functionItem",
      "position": [
        -280,
        240
      ],
      "parameters": {
        "functionCode": "item = item[\"snippet\"]\n\nreturn item;"
      },
      "typeVersion": 1
    },
    {
      "name": "Raindrop Bookmark",
      "type": "n8n-nodes-base.raindrop",
      "position": [
        40,
        240
      ],
      "parameters": {
        "link": "=https://www.youtube.com/watch?v={{$json[\"resourceId\"][\"videoId\"]}}",
        "resource": "bookmark",
        "operation": "create",
        "collectionId": 0,
        "additionalFields": {
          "tags": "youtube",
          "title": "={{$json[\"videoOwnerChannelTitle\"]}} | {{$json[\"title\"]}}"
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Every 30 mins",
      "type": "n8n-nodes-base.cron",
      "position": [
        -610,
        320
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 30
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b5684de3-0339-575b-b313-c51366f65a02",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1410,
        0
      ],
      "parameters": {
        "content": "# YouTube to Raindrop\n\n## Purpose and structure\nThis folder contains the **YouTube to Raindrop** workflow. Its executable nodes use `cron`, `function`, `functionItem`, `manualTrigger`, `raindrop`, `youTube`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nOn clicking 'execute', Every 30 mins\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Functionitem/1140_Functionitem_Raindrop_Automation_Scheduled.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "active": false,
  "settings": {},
  "connections": {
    "YouTube": {
      "main": [
        [
          {
            "node": "Flatten JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flatten JSON": {
      "main": [
        [
          {
            "node": "Filter new items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 30 mins": {
      "main": [
        [
          {
            "node": "YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter new items": {
      "main": [
        [
          {
            "node": "Raindrop Bookmark",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
