{
  "id": "2CrCmc820XAaHFHL",
  "meta": {
    "instanceId": "0113e6e8f0b87d10de7bde5508e446a6ee60d5da9eac8c7eea34b85efc06e886",
    "templateCredsSetupCompleted": true
  },
  "name": "SmartMail Agent – Your AI Email Assistant, Powered by WhatsApp",
  "tags": [],
  "nodes": [
    {
      "id": "85a2e149-585b-485b-bcfc-0b4097193e39",
      "name": "Email Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        2480,
        -3100
      ],
      "parameters": {
        "text": "={{ $json.message_type }}\n",
        "options": {
          "systemMessage": "=# Overview  \nYou are an AI assistant specialized in managing email-related tasks and providing direct, actionable responses in French and English.\n\n## Context  \n- You are a general-purpose assistant supporting users in email communication and message automation.  \n- You operate in both French and English, depending on the language of the input.  \n- Your tone is strategic, clear, and focused on delivering concise responses.  \n\n## Instructions  \n1. Always validate the presence of actual message content before replying.  \n2. If the input is a greeting (e.g., \"Bonjour\", \"Merci\", \"comment tu vas\"), respond in a concise and friendly tone.  \n3. Format all email replies using HTML for clarity and structure.  \n4. If necessary, ask strategic questions to clarify vague requests or guide toward specific actions.  \n5. Respond directly to the user's message with a final sentence. Do not explain, structure, or rephrase the request.  \n6. If the input is unclear or lacks actionable content, request clarification.  \n7. You must never justify or comment on your actions.  \n\n## Tools    \n- Create Draft  \n- Send Email  \n\n## Examples  \n- Input: \"Bonjour\"  \n  - Output: \"Bonjour ! Ca va très bien, merci. Comment puis-je vous aider aujourd’hui ?\"  \n- Input: \"Envoies un email à Florence.\"  \n  - Output: \"L'email a été envoyé à Florence à l'adresse email suivante : xxx@nomdedomaine\"  \n- Input: \"Merci\"  \n  - Output: \"Avec plaisir ! 😊\"  \n\n## SOP (Standard Operating Procedure)  \n1. Check if the message contains usable content.  \n2. If empty, determine if it's a greeting; if not, request clarification.  \n3. Compose the email using this HTML format:  \n   \"Hello [Name],  \n   <br><br>  \n   [Content]  \n   <br><br>  \n   Best regards,  \n   <br>  \n   [Your Name]\"  \n4. Send or draft the email as instructed.  \n5. Log the outcome of the action if needed.  \n\n## Final Notes  \n- Your role is to provide fast, clean, and final outputs.  \n- Prioritize simple, scalable, and personalized interactions.  \n- All responses are time-sensitive and context-aware.  \n\nCurrent time is {{ $now.format('yyyy-MM-dd') }}  \nTime zone: Paris/Europe  \n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "8b3fbab7-d5f4-4ab9-9468-e492586c5d2e",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        2200,
        -2680
      ],
      "webhookId": "ea31e63d-e6c5-4f6d-b17f-9ecda87e11c8",
      "parameters": {
        "sendTo": "={{ $fromAI(\"emailAddress\") }}",
        "message": "={{ $fromAI(\"emailBody\") }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $fromAI(\"subject\") }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "eefaed16-798f-4060-9be2-9b527ecd4a56",
      "name": "Create Draft",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        2360,
        -2680
      ],
      "webhookId": "c40fc123-5d3d-4002-85bd-ec6603a0ad83",
      "parameters": {
        "message": "={{ $fromAI(\"emailBody\") }}",
        "options": {
          "sendTo": "={{ $fromAI(\"emailAddress\") }}"
        },
        "subject": "={{ $fromAI(\"subject\") }}",
        "resource": "draft",
        "emailType": "html"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5b47751d-88f0-4e7c-aecb-df220f672b08",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2040,
        -2680
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4-turbo-preview",
          "cachedResultName": "gpt-4-turbo-preview"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "67d7f391-46ba-43ba-b988-35a68b46acdd",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        1660,
        -3860
      ],
      "webhookId": "2eadd11a-88fa-4423-9ff4-411c12094729",
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "credential-id",
          "name": "whatsAppTriggerApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "05fa762a-94e2-49cb-8236-5d12dfa046cd",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1980,
        -3860
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b969c18d-14dd-4b34-8d08-801d8818b8d2",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('WhatsApp Trigger').item.json.messages[0].type }}",
                    "rightValue": "audio"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1daa0ee5-cb8b-44c4-ae74-954cae03c10d",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('WhatsApp Trigger').item.json.messages[0].type }}",
                    "rightValue": "text"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "d3bbad47-a4b0-4bc0-a807-adffb4914bde",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2360,
        -3940
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2451cc94-89b3-4163-a278-ef54c3302ec6",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2540,
        -3940
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "12942040-c126-4ce3-8549-9f0f0c62cf46",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        2500,
        -3760
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7453a002-ec0f-4853-a28d-5d06669cb5d0",
              "name": "text",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "74d29419-8fe1-4d68-84f7-1584e71abc22",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1820,
        -3860
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "={{ $json.field }}"
      },
      "typeVersion": 1
    },
    {
      "id": "b49b0f86-49bf-4e22-afc3-b13639e34c3d",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        2720,
        -3760
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8cbf25ac-3fc9-4892-9c6a-24c974b03362",
              "name": "message_type",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "49837ff2-bb28-47fe-97d4-6f6d2840586a",
      "name": "WhatsApp Business Cloud1",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1940,
        -1680
      ],
      "webhookId": "b89990f8-a463-4af2-a732-902da14bb3c2",
      "parameters": {
        "textBody": "={{ $json.output }}",
        "operation": "send",
        "phoneNumberId": "580438095157298",
        "additionalFields": {},
        "recipientPhoneNumber": "+1234567890"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "86e22c41-98a6-400f-8945-afd724f05c14",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "disabled": true,
      "position": [
        1860,
        -2680
      ],
      "parameters": {
        "sessionKey": "={{ $('Edit Fields1').item.json.message_type }} ",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "4b0530f5-abfc-430c-915e-482dca9cc932",
      "name": "WhatsApp Business Cloud",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2180,
        -3940
      ],
      "webhookId": "a4388d29-c2c7-45c4-8977-b768eacf997b",
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2e755031-6f6a-4280-bf13-4fc5cc1ccbe4",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1920,
        -1900
      ],
      "parameters": {
        "input": "={{ $json.output }}",
        "voice": "nova",
        "options": {},
        "resource": "audio"
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a9a3bf53-ea40-4206-9f54-159f96db2f79",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        2160,
        -1900
      ],
      "parameters": {
        "jsCode": "// Loop over input items and change the MIME type of binary data\nfor (const item of $input.all()) {\n\t// Check if the item has binary data\n\tif (item.binary) {\n\t\t// Find the binary property name (assuming there's at least one)\n\t\tconst binaryPropertyNames = Object.keys(item.binary);\n\n\t\tfor (const propName of binaryPropertyNames) {\n\t\t\t// If the MIME type is 'audio/mp3', change it to 'audio/mpeg'\n\t\t\tif (item.binary[propName].mimeType === 'audio/mp3') {\n\t\t\t\titem.binary[propName].mimeType = 'audio/mpeg';\n\t\t\t}\n\t\t}\n\t}\n}\n\nreturn $input.all();\n"
      },
      "typeVersion": 2
    },
    {
      "id": "32005f45-3bb2-4da0-887a-b89fbe49a7ba",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1640,
        -1880
      ],
      "parameters": {
        "options": {
          "ignoreCase": false
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "2163dc40-756e-479a-b7fd-1418ac129a61",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('WhatsApp Trigger').item.json.messages[0].type }}",
              "rightValue": "audio"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cec9cff4-b04b-4858-a46c-1caa8e2cc8a2",
      "name": "WhatsApp Business Cloud2",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2400,
        -1900
      ],
      "webhookId": "7116ffeb-dd52-4993-a041-7ceac577b12d",
      "parameters": {
        "resource": "media",
        "phoneNumberId": "580438095157298",
        "additionalFields": {}
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2c9dd33c-6c67-468a-a5bb-16076b08d735",
      "name": "WhatsApp Business Cloud3",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        2640,
        -1900
      ],
      "webhookId": "1957dc07-4009-4a6e-a2a4-11ec08ec9816",
      "parameters": {
        "mediaId": "={{ $json.id }}",
        "mediaPath": "useMediaId",
        "operation": "send",
        "messageType": "audio",
        "phoneNumberId": "580438095157298",
        "additionalFields": {},
        "recipientPhoneNumber": "+1234567890"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "credential-id",
          "name": "whatsAppApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e530836b-5977-4810-a684-4d4d71bd82c3",
      "name": "Get Email",
      "type": "n8n-nodes-base.airtableTool",
      "position": [
        2520,
        -2680
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "app6hvrEDwB41AKAz",
          "cachedResultUrl": "https://airtable.com/app6hvrEDwB41AKAz",
          "cachedResultName": "[BlockA] - Contact List"
        },
        "limit": 5,
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tbldXug1pLHGc0xoI",
          "cachedResultUrl": "https://airtable.com/app6hvrEDwB41AKAz/tbldXug1pLHGc0xoI",
          "cachedResultName": "Auto"
        },
        "options": {},
        "operation": "search",
        "returnAll": false,
        "filterByFormula": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Filter_By_Formula', ``, 'string') }}"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "credential-id",
          "name": "airtableTokenApi Credential"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "60875323-4791-4782-a7af-855400619f1b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -4460
      ],
      "parameters": {
        "width": 1280,
        "height": 920,
        "content": "## 🟫  Part 1: WhatsApp Message Intake & Voice Transcription\n# Reception WhatsApp & Transcription vocale\n\n🔧 Main Modules:\nWhatsApp Trigger: Listens for new incoming messages.\n\nSplit Out: Breaks down incoming message batches.\n\nSwitch: Identifies the message type (text, image, audio, etc.).\n\nWhatsApp Business Cloud: Retrieves media content.\n\nHTTP Request: Downloads audio files for transcription.\n\nOpenAI (Whisper): Transcribes voice messages into text.\n\nEdit Fields: Cleans and formats the output into structured JSON.\n\n🧠 Goal:\nDetect and transcribe voice messages received via WhatsApp.\nPrepares clean, structured text that can be interpreted by the AI agent for further action."
      },
      "typeVersion": 1
    },
    {
      "id": "b1172ad4-92fe-4a6b-97f7-ccce4bd8f56c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -2380
      ],
      "parameters": {
        "color": 3,
        "width": 1280,
        "height": 940,
        "content": "##  🟥 Part 3: Vocal Response & WhatsApp Feedback\n# Vocal Generation & Personalized WhatsApp Return\n\n🔧 Main Modules:\nOpenAI (Text-to-Voice logic): Generates a personalized summary or confirmation message.\n\nIf: Decides whether to generate a voice message or just a text reply.\n\nCode: Formats the response and adapts the message payload for WhatsApp API.\n\nWhatsApp Business Cloud (media.mediaupload): Sends the audio message file.\n\nWhatsApp Business Cloud (message.send): Sends the final WhatsApp message (text or audio).\n\nOptional: Return text + audio simultaneously for enriched UX.\n\n🧠 Goal:\nRespond back to the client or user directly via WhatsApp, with either a summarized text or an auto-generated voice message — offering clarity, speed, and a human-like touch."
      },
      "typeVersion": 1
    },
    {
      "id": "227b5da7-2ffc-4bf0-ba34-f4fbe1f61297",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -3540
      ],
      "parameters": {
        "color": 4,
        "width": 1280,
        "height": 1160,
        "content": "## 🟩 Part 2: Smart Email Agent – Read, Draft, Respond\n# Email AI Agent – Send, Draft, Reply...\n\n🔧 Main Modules:\nEmail Agent: Core logic and orchestration of all email-related actions.\n\nOpenAI Chat Model: Extracts user intent and provides reasoning based on message.\n\nSimple Memory (Optional): Stores previous interactions.\n\nSend Email: Sends email directly if fully automated.\n\nCreate Draft: Generates a draft email for manual validation.\n\nGet Email (Airtable): Retrieves the recipient’s emails and related content from a contact stored in the database.\n\n🧠 Goal:\nTurn a WhatsApp voice/text instruction into a precise email action: read, summarize, draft, or reply.\nThe agent leverages OpenAI to act intelligently and adapt to the context."
      },
      "typeVersion": 1
    },
    {
      "id": "98b9f159-67e7-421b-a7df-9be564db9db4",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2900,
        -4460
      ],
      "parameters": {
        "color": 5,
        "width": 720,
        "height": 3020,
        "content": "## 📘 Smart Email Agent via WhatsApp – Module-by-Module Setup Guide\n# This guide explains how the already-built template works, detailing each step with the required modules and configurations.\n\n🧩 What You’ll Need\n\nTo deploy this AI-powered email assistant, ensure you have the following:\n\n✅ WhatsApp Business Cloud API access(with a registered phone number and webhook configured)\n✅ OpenAI API Key(used for both GPT and Whisper models)\n✅ Gmail or Google Workspace account(OAuth2 credentials to access email content and send replies)\n✅ Airtable account (free plan is sufficient)(used for contact lookups, template storage, or logging interactions)\n✅ n8n instance(either cloud or self-hosted with HTTPS enabled)\n✅ Basic familiarity with n8n workflow builder\n\n⏱️ Estimated setup time: 30–60 minutes\n\n🟫 Step 1 – Capture WhatsApp Messages\n\nModules:\nWebhook: Listens for WhatsApp events via the Meta API.\nSplit Out: Handles rare fallback events where multiple messages are received in one payload.\nSwitch: Determines the type of message (text, audio, etc.).\nWhatsApp Media Node: Retrieves media ID if it’s an audio message.\nHTTP Request: Downloads the audio file from the media ID.\nOpenAI Whisper: Transcribes audio to text.\n(Optional) Edit Fields: Cleans and standardizes the text for further processing.\n\nWhat Happens:\n\nThis section ensures every incoming message (voice or text) is accurately processed and ready for interpretation.\n\n🟩 Step 2 – Analyze & Process the Email Request\n\nModules:\n\nOpenAI Chat: Extracts the intent from the message (e.g., send, reply, summarize).\n\nGmail Nodes:\n\nGmail: Get Email: Retrieves past email content.\nGmail: Create Draft: Saves a reply as a draft.\nGmail: Send Email: Sends an email directly if action is confirmed.\n\nAirtable:\n\nRetrieves contact information (email, job title, company, etc.).\nLogs key elements for memory (intent, timestamp, status, etc.).\n\nKey Feature:\n\nYour Gut AI Agent — This setup builds a memory by correlating emails and contact profiles inside Airtable. Your agent becomes context-aware, knowing who it's speaking to and what has been exchanged previously.\n\n🟥 Step 3 – Return Smart Feedback via WhatsApp\n\nModules:\n\nOpenAI Chat: Generates a natural-language confirmation of the action taken.\n\n(Optional) TTS/Voice Generation (Tip to strengthen your workflow): Automatically converts the confirmation into a voice message using ElevenLabs - allowing the assistant to communicate feedback in audio form.\n\nCode Node: Ensures the correct MIME type for the audio file (e.g., audio/mp3 → audio/mpeg).\n\nWhatsApp Media Upload: Uploads the audio to WhatsApp Cloud.\n\nWhatsApp Message Sender: Sends the confirmation message (text or voice) back to the user.\n\nAdditional Notes:\n\nThe Code Node loops through binary data to ensure compatibility with WhatsApp's expected audio format.\n\n🔐 Security Best Practices\n\nNever hardcode API keys – use environment variables.\nSecure your Webhook with custom headers.\nMonitor usage and logs regularly.\n\nHandle errors with fallback branches in n8n.\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e85f3f2d-99f2-4df8-b94f-739dcf2c52b1",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "WhatsApp Business Cloud1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Email": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Agent": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Draft": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Email Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Email Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Email Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Business Cloud": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Business Cloud1": {
      "main": [
        []
      ]
    },
    "WhatsApp Business Cloud2": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}