{
  "name": "Monitor Dropbox folders for new files with DB comparison",
  "nodes": [
    {
      "id": "971e1616-af67-4961-9ef4-4b8dd24e392c",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -660,
        240
      ]
    },
    {
      "id": "22d8dca1-a2fd-474e-a1cd-7f75be1c04a6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        -220
      ],
      "parameters": {
        "width": 620,
        "height": 920,
        "content": "## Dropbox\n\nDropbox call me each time a modification is done somewhere in my dropbox."
      }
    },
    {
      "id": "0178e813-ae15-4729-933b-2799ec405863",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -280
      ],
      "parameters": {
        "width": 840,
        "height": 140,
        "content": "## Watch Files, 2 ways :\n1. We explore each file in a folder (new and old ones)\n2. We want to filter new files only"
      }
    },
    {
      "id": "229b9a46-5d76-4cb7-b1ac-4b10a6427f66",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -80
      ],
      "parameters": {
        "width": 1040,
        "height": 100,
        "content": "### Way 1 - We call the subworklow for each file in the specified folder"
      }
    },
    {
      "id": "43a4fa3c-e378-443b-81a1-349201a85056",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        200
      ],
      "parameters": {
        "width": 1240,
        "height": 100,
        "content": "### Way 2- We filter new/old files then we call the subworkflow only for new files"
      }
    },
    {
      "id": "e9639a07-6672-46ee-a86e-025265e45069",
      "name": "Dropbox - List watched folder",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        500,
        280
      ]
    },
    {
      "id": "61707418-fcbb-4b70-ab06-02b9b7060bfb",
      "name": "Switch File vs Folder",
      "type": "n8n-nodes-base.switch",
      "position": [
        700,
        280
      ]
    },
    {
      "id": "2670d2d1-acfb-4d0b-9bde-12dbd3806976",
      "name": "Switch File vs Folder1",
      "type": "n8n-nodes-base.switch",
      "position": [
        780,
        0
      ]
    },
    {
      "id": "8225e284-b193-4859-891e-2277b2bc004b",
      "name": "NocoDB - Get know files to exclude",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        600,
        480
      ]
    },
    {
      "id": "0b9cb74b-ce02-4ed2-a417-084529a79977",
      "name": "Merge - Keep only new items",
      "type": "n8n-nodes-base.merge",
      "position": [
        1000,
        280
      ]
    },
    {
      "id": "c1f52687-7b6e-4c69-bcce-cc9bf053c62f",
      "name": "Just a quick answer to Dropbox - webhook validation",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -400,
        520
      ]
    },
    {
      "id": "42c84256-cbce-46d6-ab5a-01b1ef0715b0",
      "name": "Respond to Dropbox in less than 10sec",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -400,
        0
      ]
    },
    {
      "id": "bb45006e-f12e-4b9d-99fa-ec5003f1c141",
      "name": "Dropbox get files",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        500,
        0
      ]
    },
    {
      "id": "b4f8c38c-c674-488d-8c9a-f68e42c702cf",
      "name": "NocoDB - Add this file in the table",
      "type": "n8n-nodes-base.nocoDb",
      "position": [
        1200,
        280
      ]
    },
    {
      "id": "9d6d2d96-f16f-408d-bc35-0e17da4d4e6d",
      "name": "set_folder A",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        0
      ]
    },
    {
      "id": "aaa1ef55-10ef-4d8f-ae71-d317930229bc",
      "name": "set_folder to watch B",
      "type": "n8n-nodes-base.set",
      "position": [
        280,
        280
      ]
    },
    {
      "id": "770b7f54-e85e-4d62-ab2a-60c9a73411e3",
      "name": "Execute Workflow - what i want to do for this folder/file A",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1040,
        -20
      ]
    },
    {
      "id": "d9230834-13b4-420f-9e9a-154176803a66",
      "name": "Execute Workflow - Something to do for new files",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        1400,
        280
      ]
    },
    {
      "id": "68d02221-861c-41d6-afe3-3757b272746f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        120
      ],
      "parameters": {
        "width": null,
        "height": 80,
        "content": "I duplicate those processes for each folder i want to watch"
      }
    },
    {
      "id": "6befd86e-9a7b-442e-abb2-e1ed535f5166",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        460
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "I define in a \"variable\" the folder to watch to ease the next steps"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Respond to Dropbox in less than 10sec",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Just a quick answer to Dropbox - webhook validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set_folder A": {
      "main": [
        [
          {
            "node": "Dropbox get files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dropbox get files": {
      "main": [
        [
          {
            "node": "Switch File vs Folder1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch File vs Folder": {
      "main": [
        [
          {
            "node": "Merge - Keep only new items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set_folder to watch B": {
      "main": [
        [
          {
            "node": "Dropbox - List watched folder",
            "type": "main",
            "index": 0
          },
          {
            "node": "NocoDB - Get know files to exclude",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch File vs Folder1": {
      "main": [
        [
          {
            "node": "Execute Workflow - what i want to do for this folder/file A",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge - Keep only new items": {
      "main": [
        [
          {
            "node": "NocoDB - Add this file in the table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dropbox - List watched folder": {
      "main": [
        [
          {
            "node": "Switch File vs Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB - Get know files to exclude": {
      "main": [
        [
          {
            "node": "Merge - Keep only new items",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "NocoDB - Add this file in the table": {
      "main": [
        [
          {
            "node": "Execute Workflow - Something to do for new files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Dropbox in less than 10sec": {
      "main": [
        [
          {
            "node": "set_folder A",
            "type": "main",
            "index": 0
          },
          {
            "node": "set_folder to watch B",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}