{"workflow":{"id":14026,"name":"Auto-reply to Instagram DMs with an AI chatbot and Google Gemini history","views":597,"recentViews":9,"totalViews":597,"createdAt":"2026-03-13T21:02:28.808Z","description":"# **Auto-reply Instagram DM** with AI Chatbot, Conversation History using **Google Gemini** and n8n Data Table\n\nThis workflow turns your **Instagram Business or Creator account** into an AI-powered customer support chatbot using **Google Gemini** and **n8n Data Table** for persistent conversation history. Every incoming Direct Message is automatically received, processed, and replied to — with long AI responses intelligently split and delivered in sequence.\n\nIf you need to automate Instagram DM responses without managing complex infrastructure, *this workflow is the right starting point.*\n\n## How it works\n\n* **Instagram Webhook receives the DM:** Meta sends the event to n8n. The workflow automatically handles both webhook verification and incoming message events. Text-only messages are filtered; bot reply-backs from the page itself are blocked.\n* **Set Context extracts all runtime config:** The sender ID, page ID, access token, and raw message text are extracted from a single node — no hardcoded values elsewhere.\n* **Message is stored and history is loaded:** The new message is saved to the **n8n Data Table** as unprocessed. All pending rows for the user are merged into one prompt (basic batching). The last 15 processed rows are loaded and formatted into session history blocks for context.\n* **Gemini AI Agent generates the reply:** The merged prompt and full conversation history are passed to **Google Gemini**. The AI responds in context, following the persona and instructions defined in the system prompt.\n* **Reply is formatted and delivered:** The response is normalized (markdown stripped, unsupported syntax removed) and split into chunks of up to 2000 characters. Each chunk is sent sequentially via the **Instagram Graph API** with a 1-second delay between messages.\n* **Data Table is updated and cleaned:** All pending rows are marked as processed. The AI reply is saved as the page response. Old rows beyond the 15-message window are automatically deleted to keep the table lean.\n\n## How to use\n\n1. **Create a Meta App** and add the **Instagram** product.\n2. Go to Instagram &gt; **API Setup with credentials** → log in to your IG Business/Creator account → copy the **long-lived Access Token** → paste it into the **Set Context** node (`ig_access_token` field).\n3. **Activate the workflow in production mode first**, then go to Meta App &gt; Instagram &gt; **Webhooks**: paste the n8n production webhook URL + a Verify Token → click Verify.\n4. Connect **Google Gemini** (`googlePalmApi`) credential in the **AI Agent** and **LLM** nodes.\n5. Create the **n8n Data Table** \n6. **Edit the system prompt** inside `Process Merged Message` to set your AI persona, brand tone, and knowledge base.\n7. Activate and start receiving automated replies on Instagram DM.\n\n## Requirements\n\n* **n8n Version:** Built and tested on **n8n 2.9.4+**. *(It is highly recommended to update to the latest n8n version to avoid compatibility issues.)*\n* **Instagram Business or Creator account** connected to a Meta App with Messaging permissions.\n* **Google Gemini** API key (`googlePalmApi` credential).\n* **n8n Data Table** named `insert_message` with the column schema described above.\n* A publicly accessible n8n instance (self-hosted or cloud) for Meta to reach the webhook.\n\n## Customizing this workflow\n\n* **Change the AI persona:** Edit only the system prompt inside `Process Merged Message` — no other node needs changing.\n* **Switch the AI model:** Swap the `Google Gemini Chat Model` sub-node for any other supported LLM (OpenAI, Anthropic, etc.).\n* **Add smart message batching:** Integrate **[Smart message batching workflow](https://n8n.io/workflows/9192)** to wait for the user to finish typing before responding — prevents duplicate or out-of-order replies.\n* **Add human takeover:** Integrate **[Smart human takeover workflow](https://n8n.io/workflows/11920)** to automatically pause the bot when an admin replies manually, then resume when done.\n* **Use on Facebook Messenger too:** The Smart Batching and Human Takeover workflows above are 100% compatible with both Facebook and Instagram — built to be cross-platform from the ground up.\n\n---\n\n## About the Author\n\n**Created by:** Nguyễn Thiệu Toàn (Jay Nguyen)\n**Email:** me@nguyenthieutoan.com\n**Website:** [nguyenthieutoan.com](https://nguyenthieutoan.com)\n**Company:** GenStaff ([genstaff.net](https://genstaff.net))\n**Socials (Facebook / X / LinkedIn):** @nguyenthieutoan\n**More templates:** [n8n.io/creators/nguyenthieutoan](https://n8n.io/creators/nguyenthieutoan)","workflow":{"meta":{"instanceId":"735886904af210643f438394a538e64374f0cb4ab13fd94d97005987482d652a","templateCredsSetupCompleted":true},"nodes":[{"id":"feededdf-bb71-4d9c-b869-0a3d1d88d45d","name":"Instagram Webhook","type":"n8n-nodes-base.webhook","position":[1024,352],"webhookId":"0c5cb137-56bb-4c20-ac71-ba5b31657be6","parameters":{"path":"nguyenthieutoan-instagram","options":{},"responseMode":"responseNode","multipleMethods":true},"typeVersion":2.1},{"id":"b2069343-d56c-4111-9bac-7c72cf8d9330","name":"Webhook Verification","type":"n8n-nodes-base.respondToWebhook","position":[1248,176],"parameters":{"options":{"responseCode":200},"respondWith":"text","responseBody":"={{ $json.query['hub.challenge'] }}"},"typeVersion":1.5},{"id":"1d9d267e-5a09-4aad-a62b-14c6663eaeec","name":"Set Context","type":"n8n-nodes-base.set","position":[1568,352],"parameters":{"options":{},"assignments":{"assignments":[{"id":"message-text-field","name":"message","type":"string","value":"={{ $json.body.entry[0].messaging[0].message.text }}"},{"id":"sender-id-field","name":"ig_id","type":"string","value":"={{ $json.body.entry[0].id }}"},{"id":"285e5c64-c494-4bc2-97af-759696a40308","name":"is_from_bot","type":"string","value":"={{ $json.body.entry[0].messaging[0].message.metadata }}"},{"id":"access-token-field","name":"ig_access_token","type":"string","value":"[YOUR_TOKEN]"},{"id":"timestamp-field","name":"received_timestamp","type":"number","value":"={{ $json.body.entry[0].messaging[0].timestamp }}"}]}},"typeVersion":3.4},{"id":"afb4d221-8f1a-41ed-b1b9-11a596cb3e69","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[3600,960],"parameters":{"options":{}},"credentials":{"googlePalmApi":{"id":"Uk0jNpsFZJn8koT9","name":"nguyenthieutoan.com@gmail.com"}},"typeVersion":1},{"id":"e4ffc56f-5c56-4fba-8651-f285abdd686f","name":"Get 15 newest rows","type":"n8n-nodes-base.code","position":[3072,544],"parameters":{"jsCode":"const inputItems = items;\n\n// Nếu danh sách rỗng, trả về rỗng\nif (inputItems.length === 0) {\n  return [];\n}\n\n// Sắp xếp theo thời gian tạo mới nhất\nconst sortedItems = [...inputItems].sort((a, b) => new Date(b.json.createdAt) - new Date(a.json.createdAt));\n\n// Lấy 15 hàng mới nhất\nconst latestItems = sortedItems.slice(0, 15);\n\n// Sắp xếp lại theo thời gian tăng dần để giữ đúng thứ tự hội thoại\nconst finalSorted = [...latestItems].sort((a, b) => new Date(a.json.createdAt) - new Date(b.json.createdAt));\n\n// Trả về kết quả\nreturn finalSorted;\n"},"typeVersion":2,"alwaysOutputData":true},{"id":"67a2212b-fb57-4577-8a40-41b5bf83e5fb","name":"Delay Between Messages","type":"n8n-nodes-base.wait","notes":"Delay 100ms giữa các tin nhắn để đảm bảo thứ tự","position":[4464,736],"webhookId":"0f02445d-4e12-46ba-868a-c2d813705ba0","parameters":{"amount":1},"typeVersion":1.1},{"id":"899467e7-aa45-4ef1-ac4a-65c2f57d4dc4","name":"Loop Over Items","type":"n8n-nodes-base.splitInBatches","notes":"Loop tuần tự qua từng tin nhắn","position":[4256,720],"parameters":{"options":{}},"typeVersion":3},{"id":"003ccf45-e60b-45b9-8f0e-123b10d02d7f","name":"Merge History and Find Min_ID","type":"n8n-nodes-base.code","position":[3280,544],"parameters":{"jsCode":"const inputItems = items;\n\nif (inputItems.length === 0) {\n  return [];\n}\n\n// Sort messages by creation time (ascending)\nconst sortedItems = [...inputItems].sort(\n  (a, b) => new Date(a.json.createdAt) - new Date(b.json.createdAt)\n);\n\n// Format helper for YYYY-MM-DD HH:mm:ss in Vietnam timezone\nfunction formatVNDateTime(date) {\n  return date.toLocaleString('en-CA', { timeZone: 'Asia/Ho_Chi_Minh' });\n}\n\n// Helper to get date string only (YYYY-MM-DD)\nfunction getVNDate(date) {\n  return new Date(date).toLocaleDateString('en-CA', { timeZone: 'Asia/Ho_Chi_Minh' });\n}\n\nlet sessions = [];\nlet currentSession = [];\nlet lastDate = null;\n\nsortedItems.forEach(item => {\n  const createdAt = new Date(item.json.createdAt);\n  const currentDate = getVNDate(createdAt);\n\n  if (lastDate && currentDate !== lastDate) {\n    // Push previous session\n    sessions.push(currentSession);\n    currentSession = [];\n  }\n\n  currentSession.push(item);\n  lastDate = currentDate;\n});\n\n// Push the final session\nif (currentSession.length > 0) {\n  sessions.push(currentSession);\n}\n\n// Get today's date in Vietnam timezone\nconst todayVN = getVNDate(new Date());\n\n// Split sessions into old and current\nlet oldSessionHistory = '';\nlet nowSessionHistory = '';\n\nsessions.forEach(session => {\n  const sessionDate = getVNDate(session[0].json.createdAt);\n  let sessionBlock = `--- 🕒 Session started at ${formatVNDateTime(new Date(session[0].json.createdAt))} ---\\n`;\n\n  session.forEach(item => {\n    const userText = item.json.user_text;\n    const pageText = item.json.page_text;   // <-- lấy phản hồi từ Page\n    const botRep = item.json.bot_rep;       // <-- phản hồi từ AI nếu có\n    const createdAtFormatted = formatVNDateTime(new Date(item.json.createdAt));\n    const updatedAtFormatted = formatVNDateTime(new Date(item.json.updatedAt));\n\n    if (userText) {\n      sessionBlock += `Human [${createdAtFormatted}]: ${userText}\\n`;\n    }\n    if (pageText) {\n      sessionBlock += `Page [${updatedAtFormatted}]: ${pageText}\\n`;\n    }\n    if (botRep) {\n      sessionBlock += `AI [${updatedAtFormatted}]: ${botRep}\\n`;\n    }\n  });\n\n  sessionBlock = sessionBlock.trim() + '\\n';\n\n  if (sessionDate === todayVN) {\n    nowSessionHistory += sessionBlock;\n  } else {\n    oldSessionHistory += sessionBlock;\n  }\n});\n\n// Calculate min_id (smallest id in the list)\nconst minId = Math.min(...sortedItems.map(item => item.json.id));\n\n// Final output\nreturn [\n  {\n    json: {\n      old_session_history: oldSessionHistory.trim(),\n      now_session_history: nowSessionHistory.trim(),\n      min_id: minId\n    }\n  }\n];\n"},"typeVersion":2,"alwaysOutputData":true},{"id":"4cd4d408-7e4a-4c5d-9861-a6aeb96c13de","name":"User is Sender","type":"n8n-nodes-base.set","position":[2064,352],"parameters":{"options":{},"assignments":{"assignments":[{"id":"16816be3-d7e3-4c45-9277-38be6cb24335","name":"user_id","type":"string","value":"={{ $('Instagram Webhook').item.json.body.entry[0].messaging[0].sender.id }}"}]}},"typeVersion":3.4},{"id":"f0fada31-adc3-42cc-8fa1-22a488a636c0","name":"Is from page?","type":"n8n-nodes-base.if","position":[1792,352],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"22aba732-f39d-473f-9336-6e9f0fdfd9ff","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $('Instagram Webhook').item.json.body.entry[0].messaging[0].sender.id }}","rightValue":"={{ $('Instagram Webhook').item.json.body.entry[0].id }}"}]},"looseTypeValidation":true},"typeVersion":2.3,"alwaysOutputData":false},{"id":"532a45d0-0c3b-4dbd-88d8-038053b0bbbe","name":"Seen","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","position":[2400,320],"parameters":{"url":"=https://graph.instagram.com/v24.0/{{ $('Set Context').item.json.ig_id }}/messages","method":"POST","options":{},"jsonBody":"={\n  \"recipient\": {\n    \"id\": \"{{ $('User is Sender').item.json.user_id }}\"\n  },\n  \"sender_action\": \"mark_seen\"\n} ","sendBody":true,"sendQuery":true,"specifyBody":"json","queryParameters":{"parameters":[{"name":"access_token","value":"={{ $('Set Context').item.json.ig_access_token }}"}]}},"typeVersion":4.3},{"id":"ddc0ffa3-27d9-4713-8398-df3402c8508a","name":"Insert To Unprocessed","type":"n8n-nodes-base.dataTable","position":[2400,544],"parameters":{"columns":{"value":{"page_id":"={{ $('Set Context').item.json.ig_id }}","user_id":"={{ $('User is Sender').item.json.user_id }}","processed":false,"user_text":"={{ $('Set Context').item.json.message }}"},"schema":[{"id":"user_id","type":"string","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"user_id","defaultMatch":false},{"id":"user_text","type":"string","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"user_text","defaultMatch":false},{"id":"page_id","type":"string","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"page_id","defaultMatch":false},{"id":"page_text","type":"string","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"page_text","defaultMatch":false},{"id":"processed","type":"boolean","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"processed","defaultMatch":false}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"dataTableId":{"__rl":true,"mode":"list","value":"JuNlpJZIJFqQaIFn","cachedResultUrl":"/projects/mYtIzVb8cWfhFOhJ/datatables/JuNlpJZIJFqQaIFn","cachedResultName":"insert_message"}},"typeVersion":1.1},{"id":"fafc6774-42f4-4b81-b624-8bce03ab9196","name":"Get history message","type":"n8n-nodes-base.dataTable","position":[2848,544],"parameters":{"filters":{"conditions":[{"keyName":"user_id","keyValue":"={{ $('User is Sender').item.json.user_id }}"},{"keyName":"processed","condition":"isTrue"},{"keyName":"page_id","keyValue":"={{ $json.page_id }}"}]},"matchType":"allConditions","operation":"get","returnAll":true,"dataTableId":{"__rl":true,"mode":"list","value":"JuNlpJZIJFqQaIFn","cachedResultUrl":"/projects/mYtIzVb8cWfhFOhJ/datatables/JuNlpJZIJFqQaIFn","cachedResultName":"insert_message"}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"1ededf20-1141-45e3-905d-94dbdc83788e","name":"Send Typing","type":"n8n-nodes-base.httpRequest","onError":"continueRegularOutput","position":[3616,400],"parameters":{"url":"=https://graph.instagram.com/v24.0/{{ $('Set Context').item.json.ig_id }}/messages","method":"POST","options":{},"jsonBody":"={\n  \"recipient\": {\n    \"id\": \"{{ $('User is Sender').first().json.user_id }}\"\n  },\n  \"sender_action\": \"typing_on\"\n}\n","sendBody":true,"sendQuery":true,"specifyBody":"json","queryParameters":{"parameters":[{"name":"access_token","value":"={{ $('Set Context').first().json.ig_access_token }}"}]}},"typeVersion":4.3},{"id":"7d350753-3bc9-4257-9cad-163b88a7c033","name":"Process Merged Message","type":"@n8n/n8n-nodes-langchain.agent","position":[3616,720],"parameters":{"text":"={{ $('Get MaxID and Merged Mess').first().json.merged_message }}","options":{"systemMessage":"=## Persona\nYou are Jenix, the personal AI assistant for Nguyễn Thiệu Toàn (Jay Nguyen) and his GenStaff Company. Your primary role is to act as a specialized consultant, advising potential clients on the AI and Automation services he provides.\n\n## Core Directives\n1. *Consult on Services:* Your main goal is to understand the customer's needs and advise them on how Nguyễn Thiệu Toàn's services can help. The core services include:  \n   a. *Automation Solutions for Businesses:* Providing custom automation workflows using platforms like n8n and other AI-powered tools.  \n   b. *AI & Automation Training:* Offering training programs for individuals and companies on leveraging AI and automation.  \n2. *Facilitate Scheduling:* If a potential client expresses strong interest or has complex questions that require direct expertise, proactively offer to schedule a consultation with Nguyễn Thiệu Toàn.\n\n## Conversational Flow\n1. *Opening Message:* In the very first message of a new conversation (when chat history is empty), you MUST introduce yourself. The introduction should adapt to the input language. For example:  \n   - If the user writes in Vietnamese: \"Chào anh/chị, em là Jenix, trợ lý AI của anh Nguyễn Thiệu Toàn. Em có thể giúp anh/chị giải đáp các thắc mắc về dịch vụ và giải pháp Tự động hóa & AI ạ.\"  \n   - If the user writes in English: \"Hello, I’m Jenix, the AI assistant of Mr. Nguyễn Thiệu Toàn. I can help answer your questions about AI & Automation services.\"  \n2. *Follow-up Messages:* In all subsequent messages within the same conversation, skip the introduction and go straight to the point, directly answering the user's query.\n\n## Constraints & Rules\n1. *Extreme Brevity:* Your responses (after the opening message) must be concise and directly address the user's core question. Eliminate filler words.  \n2. *Language Protocol:* Always respond in the same language as the user’s input.  \n   - In Vietnamese: Address the customer as \"anh\" or \"chị\", and refer to yourself as \"em\".  \n   - In English: Use polite, professional addressing such as \"you\" and refer to yourself as \"I\".  \n\n## Tone of Voice\n- *Clever & Witty:* Employ a smart and slightly humorous tone.  \n- *Friendly & Approachable:* Maintain a warm, welcoming, and helpful demeanor.  \n- *Efficient:* Convey competence and respect for the customer's time.  \n\n## Output Format\n- Your entire output must be formatted in *Facebook Markdown*.  \n\n## More information and context\n### Date and time now: {{ $now }}\n### Social Channel\n#### Nguyễn Thiệu Toàn (Jay Nguyen)\nWebsite: https://nguyenthieutoan.com  \nFacebook: https://www.facebook.com/nguyenthieutoan  \nLinkedIn: https://www.linkedin.com/in/nguyenthieutoan  \nX (Twitter): https://www.x.com/nguyenthieutoan  \nYouTube: https://www.youtube.com/@NguyenThieuToan  \nEmail: me@nguyenthieutoan.com  \n\n#### GenStaff\nWebsite: https://genstaff.net  \nFacebook: https://www.facebook.com/genstaff.net  \nEmail: contact@genstaff.net  \n\n## Chat History (DO NOT DELETE)\n### Old session chat history: {{ $json.old_session_history }}\n### Now session chat history: {{ $json.now_session_history }}\n"},"promptType":"define"},"retryOnFail":true,"typeVersion":3.1,"waitBetweenTries":100},{"id":"bb140074-72ac-49a0-9b48-48d54b0a99e4","name":"Send Text","type":"n8n-nodes-base.httpRequest","position":[4672,736],"parameters":{"url":"=https://graph.instagram.com/v24.0/{{ $('Set Context').first().json.ig_id }}/messages","method":"POST","options":{},"jsonBody":"={\n  \"recipient\": {\n    \"id\": \"{{ $('User is Sender').first().json.user_id }}\"\n  },\n  \"messaging_type\": \"RESPONSE\",\n  \"message\": {\n    \"text\": {{JSON.stringify($('Format Output').item.json.text)}},\n    \"metadata\": \"bot_rep\"\n  }\n}","sendBody":true,"sendQuery":true,"specifyBody":"json","queryParameters":{"parameters":[{"name":"access_token","value":"={{ $('Set Context').first().json.ig_access_token}}"}]}},"typeVersion":4.3},{"id":"64f1ffd0-d83e-443c-a43d-bd966e97da78","name":"Update Page Rep","type":"n8n-nodes-base.dataTable","position":[4528,464],"parameters":{"columns":{"value":{"page_text":"={{ $('Process Merged Message').item.json.output }}"},"schema":[{"id":"user_id","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"user_id","defaultMatch":false},{"id":"user_text","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"user_text","defaultMatch":false},{"id":"page_id","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"page_id","defaultMatch":false},{"id":"page_text","type":"string","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"page_text","defaultMatch":false},{"id":"processed","type":"boolean","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"processed","defaultMatch":false}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"filters":{"conditions":[{"keyName":"user_id","keyValue":"={{ $('User is Sender').first().json.user_id }}"},{"keyValue":"={{ $('Get MaxID and Merged Mess').first().json.id }}"},{"keyName":"page_id","keyValue":"={{ $('Set Context').first().json.ig_id }}"}]},"options":{},"matchType":"allConditions","operation":"update","dataTableId":{"__rl":true,"mode":"list","value":"JuNlpJZIJFqQaIFn","cachedResultUrl":"/projects/mYtIzVb8cWfhFOhJ/datatables/JuNlpJZIJFqQaIFn","cachedResultName":"insert_message"}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"0aa989ef-ac8f-42ee-8961-ea6c5f844868","name":"Update FALSE to TRUE","type":"n8n-nodes-base.dataTable","position":[4368,464],"parameters":{"columns":{"value":{"processed":true},"schema":[{"id":"user_id","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"user_id","defaultMatch":false},{"id":"user_text","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"user_text","defaultMatch":false},{"id":"page_id","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"page_id","defaultMatch":false},{"id":"page_text","type":"string","display":true,"removed":true,"readOnly":false,"required":false,"displayName":"page_text","defaultMatch":false},{"id":"processed","type":"boolean","display":true,"removed":false,"readOnly":false,"required":false,"displayName":"processed","defaultMatch":false}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"filters":{"conditions":[{"keyName":"user_id","keyValue":"={{ $('User is Sender').first().json.user_id }}"},{"keyName":"processed","condition":"isFalse"},{"keyName":"page_id","keyValue":"={{ $('Set Context').first().json.ig_id }}"}]},"options":{},"matchType":"allConditions","operation":"update","dataTableId":{"__rl":true,"mode":"list","value":"JuNlpJZIJFqQaIFn","cachedResultUrl":"/projects/mYtIzVb8cWfhFOhJ/datatables/JuNlpJZIJFqQaIFn","cachedResultName":"insert_message"}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"56786305-3ae3-4a0b-9eff-bcab59711ec7","name":"Clean History","type":"n8n-nodes-base.dataTable","position":[4672,464],"parameters":{"filters":{"conditions":[{"keyName":"user_id","keyValue":"={{ $('User is Sender').first().json.user_id }}"},{"keyName":"processed","condition":"isTrue"},{"keyName":"page_id","keyValue":"={{ $('Set Context').first().json.ig_id }}"},{"keyValue":"={{ $('Merge History and Find Min_ID').first().json.min_id }}","condition":"lt"}]},"options":{"dryRun":false},"matchType":"allConditions","operation":"deleteRows","dataTableId":{"__rl":true,"mode":"list","value":"JuNlpJZIJFqQaIFn","cachedResultUrl":"/projects/mYtIzVb8cWfhFOhJ/datatables/JuNlpJZIJFqQaIFn","cachedResultName":"insert_message"}},"typeVersion":1.1,"alwaysOutputData":true},{"id":"34af050c-7b86-4e29-b2c8-d6007aa6a371","name":"Get MaxID and Merged Mess","type":"n8n-nodes-base.code","position":[2624,544],"parameters":{"jsCode":"// Lấy danh sách input\nconst inputItems = items;\n\n// Nếu danh sách rỗng, trả về rỗng\nif (inputItems.length === 0) {\n  return [];\n}\n\n// Sắp xếp theo id tăng dần\nconst sortedItems = [...inputItems].sort((a, b) => a.json.id - b.json.id);\n\n// Tạo merged_message từ các user_text không null\nconst mergedMessage = sortedItems\n  .map(item => item.json.user_text)\n  .filter(text => text !== null && text !== undefined)\n  .join(' ');\n\n// Tìm item có id lớn nhất\nlet maxItem = sortedItems[sortedItems.length - 1];\n\n// Thêm các trường vào item lớn nhất\nmaxItem.json.merged_message = mergedMessage;\n// Trả về item có id lớn nhất kèm merged_message và history\nreturn [maxItem];\n"},"typeVersion":2},{"id":"a4e720f0-4e6f-4865-9834-c480ef010e09","name":"Is Message?","type":"n8n-nodes-base.if","position":[1312,368],"parameters":{"options":{},"conditions":{"options":{"version":3,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"has-message-check","operator":{"type":"string","operation":"exists","singleValue":true},"leftValue":"={{ $json.body.entry?.[0]?.messaging?.[0]?.message?.text }}","rightValue":""}]}},"typeVersion":2.3},{"id":"681198f5-d345-43c6-a5c2-b4c588dee113","name":"Main Overview","type":"n8n-nodes-base.stickyNote","position":[368,-48],"parameters":{"width":580,"height":1220,"content":"## Instagram DM Chatbot with AI & Conversation History\n\nThis workflow turns your **Instagram Business/Creator account** into a fully automated AI chatbot using **Google Gemini** and **n8n Data Table** for persistent conversation history. Every incoming Direct Message is stored, processed, and replied to automatically — with long replies split and delivered sequentially.\n\n> ⚠️ **Simplified version** — ideal for learning and low-traffic deployments. For production, integrate the Smart Batching and Human Takeover workflows linked in the Upgrade Note.\n\n### How it works\n1. **Instagram Webhook** receives incoming DMs and responds to Meta's GET verification challenge.\n2. **Is Message?** filters text-only events; **Is from page?** blocks echo from the page itself.\n3. **Set Context** extracts `user_id`, `ig_id`, and `access_token` — single config point.\n4. New message is saved to **Data Table** as `unprocessed`. Unprocessed rows are merged into one prompt.\n5. Last 15 **processed rows** are loaded and formatted as old/current-session history for context.\n6. **Gemini AI Agent** generates a reply using the merged message + full session history.\n7. Reply is **split** into ≤2000-character chunks and sent sequentially with a 1-second delay.\n8. Data Table is **updated**: all rows marked `processed`, AI reply saved, old rows cleaned up.\n\n### Setup\n* [ ] Create a **Meta App** → add **Instagram** product.\n* [ ] Go to Instagram > **API Setup with credentials** → log in to your IG Business/Creator account → copy the **long-lived Access Token**.\n* [ ] Paste the token into **Set Context** (`ig_access_token` field).\n* [ ] In Meta App > Instagram > **Webhooks**: paste your n8n production webhook URL + a Verify Token → click Verify.\n* [ ] Connect **Google Gemini** (`googlePalmApi`) credential in the AI Agent and LLM nodes.\n* [ ] Create the **n8n Data Table** `insert_message` with columns: `user_id`, `page_id`, `user_text`, `page_text`, `processed` (Boolean).\n* [ ] Activate the workflow in **production mode BEFORE** verifying the webhook in Meta.\n\n### Customization tips\n* **Change AI persona:** Edit the system prompt inside `Process Merged Message` — nothing else needs changing.\n* **Switch model:** Swap `Google Gemini Chat Model` for any supported LLM sub-node.\n* **Scale up:** Combine with the Smart Batching or Human Takeover workflows for production readiness.\n\n### LICENCE\nThis template is shared free of charge. Copyright belongs to Nguyen Thieu Toan (Jay Nguyen). Any copying or modification must credit the author."},"typeVersion":1},{"id":"0eb9dbcd-ce1b-48e0-9f26-1dc69c08cb20","name":"Author Message","type":"n8n-nodes-base.stickyNote","position":[1600,800],"parameters":{"color":4,"width":628,"height":380,"content":"## Author Message\n\nHi! I am **Nguyen Thieu Toan (Jay Nguyen)** — a Verified n8n Creator. Thank you for using this template!\n\nThis workflow is shared with you for free. If it brings value to your work, optimizes your operations, or saves you time, you can buy me a coffee here: **[My Donate Website](https://nguyenthieutoan.com/payment/)** *(PayPal, Momo, Bank Transfer)*\n\n* Website: [nguyenthieutoan.com](https://nguyenthieutoan.com)\n* Email: me@nguyenthieutoan.com\n* Company: GenStaff ([genstaff.net](https://genstaff.net))\n* Socials (Facebook / X / LinkedIn): @nguyenthieutoan\n\n*Discover more of my automation solutions:* **[Click here](https://n8n.io/creators/nguyenthieutoan/)**"},"typeVersion":1},{"id":"294cc9be-6f9a-4614-81a1-675048405711","name":"Upgrade Note","type":"n8n-nodes-base.stickyNote","position":[976,800],"parameters":{"color":3,"width":596,"height":376,"content":"## IMPORTANT: Upgrade for Production\n\nThis is a **simplified version** — suitable for learning, testing, or low-traffic use.\n\nFor production, combine with these **100% compatible** workflows (originally built for Facebook Messenger, but fully cross-platform — works with Instagram too):\n\n* **[Smart message batching](https://n8n.io/workflows/9192):** Waits for the user to finish typing before responding. Prevents duplicate or out-of-order replies.\n* **[Smart human takeover](https://n8n.io/workflows/11920):** Automatically pauses the bot when an admin replies. Resumes when the admin is done.\n\nIntegrate **one or both** for a production-ready Instagram chatbot."},"typeVersion":1},{"id":"444fd240-d108-4d62-8c57-f84cba69c6dc","name":"Section 1","type":"n8n-nodes-base.stickyNote","position":[976,-48],"parameters":{"color":7,"width":1256,"height":820,"content":"## Section 1: Webhook & Validation\nReceives Instagram DM events via webhook → returns GET verification challenge to Meta → **Is Message?** filters text-only events → **Is from page?** blocks echo messages sent by the page itself → extracts config into **Set Context**."},"typeVersion":1},{"id":"ad1a29a3-0bd1-4c23-ba6b-94b37f36f643","name":"Section 2","type":"n8n-nodes-base.stickyNote","position":[2272,-48],"parameters":{"color":7,"width":1144,"height":820,"content":"## Section 2: Store Message & Load History\nInserts new user message into **Data Table** as `unprocessed` → marks as **Seen** → merges all unprocessed rows into one prompt (simple batching) → retrieves last 15 **processed** rows → formats them into old-session / current-session history blocks for the AI."},"typeVersion":1},{"id":"3f24989a-d18a-468a-8df3-187fbc7e3ad9","name":"Section 3","type":"n8n-nodes-base.stickyNote","position":[3472,-48],"parameters":{"color":7,"width":632,"height":1120,"content":"## Section 3: AI Processing\nSends `typing_on` indicator to the user → **Gemini AI Agent** generates a reply using the merged message + full session history → **Format Output** normalizes markdown, strips unsupported syntax, and splits the reply into ≤2000-character chunks."},"typeVersion":1},{"id":"abd97549-b79e-41e8-810f-517804724baf","name":"Section 4","type":"n8n-nodes-base.stickyNote","position":[4176,-48],"parameters":{"color":7,"width":668,"height":1124,"content":"## Section 4: Deliver & Update\nLoops through each message chunk → waits 1 second between sends → delivers via **Instagram Graph API** → marks all unprocessed rows `processed = true` → saves AI reply into `page_text` → deletes old history rows beyond the 15-message window."},"typeVersion":1},{"id":"9890977c-ae36-457e-a375-a6af54a26feb","name":"Warning Activate","type":"n8n-nodes-base.stickyNote","position":[976,592],"parameters":{"color":3,"width":440,"height":148,"content":"## Activate before verifying!\n\nThe webhook verification in Meta App **only works with the production URL**. Activate this workflow in production mode first, then go to Meta App > Instagram > Webhooks to verify."},"typeVersion":1},{"id":"94733b4a-4ba7-4959-83a8-cdcf2c08b168","name":"Warning Token","type":"n8n-nodes-base.stickyNote","position":[1504,160],"parameters":{"color":3,"width":236,"height":180,"content":"## Edit this node!\n\nReplace `ig_access_token` with your **long-lived Instagram Access Token** from:\nMeta App > Instagram > API Setup with credentials."},"typeVersion":1},{"id":"8558e2b3-4cc5-42ae-842b-44467d6a599e","name":"Format Output","type":"n8n-nodes-base.code","position":[3968,720],"parameters":{"jsCode":"const MAX_LEN = 2000;\n\n/* === Get input === */\nlet text = ($input.first().json.output || \"\").trim();\nif (!text) return [];\n\n/* --- Fix escape JSON: đổi \\\\n, \\\\\\n thành \\n thật --- */\ntext = text.replace(/\\\\+/g, '\\\\');   // gộp nhiều \\ thành 1\ntext = text.replace(/\\\\n/g, '\\n');   // đổi thành newline thật\n\n/* ---------- 1) Markdown → Facebook Markdown ---------- */\nfunction mdToFacebook(md){\n  let s = md;\n\n  // code block → giữ nguyên\n  s = s.replace(/```([\\s\\S]*?)```/g, (m,p1)=>`\\`\\`\\n${p1.trim()}\\n\\`\\`\\``);\n\n  // inline code\n  s = s.replace(/`([^`]+)`/g, (m,p1)=>`\\`${p1}\\``);\n\n  // bold (**text**) → *text*\n  s = s.replace(/\\*\\*([^*]+)\\*\\*/g, '*$1*');\n\n  // italic (_text_) → giữ nguyên\n\n  // underline & strike → bỏ\n  s = s.replace(/__([^_]+)__/g, '$1');\n  s = s.replace(/~~([^~]+)~~/g, '$1');\n\n  // headers → bold\n  s = s.replace(/^(#{1,6})\\s+(.+)$/gm, (m, hashes, content)=>`*${content.trim()}*`);\n\n  // list markers → bullet list Messenger\n  s = s.replace(/^[\\-\\*\\+]\\s+(.+)$/gm, '* $1');\n\n  // links → giữ text\n  s = s.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, (m,txt,url)=>txt);\n\n  return s.trim();\n}\n\n/* ---------- 2) HTML → Facebook Markdown ---------- */\nfunction htmlToFbMarkdown(input){\n  let s = input;\n\n  s = s.replace(/<br\\s*\\/?>/gi, '\\n');\n\n  // headers → bold\n  s = s.replace(/<h[1-6][^>]*>([\\s\\S]*?)<\\/h[1-6]>/gi, (m, inner)=>`*${inner.trim()}*`);\n\n  // bold / italic\n  s = s.replace(/<\\/?strong[^>]*>/gi, '*');\n  s = s.replace(/<\\/?b[^>]*>/gi, '*');\n  s = s.replace(/<\\/?em[^>]*>/gi, '_');\n  s = s.replace(/<\\/?i[^>]*>/gi, '_');\n\n  // paragraphs/divs → newline\n  s = s.replace(/<\\/?(p|div)[^>]*>/gi, '\\n');\n\n  // lists → bullet\n  s = s.replace(/<li[^>]*>/gi, '* ').replace(/<\\/li>/gi, '\\n');\n  s = s.replace(/<\\/?(ul|ol)[^>]*>/gi, '');\n\n  // remove all other tags\n  s = s.replace(/<\\/?[^>]+>/g, '');\n\n  return s.trim();\n}\n\n/* ---------- 3) Normalize content ---------- */\nfunction normalizeToFacebookMarkdown(input){\n  const looksLikeMd = /(^|\\s)[*_`~]|^#{1,6}\\s|```/.test(input);\n  let s = looksLikeMd ? mdToFacebook(input) : htmlToFbMarkdown(input);\n\n  // collapse nhiều newline thành 1\n  s = s.replace(/\\n{3,}/g, '\\n\\n');\n\n  // xoá ký tự \"\\\" thừa còn sót\n  s = s.replace(/\\\\+/g, '');\n\n  return s.trim();\n}\n\n/* ---------- 4) Split by newlines (smart split) ---------- */\nfunction splitMarkdownSmart(text, maxLen) {\n  const lines = text.split('\\n');\n  const chunks = [];\n  let buffer = '';\n\n  for (const line of lines) {\n    if ((buffer + line + '\\n').length > maxLen) {\n      if (buffer.trim()) chunks.push(buffer.trim());\n      buffer = line + '\\n';\n    } else {\n      buffer += line + '\\n';\n    }\n  }\n\n  if (buffer.trim()) chunks.push(buffer.trim());\n\n  return chunks.map(c => c.replace(/\\n+$/,''));\n}\n\n/* ===== Run ===== */\nconst normalized = normalizeToFacebookMarkdown(text);\nconst chunks = splitMarkdownSmart(normalized, MAX_LEN);\n\nreturn chunks.map(c => ({ json: { text: c } }));\n"},"typeVersion":2}],"pinData":{},"connections":{"Seen":{"main":[[]]},"Send Text":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Is Message?":{"main":[[{"node":"Set Context","type":"main","index":0}]]},"Set Context":{"main":[[{"node":"Is from page?","type":"main","index":0}]]},"Format Output":{"main":[[{"node":"Loop Over Items","type":"main","index":0}]]},"Is from page?":{"main":[[],[{"node":"User is Sender","type":"main","index":0}]]},"User is Sender":{"main":[[{"node":"Insert To Unprocessed","type":"main","index":0},{"node":"Seen","type":"main","index":0}]]},"Loop Over Items":{"main":[[{"node":"Update FALSE to TRUE","type":"main","index":0}],[{"node":"Delay Between Messages","type":"main","index":0}]]},"Update Page Rep":{"main":[[{"node":"Clean History","type":"main","index":0}]]},"Instagram Webhook":{"main":[[{"node":"Webhook Verification","type":"main","index":0}],[{"node":"Webhook Verification","type":"main","index":0},{"node":"Is Message?","type":"main","index":0}]]},"Get 15 newest rows":{"main":[[{"node":"Merge History and Find Min_ID","type":"main","index":0}]]},"Get history message":{"main":[[{"node":"Get 15 newest rows","type":"main","index":0}]]},"Update FALSE to TRUE":{"main":[[{"node":"Update Page Rep","type":"main","index":0}]]},"Insert To Unprocessed":{"main":[[{"node":"Get MaxID and Merged Mess","type":"main","index":0}]]},"Delay Between Messages":{"main":[[{"node":"Send Text","type":"main","index":0}]]},"Process Merged Message":{"main":[[{"node":"Format Output","type":"main","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"Process Merged Message","type":"ai_languageModel","index":0}]]},"Get MaxID and Merged Mess":{"main":[[{"node":"Get history message","type":"main","index":0}]]},"Merge History and Find Min_ID":{"main":[[{"node":"Send Typing","type":"main","index":0},{"node":"Process Merged Message","type":"main","index":0}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":31,"nodeTypes":{"n8n-nodes-base.if":{"count":2},"n8n-nodes-base.set":{"count":2},"n8n-nodes-base.code":{"count":4},"n8n-nodes-base.wait":{"count":1},"n8n-nodes-base.webhook":{"count":1},"n8n-nodes-base.dataTable":{"count":5},"n8n-nodes-base.stickyNote":{"count":9},"n8n-nodes-base.httpRequest":{"count":3},"n8n-nodes-base.splitInBatches":{"count":1},"@n8n/n8n-nodes-langchain.agent":{"count":1},"n8n-nodes-base.respondToWebhook":{"count":1},"@n8n/n8n-nodes-langchain.lmChatGoogleGemini":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"Nguyễn Thiệu Toàn (Jay Nguyen)","username":"nguyenthieutoan","bio":"I’m the Founder & CEO of GenStaff. My work focuses on building AI Staff and automation systems that help businesses operate with fewer manual processes and greater efficiency.\n\nI’m particularly interested in how AI and no-code tools can transform complex workflows into scalable systems.\n\nI also share what I learn about AI, automation, and system thinking along the way.","verified":true,"links":["https://nguyenthieutoan.com"],"avatar":"https://gravatar.com/avatar/7141eae597e5b2df502a89ec82a34a51fa2138a7b108ebfec95f50f383b37be7?r=pg&d=retro&size=200"},"nodes":[{"id":19,"icon":"file:httprequest.svg","name":"n8n-nodes-base.httpRequest","codex":{"data":{"alias":["API","Request","URL","Build","cURL"],"resources":{"generic":[{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/learn-how-to-automatically-cross-post-your-content-with-n8n/","icon":"✍️","label":"Learn how to automatically cross-post your content with n8n"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/running-n8n-on-ships-an-interview-with-maranics/","icon":"🛳","label":"Running n8n on ships: An interview with Maranics"},{"url":"https://n8n.io/blog/what-are-apis-how-to-use-them-with-no-code/","icon":" 🪢","label":"What are APIs and how to use them with no code"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/world-poetry-day-workflow/","icon":"📜","label":"Celebrating World Poetry Day with a daily poem in Telegram"},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/automate-designs-with-bannerbear-and-n8n/","icon":"🎨","label":"Automate Designs with Bannerbear and n8n"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/building-an-expense-tracking-app-in-10-minutes/","icon":"📱","label":"Building an expense tracking app in 10 minutes"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/how-to-use-the-http-request-node-the-swiss-army-knife-for-workflow-automation/","icon":"🧰","label":"How to use the HTTP Request Node - The Swiss Army Knife for Workflow Automation"},{"url":"https://n8n.io/blog/learn-how-to-use-webhooks-with-mattermost-slash-commands/","icon":"🦄","label":"Learn how to use webhooks with Mattermost slash commands"},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/a-low-code-bitcoin-ticker-built-with-questdb-and-n8n-io/","icon":"📈","label":"A low-code bitcoin ticker built with QuestDB and n8n.io"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/automations-for-activists/","icon":"✨","label":"How Common Knowledge use workflow automation for activism"},{"url":"https://n8n.io/blog/creating-scheduled-text-affirmations-with-n8n/","icon":"🤟","label":"Creating scheduled text affirmations with n8n"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"output\"]","defaults":{"name":"HTTP Request","color":"#0004F5"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MCAyMEM0MCA4Ljk1MzE0IDMxLjA0NjkgMCAyMCAwQzguOTUzMTQgMCAwIDguOTUzMTQgMCAyMEMwIDMxLjA0NjkgOC45NTMxNCA0MCAyMCA0MEMzMS4wNDY5IDQwIDQwIDMxLjA0NjkgNDAgMjBaTTIwIDM2Ljk0NThDMTguODg1MiAzNi45NDU4IDE3LjEzNzggMzUuOTY3IDE1LjQ5OTggMzIuNjk4NUMxNC43OTY0IDMxLjI5MTggMTQuMTk2MSAyOS41NDMxIDEzLjc1MjYgMjcuNjg0N0gyNi4xODk4QzI1LjgwNDUgMjkuNTQwMyAyNS4yMDQ0IDMxLjI5MDEgMjQuNTAwMiAzMi42OTg1QzIyLjg2MjIgMzUuOTY3IDIxLjExNDggMzYuOTQ1OCAyMCAzNi45NDU4Wk0xMi45MDY0IDIwQzEyLjkwNjQgMjEuNjA5NyAxMy4wMDg3IDIzLjE2NCAxMy4yMDAzIDI0LjYzMDVIMjYuNzk5N0MyNi45OTEzIDIzLjE2NCAyNy4wOTM2IDIxLjYwOTcgMjcuMDkzNiAyMEMyNy4wOTM2IDE4LjM5MDMgMjYuOTkxMyAxNi44MzYgMjYuNzk5NyAxNS4zNjk1SDEzLjIwMDNDMTMuMDA4NyAxNi44MzYgMTIuOTA2NCAxOC4zOTAzIDEyLjkwNjQgMjBaTTIwIDMuMDU0MTlDMjEuMTE0OSAzLjA1NDE5IDIyLjg2MjIgNC4wMzA3OCAyNC41MDAxIDcuMzAwMzlDMjUuMjA2NiA4LjcxNDA4IDI1LjgwNzIgMTAuNDA2NyAyNi4xOTIgMTIuMzE1M0gxMy43NTAxQzE0LjE5MzMgMTAuNDA0NyAxNC43OTQyIDguNzEyNTQgMTUuNDk5OCA3LjMwMDY0QzE3LjEzNzcgNC4wMzA4MyAxOC44ODUxIDMuMDU0MTkgMjAgMy4wNTQxOVpNMzAuMTQ3OCAyMEMzMC4xNDc4IDE4LjQwOTkgMzAuMDU0MyAxNi44NjE3IDI5LjgyMjcgMTUuMzY5NUgzNi4zMDQyQzM2LjcyNTIgMTYuODQyIDM2Ljk0NTggMTguMzk2NCAzNi45NDU4IDIwQzM2Ljk0NTggMjEuNjAzNiAzNi43MjUyIDIzLjE1OCAzNi4zMDQyIDI0LjYzMDVIMjkuODIyN0MzMC4wNTQzIDIzLjEzODMgMzAuMTQ3OCAyMS41OTAxIDMwLjE0NzggMjBaTTI2LjI3NjcgNC4yNTUxMkMyNy42MzY1IDYuMzYwMTkgMjguNzExIDkuMTMyIDI5LjM3NzQgMTIuMzE1M0gzNS4xMDQ2QzMzLjI1MTEgOC42NjggMzAuMTA3IDUuNzgzNDYgMjYuMjc2NyA0LjI1NTEyWk0xMC42MjI2IDEyLjMxNTNINC44OTI5M0M2Ljc1MTQ3IDguNjY3ODQgOS44OTM1MSA1Ljc4MzQxIDEzLjcyMzIgNC4yNTUxM0MxMi4zNjM1IDYuMzYwMjEgMTEuMjg5IDkuMTMyMDEgMTAuNjIyNiAxMi4zMTUzWk0zLjA1NDE5IDIwQzMuMDU0MTkgMjEuNjAzIDMuMjc3NDMgMjMuMTU3NSAzLjY5NDg0IDI0LjYzMDVIMTAuMTIxN0M5Ljk0NjE5IDIzLjE0MiA5Ljg1MjIyIDIxLjU5NDMgOS44NTIyMiAyMEM5Ljg1MjIyIDE4LjQwNTcgOS45NDYxOSAxNi44NTggMTAuMTIxNyAxNS4zNjk1SDMuNjk0ODRDMy4yNzc0MyAxNi44NDI1IDMuMDU0MTkgMTguMzk3IDMuMDU0MTkgMjBaTTI2LjI3NjYgMzUuNzQyN0MyNy42MzY1IDMzLjYzOTMgMjguNzExIDMwLjg2OCAyOS4zNzc0IDI3LjY4NDdIMzUuMTA0NkMzMy4yNTEgMzEuMzMyMiAzMC4xMDY4IDM0LjIxNzkgMjYuMjc2NiAzNS43NDI3Wk0xMy43MjM0IDM1Ljc0MjdDOS44OTM2OSAzNC4yMTc5IDYuNzUxNTUgMzEuMzMyNCA0Ljg5MjkzIDI3LjY4NDdIMTAuNjIyNkMxMS4yODkgMzAuODY4IDEyLjM2MzUgMzMuNjM5MyAxMy43MjM0IDM1Ljc0MjdaIiBmaWxsPSIjM0E0MkU5Ii8+Cjwvc3ZnPgo="},"displayName":"HTTP Request","typeVersion":4,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":20,"icon":"fa:map-signs","name":"n8n-nodes-base.if","codex":{"data":{"alias":["Router","Filter","Condition","Logic","Boolean","Branch"],"details":"The IF node can be used to implement binary conditional logic in your workflow. You can set up one-to-many conditions to evaluate each item of data being inputted into the node. That data will either evaluate to TRUE or FALSE and route out of the node accordingly.\n\nThis node has multiple types of conditions: Bool, String, Number, and Date & Time.","resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/","icon":"🤬","label":"Create a toxic language detector for Telegram in 4 step"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/","icon":"🏷️","label":"How to automatically manage contributions to open-source projects"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.if/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"transform\"]","defaults":{"name":"If","color":"#408000"},"iconData":{"icon":"map-signs","type":"icon"},"displayName":"If","typeVersion":2,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":38,"icon":"fa:pen","name":"n8n-nodes-base.set","codex":{"data":{"alias":["Set","JS","JSON","Filter","Transform","Map"],"resources":{"generic":[{"url":"https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/","icon":"🏭","label":"Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"},{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/automatically-pulling-and-visualizing-data-with-n8n/","icon":"📈","label":"Automatically pulling and visualizing data with n8n"},{"url":"https://n8n.io/blog/database-monitoring-and-alerting-with-n8n/","icon":"📡","label":"Database Monitoring and Alerting with n8n"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/","icon":"⚙️","label":"Automate your data processing pipeline in 9 steps"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/building-an-expense-tracking-app-in-10-minutes/","icon":"📱","label":"Building an expense tracking app in 10 minutes"},{"url":"https://n8n.io/blog/the-ultimate-guide-to-automate-your-video-collaboration-with-whereby-mattermost-and-n8n/","icon":"📹","label":"The ultimate guide to automate your video collaboration with Whereby, Mattermost, and n8n"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/learn-to-build-powerful-api-endpoints-using-webhooks/","icon":"🧰","label":"Learn to Build Powerful API Endpoints Using Webhooks"},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/a-low-code-bitcoin-ticker-built-with-questdb-and-n8n-io/","icon":"📈","label":"A low-code bitcoin ticker built with QuestDB and n8n.io"},{"url":"https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/","icon":"🎡","label":"How to set up a no-code CI/CD pipeline with GitHub and TravisCI"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Data Transformation"]}}},"group":"[\"input\"]","defaults":{"name":"Edit Fields"},"iconData":{"icon":"pen","type":"icon"},"displayName":"Edit Fields (Set)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":39,"icon":"fa:sync","name":"n8n-nodes-base.splitInBatches","codex":{"data":{"alias":["Loop","Concatenate","Batch","Split","Split In Batches"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/","icon":" 🕸️","label":"How uProc scraped a multi-page website with a low-code workflow"},{"url":"https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/","icon":"🎖","label":"Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Loop Over Items","color":"#007755"},"iconData":{"icon":"sync","type":"icon"},"displayName":"Loop Over Items (Split in Batches)","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":47,"icon":"file:webhook.svg","name":"n8n-nodes-base.webhook","codex":{"data":{"alias":["HTTP","API","Build","WH"],"resources":{"generic":[{"url":"https://n8n.io/blog/learn-how-to-automatically-cross-post-your-content-with-n8n/","icon":"✍️","label":"Learn how to automatically cross-post your content with n8n"},{"url":"https://n8n.io/blog/running-n8n-on-ships-an-interview-with-maranics/","icon":"🛳","label":"Running n8n on ships: An interview with Maranics"},{"url":"https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/","icon":"🔗","label":"How to build a low-code, self-hosted URL shortener in 3 steps"},{"url":"https://n8n.io/blog/what-are-apis-how-to-use-them-with-no-code/","icon":" 🪢","label":"What are APIs and how to use them with no code"},{"url":"https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/","icon":"⚡️","label":"5 tasks you can automate with the new Notion API "},{"url":"https://n8n.io/blog/how-a-digital-strategist-uses-n8n-for-online-marketing/","icon":"💻","label":"How a digital strategist uses n8n for online marketing"},{"url":"https://n8n.io/blog/the-ultimate-guide-to-automate-your-video-collaboration-with-whereby-mattermost-and-n8n/","icon":"📹","label":"The ultimate guide to automate your video collaboration with Whereby, Mattermost, and n8n"},{"url":"https://n8n.io/blog/how-to-automatically-give-kudos-to-contributors-with-github-slack-and-n8n/","icon":"👏","label":"How to automatically give kudos to contributors with GitHub, Slack, and n8n"},{"url":"https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/","icon":"🤖","label":"5 workflow automations for Mattermost that we love at n8n"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/creating-custom-incident-response-workflows-with-n8n/","label":"How to automate every step of an incident response workflow"},{"url":"https://n8n.io/blog/learn-to-build-powerful-api-endpoints-using-webhooks/","icon":"🧰","label":"Learn to Build Powerful API Endpoints Using Webhooks"},{"url":"https://n8n.io/blog/learn-how-to-use-webhooks-with-mattermost-slash-commands/","icon":"🦄","label":"Learn how to use webhooks with Mattermost slash commands"},{"url":"https://n8n.io/blog/how-goomer-automated-their-operations-with-over-200-n8n-workflows/","icon":"🛵","label":"How Goomer automated their operations with over 200 n8n workflows"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"trigger\"]","defaults":{"name":"Webhook"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCI+PHBhdGggZmlsbD0iIzM3NDc0ZiIgZD0iTTM1IDM3Yy0yLjIgMC00LTEuOC00LTRzMS44LTQgNC00IDQgMS44IDQgNC0xLjggNC00IDQiLz48cGF0aCBmaWxsPSIjMzc0NzRmIiBkPSJNMzUgNDNjLTMgMC01LjktMS40LTcuOC0zLjdsMy4xLTIuNWMxLjEgMS40IDIuOSAyLjMgNC43IDIuMyAzLjMgMCA2LTIuNyA2LTZzLTIuNy02LTYtNmMtMSAwLTIgLjMtMi45LjdsLTEuNyAxTDIzLjMgMTZsMy41LTEuOSA1LjMgOS40YzEtLjMgMi0uNSAzLS41IDUuNSAwIDEwIDQuNSAxMCAxMFM0MC41IDQzIDM1IDQzIi8+PHBhdGggZmlsbD0iIzM3NDc0ZiIgZD0iTTE0IDQzQzguNSA0MyA0IDM4LjUgNCAzM2MwLTQuNiAzLjEtOC41IDcuNS05LjdsMSAzLjlDOS45IDI3LjkgOCAzMC4zIDggMzNjMCAzLjMgMi43IDYgNiA2czYtMi43IDYtNnYtMmgxNXY0SDIzLjhjLS45IDQuNi01IDgtOS44IDgiLz48cGF0aCBmaWxsPSIjZTkxZTYzIiBkPSJNMTQgMzdjLTIuMiAwLTQtMS44LTQtNHMxLjgtNCA0LTQgNCAxLjggNCA0LTEuOCA0LTQgNCIvPjxwYXRoIGZpbGw9IiMzNzQ3NGYiIGQ9Ik0yNSAxOWMtMi4yIDAtNC0xLjgtNC00czEuOC00IDQtNCA0IDEuOCA0IDQtMS44IDQtNCA0Ii8+PHBhdGggZmlsbD0iI2U5MWU2MyIgZD0ibTE1LjcgMzQtMy40LTIgNS45LTkuN2MtMi0xLjktMy4yLTQuNS0zLjItNy4zIDAtNS41IDQuNS0xMCAxMC0xMHMxMCA0LjUgMTAgMTBjMCAuOS0uMSAxLjctLjMgMi41bC0zLjktMWMuMS0uNS4yLTEgLjItMS41IDAtMy4zLTIuNy02LTYtNnMtNiAyLjctNiA2YzAgMi4xIDEuMSA0IDIuOSA1LjFsMS43IDF6Ii8+PC9zdmc+"},"displayName":"Webhook","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":514,"icon":"fa:pause-circle","name":"n8n-nodes-base.wait","codex":{"data":{"alias":["pause","sleep","delay","timeout"],"resources":{"generic":[{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Flow"]}}},"group":"[\"organization\"]","defaults":{"name":"Wait","color":"#804050"},"iconData":{"icon":"pause-circle","type":"icon"},"displayName":"Wait","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":535,"icon":"file:webhook.svg","name":"n8n-nodes-base.respondToWebhook","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.respondtowebhook/"}]},"categories":["Core Nodes","Utility"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"transform\"]","defaults":{"name":"Respond to Webhook"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCI+PHBhdGggZmlsbD0iIzM3NDc0ZiIgZD0iTTM1IDM3Yy0yLjIgMC00LTEuOC00LTRzMS44LTQgNC00IDQgMS44IDQgNC0xLjggNC00IDQiLz48cGF0aCBmaWxsPSIjMzc0NzRmIiBkPSJNMzUgNDNjLTMgMC01LjktMS40LTcuOC0zLjdsMy4xLTIuNWMxLjEgMS40IDIuOSAyLjMgNC43IDIuMyAzLjMgMCA2LTIuNyA2LTZzLTIuNy02LTYtNmMtMSAwLTIgLjMtMi45LjdsLTEuNyAxTDIzLjMgMTZsMy41LTEuOSA1LjMgOS40YzEtLjMgMi0uNSAzLS41IDUuNSAwIDEwIDQuNSAxMCAxMFM0MC41IDQzIDM1IDQzIi8+PHBhdGggZmlsbD0iIzM3NDc0ZiIgZD0iTTE0IDQzQzguNSA0MyA0IDM4LjUgNCAzM2MwLTQuNiAzLjEtOC41IDcuNS05LjdsMSAzLjlDOS45IDI3LjkgOCAzMC4zIDggMzNjMCAzLjMgMi43IDYgNiA2czYtMi43IDYtNnYtMmgxNXY0SDIzLjhjLS45IDQuNi01IDgtOS44IDgiLz48cGF0aCBmaWxsPSIjZTkxZTYzIiBkPSJNMTQgMzdjLTIuMiAwLTQtMS44LTQtNHMxLjgtNCA0LTQgNCAxLjggNCA0LTEuOCA0LTQgNCIvPjxwYXRoIGZpbGw9IiMzNzQ3NGYiIGQ9Ik0yNSAxOWMtMi4yIDAtNC0xLjgtNC00czEuOC00IDQtNCA0IDEuOCA0IDQtMS44IDQtNCA0Ii8+PHBhdGggZmlsbD0iI2U5MWU2MyIgZD0ibTE1LjcgMzQtMy40LTIgNS45LTkuN2MtMi0xLjktMy4yLTQuNS0zLjItNy4zIDAtNS41IDQuNS0xMCAxMC0xMHMxMCA0LjUgMTAgMTBjMCAuOS0uMSAxLjctLjMgMi41bC0zLjktMWMuMS0uNS4yLTEgLjItMS41IDAtMy4zLTIuNy02LTYtNnMtNiAyLjctNiA2YzAgMi4xIDEuMSA0IDIuOSA1LjFsMS43IDF6Ii8+PC9zdmc+"},"displayName":"Respond to Webhook","typeVersion":2,"nodeCategories":[{"id":7,"name":"Utility"},{"id":9,"name":"Core Nodes"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":834,"icon":"file:code.svg","name":"n8n-nodes-base.code","codex":{"data":{"alias":["cpde","Javascript","JS","Python","Script","Custom Code","Function"],"details":"The Code node allows you to execute JavaScript in your workflow.","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Code"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjgzIDM1LjgxNzIgOTAuMjgzIDgwVjE3NkM5MC4yODMgMjA2LjkyOCA2NS4yMTA5IDIzMiAzNC4yODMgMjMySDIzQzE2LjM3MjYgMjMyIDExIDIzNy4zNzIgMTEgMjQ0VjI2OEMxMSAyNzQuNjI3IDE2LjM3MjQgMjgwIDIyLjk5OTYgMjgwTDM0LjI4MyAyODBDNjUuMjEwOSAyODAgOTAuMjgzIDMwNS4wNzIgOTAuMjgzIDMzNlY0NDBDOTAuMjgzIDQ3OS43NjQgMTIyLjUxOCA1MTIgMTYyLjI4MyA1MTJIMTk2LjVDMjAzLjEyNyA1MTIgMjA4LjUgNTA2LjYyNyAyMDguNSA1MDBWNDc2QzIwOC41IDQ2OS4zNzMgMjAzLjEyNyA0NjQgMTk2LjUgNDY0SDE2Mi4yODNDMTQ5LjAyOCA0NjQgMTM4LjI4MyA0NTMuMjU1IDEzOC4yODMgNDQwVjMzNkMxMzguMjgzIDMwOS4wMjIgMTI4LjAxMSAyODQuNDQzIDExMS4xNjQgMjY1Ljk2MUMxMDYuMTA5IDI2MC40MTYgMTA2LjEwOSAyNTEuNTg0IDExMS4xNjQgMjQ2LjAzOUMxMjguMDExIDIyNy41NTcgMTM4LjI4MyAyMDIuOTc4IDEzOC4yODMgMTc2VjgwQzEzOC4yODMgNjIuMzI2OSAxNTIuNjEgNDggMTcwLjI4MyA0OFoiIGZpbGw9IiNGRjk5MjIiLz4KPHBhdGggZD0iTTMwNSAzNkMzMDUgNDIuNjI3NCAzMTAuMzczIDQ4IDMxNyA0OEgzNDIuOTc5QzM2MC42NTIgNDggMzc0Ljk3OCA2Mi4zMjY5IDM3NC45NzggODBWMTc2QzM3NC45NzggMjAyLjk3OCAzODUuMjUxIDIyNy41NTcgNDAyLjA5OCAyNDYuMDM5QzQwNy4xNTMgMjUxLjU4NCA0MDcuMTUzIDI2MC40MTYgNDAyLjA5OCAyNjUuOTYxQzM4NS4yNTEgMjg0LjQ0MyAzNzQuOTc4IDMwOS4wMjIgMzc0Ljk3OCAzMzZWNDMyQzM3NC45NzggNDQ5LjY3MyAzNjAuNjUyIDQ2NCAzNDIuOTc5IDQ2NEgzMTdDMzEwLjM3MyA0NjQgMzA1IDQ2OS4zNzMgMzA1IDQ3NlY1MDBDMzA1IDUwNi42MjcgMzEwLjM3MyA1MTIgMzE3IDUxMkgzNDIuOTc5QzM4Ny4xNjEgNTEyIDQyMi45NzggNDc2LjE4MyA0MjIuOTc4IDQzMlYzMzZDNDIyLjk3OCAzMDUuMDcyIDQ0OC4wNTEgMjgwIDQ3OC45NzkgMjgwSDQ5MEM0OTYuNjI3IDI4MCA1MDIgMjc0LjYyOCA1MDIgMjY4VjI0NEM1MDIgMjM3LjM3MyA0OTYuNjI4IDIzMiA0OTAgMjMyTDQ3OC45NzkgMjMyQzQ0OC4wNTEgMjMyIDQyMi45NzggMjA2LjkyOCA0MjIuOTc4IDE3NlY4MEM0MjIuOTc4IDM1LjgxNzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Code","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":1119,"icon":"fa:robot","name":"@n8n/n8n-nodes-langchain.agent","codex":{"data":{"alias":["LangChain","Chat","Conversational","Plan and Execute","ReAct","Tools"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Agents","Root Nodes"]}}},"group":"[\"transform\"]","defaults":{"name":"AI Agent","color":"#404040"},"iconData":{"icon":"robot","type":"icon"},"displayName":"AI Agent","typeVersion":3,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1262,"icon":"file:google.svg","name":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatgooglegemini/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]}}},"group":"[\"transform\"]","defaults":{"name":"Google Gemini Chat Model"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDggNDgiPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNNDQuNSAyMEgyNHY4LjVoMTEuOEMzNC43IDMzLjkgMzAuMSAzNyAyNCAzN2MtNy4yIDAtMTMtNS44LTEzLTEzczUuOC0xMyAxMy0xM2MzLjEgMCA1LjkgMS4xIDguMSAyLjlsNi40LTYuNEMzNC42IDQuMSAyOS42IDIgMjQgMiAxMS44IDIgMiAxMS44IDIgMjRzOS44IDIyIDIyIDIyYzExIDAgMjEtOCAyMS0yMiAwLTEuMy0uMi0yLjctLjUtNCIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBmaWxsPSIjRkJCQzA1IiBkPSJNMCAzN1YxMWwxNyAxM3oiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiNFQTQzMzUiIGQ9Im0wIDExIDE3IDEzIDctNi4xTDQ4IDE0VjBIMHoiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiMzNEE4NTMiIGQ9Im0wIDM3IDMwLTIzIDcuOSAxTDQ4IDB2NDhIMHoiIGNsaXAtcGF0aD0idXJsKCNiKSIvPjxwYXRoIGZpbGw9IiM0Mjg1RjQiIGQ9Ik00OCA0OCAxNyAyNGwtNC0zIDM1LTEweiIgY2xpcC1wYXRoPSJ1cmwoI2IpIi8+PC9zdmc+"},"displayName":"Google Gemini Chat Model","typeVersion":1,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1315,"icon":"fa:table","name":"n8n-nodes-base.dataTable","codex":{"data":{"alias":["data","table","knowledge","data table","table","sheet","database","data base","mysql","postgres","postgresql","airtable","supabase","noco","notion"],"details":"Data table","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.datatable/"}]},"categories":["Core Nodes","Development"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\",\"transform\"]","defaults":{"name":"Data table"},"iconData":{"icon":"table","type":"icon"},"displayName":"Data table","typeVersion":1,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]}],"categories":[{"id":40,"name":"Support Chatbot"},{"id":47,"name":"AI Chatbot"}],"image":[]}}