{
  "name": "Google Drive duplicate file manager",
  "nodes": [
    {
      "id": "c4dca8f0-98fa-4b06-a806-1ab271f024a2",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        120,
        460
      ]
    },
    {
      "id": "2562ed4a-8ecd-4a32-ae51-bc85daa9817b",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1800,
        440
      ]
    },
    {
      "id": "e7f0482c-77c7-46a0-8a36-e61bb624c422",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        2020,
        440
      ]
    },
    {
      "id": "28768732-29a4-4446-8b12-dda187976bf9",
      "name": "Deduplicate Keep First",
      "type": "n8n-nodes-base.code",
      "position": [
        1580,
        560
      ]
    },
    {
      "id": "1f6f9529-2283-4806-ad5a-b0425f9f68e2",
      "name": "Deduplicate Keep Last",
      "type": "n8n-nodes-base.code",
      "position": [
        1580,
        360
      ]
    },
    {
      "id": "c5250dd1-6eeb-4b89-b2e7-e44a8d88212c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -120
      ],
      "parameters": {
        "width": 440,
        "height": 800,
        "content": "# 2. Configuration\nChoose the **keep** and **action** behavior of the workflow\n\n1. The **keep** parameter let's you decide whether to keep the first or last received file when duplicates are detected."
      }
    },
    {
      "id": "67c4d02f-b170-4504-9bae-7bf14db7abd3",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        180
      ],
      "parameters": {
        "width": 320,
        "height": 500,
        "content": "## Working Folder\nThe \"Working Folder\" node let's you choose Files to deduplicate.\n\nThis workflow includes a filter to work on just 1 folder at depth level 1. It doesn't work with files in nested fold"
      }
    },
    {
      "id": "9ed26ef0-da89-43c5-9e12-2ec97b2e51f6",
      "name": "Send Duplicates to Trash",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2760,
        320
      ]
    },
    {
      "id": "fcfd08fa-7a19-4974-b3bb-6ed27a2030cf",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2800,
        600
      ]
    },
    {
      "id": "de7967e7-eb3b-456c-b12e-6de3165ad29a",
      "name": "Is Flagged",
      "type": "n8n-nodes-base.if",
      "position": [
        2540,
        620
      ]
    },
    {
      "id": "d227d6ee-97e7-4b4d-b1a2-4cd402be99d5",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -360,
        460
      ]
    },
    {
      "id": "22e1638e-5c2e-41bc-b66e-fcee6af05762",
      "name": "Drop Google Apps files",
      "type": "n8n-nodes-base.filter",
      "position": [
        940,
        460
      ]
    },
    {
      "id": "ec80f4de-5dff-4693-bff4-2509fd581d70",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        180
      ],
      "parameters": {
        "width": 320,
        "height": 500,
        "content": "# Discard found Google Apps documents\nDocs, Sheets, Forms, Slides, Drawins etc. are discarded because they are not actual binary files and their content can't be directly checked."
      }
    },
    {
      "id": "66ee766a-3dea-449f-827c-1922c6e053f3",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -120
      ],
      "parameters": {
        "width": 440,
        "height": 800,
        "content": "# 1. Trigger Settings and Working Folder\n\nWhen using Google Drive Trigger configure the **Poll times** and the **Folder** to work with.\n\nBy Default the trigger is configured to check for *file uploads"
      }
    },
    {
      "id": "6f8a7855-2ee3-426d-879f-afb303d5aa20",
      "name": "Working Folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        560,
        460
      ]
    },
    {
      "id": "6f69e6d3-96ca-4411-9a48-160ebdb2a273",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2500,
        540
      ],
      "parameters": {
        "width": 540,
        "height": 220,
        "content": "### Files that already start with *DUPLICATE-* are not flagged again."
      }
    },
    {
      "id": "65b4ba42-89ce-437c-a3e8-bf3f9b01cc21",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2500,
        780
      ],
      "parameters": {
        "width": 360,
        "height": 240,
        "content": "### In Google Drive Trashed files are kept for 30 days before being permanently deleted. \nThey can be reviewed and restored during that 30 day interval."
      }
    },
    {
      "id": "99374aa8-e597-4919-8b64-c376b246621a",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2880,
        800
      ]
    },
    {
      "id": "6ae62c31-4cf0-48e7-aa42-19fc259c5981",
      "name": "Keep First/Last",
      "type": "n8n-nodes-base.switch",
      "position": [
        1300,
        460
      ]
    },
    {
      "id": "9cb84da7-3cd9-4a53-af09-8b63f1cf8a34",
      "name": "Trash/Flag Duplicates",
      "type": "n8n-nodes-base.switch",
      "position": [
        2240,
        440
      ]
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Working Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Trash/Flag Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Flagged": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Working Folder": {
      "main": [
        [
          {
            "node": "Drop Google Apps files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep First/Last": {
      "main": [
        [
          {
            "node": "Deduplicate Keep Last",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Deduplicate Keep First",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deduplicate Keep Last": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trash/Flag Duplicates": {
      "main": [
        [
          {
            "node": "Send Duplicates to Trash",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Is Flagged",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deduplicate Keep First": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drop Google Apps files": {
      "main": [
        [
          {
            "node": "Keep First/Last",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}