{
  "id": "q6F4psysixO3bFdH",
  "name": "The Dropbox Note Sync",
  "tags": [],
  "nodes": [
    {
      "id": "4032cd45-b2be-4fff-8a12-c3604efca3ff",
      "name": "Start Workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        64,
        176
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e68895ef-ffc7-415c-9204-e0d3934518f8",
      "name": "Fetch Note from Dropbox",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        288,
        176
      ],
      "parameters": {
        "path": "/Notes/sample.md",
        "operation": "download",
        "authentication": "oAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "62b0ace3-4c48-461d-be09-e6afdad5f912",
      "name": "Extract Note Content",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        176
      ],
      "parameters": {
        "jsCode": "const item = $input.first();\n\n// Safe access\nconst binary = item.binary?.data;\n\nif (!binary) {\n  throw new Error(\"No binary data found. Make sure Dropbox Download node is correct.\");\n}\n\n// Safer filename extraction\nconst fileName =\n  binary.fileName ||\n  item.json[\"File Name\"] ||\n  item.json.name ||\n  \"unknown.md\";\n\nconst mimeType = binary.mimeType;\n\n// Get file buffer\nconst binaryBuffer = await this.helpers.getBinaryDataBuffer(0, 'data');\n\n// Convert to text\nconst fileContent = binaryBuffer.toString('utf-8');\n\nreturn [\n  {\n    json: {\n      fileName,\n      mimeType,\n      fileContent,\n      timestamp: new Date().toISOString()\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "e9469855-493c-451b-a3b7-db486b019d36",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 512,
        "content": "## Dropbox Note Retrieval\nManually trigger workflow to fetch new notes from Dropbox. Download the selected note file and extract its content, filename, MIME type, and timestamp to prepare it for AI processing."
      },
      "typeVersion": 1
    },
    {
      "id": "3278821e-72c4-41ac-aaa7-3dd516decc0b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 576,
        "content": "## AI Note Summarization\nProcess the extracted note using an AI language model. Generate a concise title, informative summary, and 5 relevant tags. Strict JSON validation ensures structured output for downstream usage."
      },
      "typeVersion": 1
    },
    {
      "id": "23ddb97f-9140-4fe1-bf1d-10fedf5d7af5",
      "name": "LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        848,
        368
      ],
      "parameters": {
        "model": "openai/gpt-oss-20b",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "c9208a11-26ab-4fb3-a15d-a47f9cbbff42",
      "name": "Validate AI Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        992,
        368
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\": {\n      \"type\": \"string\"\n    },\n    \"summary\": {\n      \"type\": \"string\"\n    },\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"minItems\": 5,\n      \"maxItems\": 5\n    }\n  },\n  \"required\": [\"title\", \"summary\", \"tags\"]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "4f9e5824-be1c-41b4-8d28-043d61a834bd",
      "name": "Generate Note Summary",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        848,
        176
      ],
      "parameters": {
        "text": "=You are an AI note assistant.\n\nAnalyze the following note and return ONLY valid JSON.\n\nOutput format:\n{\n  \"title\": \"short and meaningful title\",\n  \"summary\": \"summary\",\n  \"tags\": [\"tag1\", \"tag2\", \"tag3\", \"tag4\", \"tag5\"]\n}\n\nRules:\n- Title must be concise (max 8 words)\n- Summary must be clear and informative\n- Tags must be relevant keywords\n- Always return exactly 5 tags\n- Do NOT include any explanation\n- Do NOT include markdown formatting\n- Return ONLY valid JSON\n\nNote:\n{{ $json.fileContent }}",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "943a778b-13e8-451f-9496-b8592e9776b8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 512,
        "content": "## Structuring & Saving Note Data\nMap AI-generated fields into structured properties. Push the processed note into Notion database and append an entry in Google Sheets for backup and tracking."
      },
      "typeVersion": 1
    },
    {
      "id": "7887ce94-2af5-41d1-9e59-9b27997750b7",
      "name": "Format Note Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1312,
        176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "44b21572-8ac3-4050-aef9-898eb371800e",
              "name": "Title",
              "type": "string",
              "value": "={{ $json.output.title }}"
            },
            {
              "id": "f9f0e182-ebc0-4d81-a929-fa6916a4377a",
              "name": "Summary",
              "type": "string",
              "value": "={{ $json.output.summary }}"
            },
            {
              "id": "f2969c67-f12d-4362-9ab8-230b83ab55ec",
              "name": "Tags",
              "type": "array",
              "value": "={{ $json.output.tags }}"
            },
            {
              "id": "666293f2-789f-4d8a-896d-298d8dcc9536",
              "name": "Timestamp",
              "type": "string",
              "value": "={{ $('Extract Note Content').item.json.timestamp }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "36193a38-8527-4de3-8b95-51aad15e4b7d",
      "name": "Save to Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1536,
        176
      ],
      "parameters": {
        "title": "={{ $json.Title }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "33402716-a3df-80dd-a8a3-c3278ceffb77",
          "cachedResultUrl": "https://www.notion.so/33402716a3df80dda8a3c3278ceffb77",
          "cachedResultName": "Notes"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "File name|rich_text",
              "textContent": "={{ $('Extract Note Content').item.json.fileName }}"
            },
            {
              "key": "Summary|rich_text",
              "textContent": "={{ $json.Summary }}"
            },
            {
              "key": "Tags|multi_select",
              "multiSelectValue": "={{ $json.Tags }}"
            },
            {
              "key": "Title|title",
              "title": "={{ $json.Title }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4c0f8aca-18ed-432a-ad3c-7e2a0a40295d",
      "name": "Log in Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1744,
        176
      ],
      "parameters": {
        "columns": {
          "value": {
            "Tags": "={{ $json.property_tags }}",
            "Title": "={{ $json.name }}",
            "Summary": "={{ $json.property_summary }}",
            "FileName": "={{ $json.property_file_name }}",
            "TimeStamp": "={{ $json.property_timestamp }}"
          },
          "schema": [
            {
              "id": "TimeStamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "TimeStamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "FileName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "FileName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Tags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Tags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xKCSepURmB4AhcvV2KQPHPaXT3MuEisWVwgoVRthKUI/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xKCSepURmB4AhcvV2KQPHPaXT3MuEisWVwgoVRthKUI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xKCSepURmB4AhcvV2KQPHPaXT3MuEisWVwgoVRthKUI/edit?usp=drivesdk",
          "cachedResultName": "The Dropbox Note Sync"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "228f0ee4-2017-4043-b4b0-7c46f469ee09",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 512,
        "content": "## Notification & Archiving\nSend a Slack notification confirming note processing with summary and Notion link. Move the original note in Dropbox from /Notes/ to /Processed/ to mark it as completed."
      },
      "typeVersion": 1
    },
    {
      "id": "247afd01-ff41-4aa7-8bb4-27e9a6d302e9",
      "name": "Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2016,
        176
      ],
      "parameters": {
        "text": "=File Processed: {{ $json.FileName }}\n\nAI Summary:  {{ $json.Summary }}\n\nNotion Page:  {{ $('Save to Notion').item.json.name }}\n\nStatus: Success",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C0AQS47TGQ0",
          "cachedResultName": "all-dropbox-note-sync"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.4
    },
    {
      "id": "d6ccd4fd-7f76-4e68-b26d-a81e1e39852b",
      "name": "Archive Processed Note",
      "type": "n8n-nodes-base.dropbox",
      "position": [
        2224,
        176
      ],
      "parameters": {
        "path": "=/Notes/{{ $('Log in Google Sheets').item.json.FileName }}",
        "toPath": "=/Processed/{{ $('Log in Google Sheets').item.json.FileName }}",
        "operation": "move",
        "authentication": "oAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "7d2521f5-f501-4be9-ae6f-fbfce2bb58e9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -784,
        -288
      ],
      "parameters": {
        "width": 736,
        "height": 768,
        "content": "## Workflow Overview\n\nThis workflow automates the complete lifecycle of processing Markdown notes stored in Dropbox. It retrieves a note, extracts its content, and uses AI to generate a meaningful title, concise summary, and five relevant tags. The processed note is then saved to Notion, logged in Google Sheets for tracking, and a Slack notification is sent to confirm successful processing. Finally, the original file is moved to a Processed folder in Dropbox, ensuring each note is handled only once while maintaining an organized and searchable knowledge base.\n\n### Workflow Highlights:\n\n- Downloads Markdown notes from a Dropbox folder.\n- Uses AI to generate a title, summary, and 5 relevant tags.\n- Validates AI output with a structured JSON schema.\n- Stores processed notes in a Notion database.\n- Logs note details to Google Sheets for backup and reporting.\n- Sends a Slack notification after successful processing.\n- Archives processed notes by moving them to a Dropbox Processed folder.\n- Creates an automated, searchable note management workflow with minimal manual effort.\n\n### Quick Setup:\n\n- Connect your Dropbox, Groq (LLM), Notion, Google Sheets, and Slack credentials.\n- Update the Dropbox source and processed folder paths.\n- Select your Notion database and Google Sheets document.\n- Choose the Slack workspace and channel for notifications.\n- Review or customize the AI prompt and model (optional).\n- Run the workflow to verify everything is working, then activate it for regular use."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "414ab9e2-3a7b-43b8-9996-f82be613c502",
  "nodeGroups": [],
  "connections": {
    "LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Note Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Slack Alert": {
      "main": [
        [
          {
            "node": "Archive Processed Note",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Notion": {
      "main": [
        [
          {
            "node": "Log in Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Fetch Note from Dropbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Note Data": {
      "main": [
        [
          {
            "node": "Save to Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate AI Output": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Note Summary",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Extract Note Content": {
      "main": [
        [
          {
            "node": "Generate Note Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log in Google Sheets": {
      "main": [
        [
          {
            "node": "Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Note Summary": {
      "main": [
        [
          {
            "node": "Format Note Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Note from Dropbox": {
      "main": [
        [
          {
            "node": "Extract Note Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}