{
  "nodes": [
    {
      "id": "beaeb4ca-3743-4b84-84fc-9c9be5a77004",
      "name": "Download file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -288,
        592
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.file_id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "d8eeab29-3243-4dc0-8ecc-c39357025562",
      "name": "Check For A New File to post on laughing-everyday",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -720,
        592
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "id",
          "value": ""
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b8636c5b-ff24-4617-8c84-566f710b3daa",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -352,
        816
      ],
      "parameters": {
        "text": "=Please analyze the attached image ({{$json.file_name}}) with your dual expertise in IT and Marketing.\n\nContext: This is for our Discord community focused on sharing knowlege to everybody.\n\nSpecific Instructions:\nIdentify the key technical features and the 'hook' that would appeal to a digital marketer.\nGenerate a title that is catchy but SEO-friendly.\nWrite a high-engagement description with icon integrations (under 200 words) that asks the community a relevant question to spark discussion. The description should be apporiately line breaking.\nEnsure the output strictly follows the JSON schema provided in your system instructions.\"",
        "options": {
          "systemMessage": "Role: You are an expert assistant with dual mastery in Information Technology and Digital Marketing. Your goal is to help manage a Discord community by creating high-engagement content based on visual assets.\n\nTask: > 1. Analyze the provided image for technical details and marketing appeal. 2. Create a compelling, SEO-friendly, Discord-optimized title and description that encourages community interactions. 3. Think of a new file name for the file.\n\nConstraints: * Respond strictly in valid JSON format. * Ensure the description uses \"respectful, friendly, natural, warm, and empathetic\" tones suitable for community building. * Use clear, technically accurate language.\n\nOutput Format:\n{\n  \"title\": \"string\",\n  \"description\": \"string\",\n  \"new_file_name\": \"string\"\n}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "cc330074-028c-487c-94ab-11c8f974e0b2",
      "name": "Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -208,
        992
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"title\": \"String\",\n\t\"description\": \"String\",\n    \"new_file_name\": \"String\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "7e19c859-7f8b-4a73-9f5c-86b880b34f8d",
      "name": "Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -352,
        992
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7276a152-055d-4e57-a100-164674a73cda",
      "name": "Post To Discord Channel",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        384,
        592
      ],
      "parameters": {
        "url": "=https://discord.com/api/v10/channels/{{$json.channel_id}}/threads",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "payload_json",
              "value": "={\"name\": {{$json.title.toJsonString()}}, \"message\": {\"content\": {{ $json.description.toJsonString() }} }}"
            },
            {
              "name": "files[0]",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "=data"
            }
          ]
        },
        "nodeCredentialType": "discordBotApi"
      },
      "credentials": {
        "discordBotApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "12552ab6-e097-4727-aabb-344623b617f4",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -48,
        592
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "feedddc1-8d48-4829-82bb-3d953330fdde",
      "name": "Get Downloaded File & Set Post Data",
      "type": "n8n-nodes-base.set",
      "position": [
        144,
        592
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "67b16e10-4a7b-4a01-b780-cfc20836a4a1",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.file_id }}"
            },
            {
              "id": "10cb0ba7-3ae4-4e03-8587-06d5c53cf5ff",
              "name": "to_channel",
              "type": "string",
              "value": "={{ $json.to_channel }}"
            },
            {
              "id": "52c6b880-520f-4598-947e-a7468797a356",
              "name": "channel_id",
              "type": "string",
              "value": "={{ $json.channel_id }}"
            },
            {
              "id": "61bc1f47-d4ef-419e-8a75-052d3ccea59e",
              "name": "title",
              "type": "string",
              "value": "={{ $json.output.title }}"
            },
            {
              "id": "febdfb2b-5923-4f12-aaf0-7d93caa4d3ab",
              "name": "description",
              "type": "string",
              "value": "={{ $json.output.description }}"
            },
            {
              "id": "1436d1ef-3a31-49a8-90d4-7b4cbb2b4444",
              "name": "processed_folder_id",
              "type": "string",
              "value": "={{ $json.processed_folder_id }}"
            }
          ]
        },
        "includeFields": "data",
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "9df380ee-41cf-4cb1-b00f-f2631987fb65",
      "name": "Move file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        800,
        592
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Downloaded File & Set Post Data').item.json.processed_folder_id }}"
        },
        "operation": "move"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "73ea74ac-1535-4c3e-96c4-cb26b7fa6e4f",
      "name": "Update file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        592,
        592
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Get Downloaded File & Set Post Data').item.json.file_id }}"
        },
        "options": {},
        "operation": "update",
        "newUpdatedFileName": "={{ $('AI Agent').item.json.output.new_file_name }}"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "583bf0f7-e0a8-440c-9321-cf34b2522b5b",
      "name": "Done !",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1008,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e8b8869c-b7dc-488c-9a8e-e86887319f9e",
      "name": "Get File & Set Channel",
      "type": "n8n-nodes-base.set",
      "position": [
        -512,
        592
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "19293ab2-2b03-4625-bb13-e10991ebe049",
              "name": "file_name",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "a7fddba0-1bee-4e17-9e9a-a2b3e5ffa352",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "dbb158ff-9113-460f-a399-823199e2423c",
              "name": "channel_id",
              "type": "string",
              "value": "=channel_id"
            },
            {
              "id": "48cbaa4c-ecf2-4ec4-924b-d2769d0e2fd7",
              "name": "to_channel",
              "type": "string",
              "value": "to_channel"
            },
            {
              "id": "2e705cf4-1373-42fc-b53d-bde1f9975863",
              "name": "processed_folder_id",
              "type": "string",
              "value": "=processed_folder_id"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c8d918ea-9729-4a7d-b4d4-8a3c0ab1b01a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        800
      ],
      "parameters": {
        "width": 512,
        "height": 288,
        "content": "## \ud83d\udca1 Quick Demo\n1.  Upload a photo of code or a design mockup to your Drive folder.\n2.  Wait a few seconds.\n3.  See a new thread appear in Discord with the image and a question like \"How would you optimize this function?\"\n\n## \ud83c\udfaf Perfect For\n* **Community Managers** keeping servers active.\n* **Digital Marketers** automating asset distribution.\n* **Content Creators** streamlining their \"capture-to-publish\" workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "1641465b-8109-4420-9bb2-0565dba6fd31",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        144
      ],
      "parameters": {
        "width": 1024,
        "height": 416,
        "content": "## \ud83d\ude80 AI-Powered Visual Content Pipeline\nThis workflow automates the process of turning raw images into engaging community content. It connects your file storage directly to your social platform, using AI to bridge the creative gap.\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "30b2806f-e4d5-45ea-82da-3a0ae3cfe865",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        272
      ],
      "parameters": {
        "width": 528,
        "height": 256,
        "content": "### \u2699\ufe0f How it works\n1.  **Trigger:** The automation starts instantly when a new image file is uploaded to a designated Google Drive folder.\n2.  **Analysis:** The file is downloaded and passed to AI. The AI analyzes the image context and generates a catchy title, a community-focused description, and a new filename.\n3.  **Publishing:** The workflow sends the image and the AI-generated text to a specific Discord channel, creating a new thread to encourage discussion.\n4.  **Cleanup:** Finally, the original file is renamed and moved to a \"Processed\" folder in Google Drive to keep your workspace organized."
      },
      "typeVersion": 1
    },
    {
      "id": "e4ebcf4f-7a40-43c5-a882-ad7e47d6b02d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        272
      ],
      "parameters": {
        "width": 384,
        "height": 256,
        "content": "### \ud83d\udee0\ufe0f Setup steps\n1.  **Google Drive:** Create two folders (\"Input\" and \"Processed\"). Copy their IDs into the *Google Drive Trigger* and the *Set* nodes respectively.\n2.  **Credentials:** Connect your Google Drive and Google Gemini (PaLM) accounts.\n3.  **Discord:** Add your Bot Token to the *HTTP Request* node and input your Channel ID in the *Set* node variables.\n4.  **Test:** Drop an image into your Input folder to see the magic happen!"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Get Downloaded File & Set Post Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Move file": {
      "main": [
        [
          {
            "node": "Done !",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Update file": {
      "main": [
        [
          {
            "node": "Move file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Get File & Set Channel": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post To Discord Channel": {
      "main": [
        [
          {
            "node": "Update file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Downloaded File & Set Post Data": {
      "main": [
        [
          {
            "node": "Post To Discord Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check For A New File to post on laughing-everyday": {
      "main": [
        [
          {
            "node": "Get File & Set Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}