{
  "name": "Multi-Agent AI Clinic Management with WhatsApp, Telegram, and Google Calendar",
  "nodes": [
    {
      "id": "84ce6905-4416-4721-8627-f8c303730a4f",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        8260,
        2260
      ]
    },
    {
      "id": "a6e9358a-a873-49f3-af38-21ca545b2bfc",
      "name": "Assistente clinica interno",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        8380,
        2020
      ]
    },
    {
      "id": "d674fb31-cf45-47ac-b33b-4abe1920e352",
      "name": "Google Tasks",
      "type": "n8n-nodes-base.googleTasksTool",
      "position": [
        8720,
        2320
      ]
    },
    {
      "id": "dff00a3c-6496-4104-afc4-a0556f3cabfa",
      "name": "MCP Google Calendar",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        8560,
        2320
      ]
    },
    {
      "id": "10a0bda3-94b3-487a-98a1-1e7badcc8775",
      "name": "Receber Mensagem Telegram",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        8100,
        2020
      ]
    },
    {
      "id": "46cfa6be-f896-4e33-be3d-b4ef676c043b",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        8420,
        2300
      ]
    },
    {
      "id": "c79c44f6-94fa-4e56-9d94-49185f83bfb4",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        5860,
        3980
      ]
    },
    {
      "id": "5e7ac239-6ba1-414c-b11d-d637361e8f77",
      "name": "Assistente Clínica",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5960,
        3760
      ]
    },
    {
      "id": "2f0a6ea1-7654-4ae7-884e-d5b8ff47d4f9",
      "name": "Enviar alerta de cancelamento",
      "type": "n8n-nodes-base.telegramTool",
      "position": [
        6400,
        3980
      ]
    },
    {
      "id": "8ddaa14f-7d2f-4364-8ff7-f87e0a428e37",
      "name": "Gatilho diário",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        8060,
        2780
      ]
    },
    {
      "id": "0784753d-123d-4259-abcc-8abf39e7fc07",
      "name": "Assistente de confirmação",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        8280,
        2680
      ]
    },
    {
      "id": "afa90e86-0f44-4069-976b-ca302b0d828a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5840,
        4460
      ]
    },
    {
      "id": "13179a70-85b6-4e18-8736-eb2cdd252591",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6960,
        2580
      ],
      "parameters": {
        "width": 1940,
        "height": 600,
        "content": "# \"Appointment Confirmation Assistant\"\nDescription:\n\nPurpose:\nThis section contains the configuration for the Appointment Confirmation Assistant, an agent specialized in confirming scheduled appointme"
      }
    },
    {
      "id": "4111432b-2ddc-4e96-ba6d-d25e003e2688",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4760,
        3620
      ],
      "parameters": {
        "width": 1780,
        "height": 640,
        "content": "# \"Agent Core Components (Tools, MCP, Memory, LLM Model)\"\nDescription:\n\nPurpose:\n\nThis sticky note represents the essential structure of any intelligent agent: it includes access to external tools,\n p"
      }
    },
    {
      "id": "4b59f903-07c2-4e66-9ea1-0727beb0d85c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4640,
        4300
      ],
      "parameters": {
        "width": 1800,
        "height": 640,
        "content": "# \"Processing and Sending WhatsApp Responses\"\nDescription:\n\nPurpose:\nThis section is responsible for processing, formatting, and sending outbound WhatsApp messages to patients through the Evolution AP"
      }
    },
    {
      "id": "274f7f66-7613-4e9e-868d-a5705156dde6",
      "name": "Postgres Chat Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        6000,
        3980
      ]
    },
    {
      "id": "654ed617-df1a-48db-b9bc-833b2c1ecb80",
      "name": "MCP Google Calendar2",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        6120,
        3980
      ]
    },
    {
      "id": "b11aeec6-b446-4c02-a0b0-7f9239628df3",
      "name": "MCP GMAIL",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        8540,
        3000
      ]
    },
    {
      "id": "f5a38b34-499e-4bbc-9282-ce5f4a3b85a3",
      "name": "MCP CALENDAR",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        8380,
        3000
      ]
    },
    {
      "id": "cd6a6147-fd18-4cd4-8aab-fcb454ab76b7",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        8740,
        2020
      ]
    },
    {
      "id": "900b8c1a-f987-4898-9fc1-bfc673773e06",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        5760,
        4680
      ]
    },
    {
      "id": "1584b448-d8f5-4bab-ad9a-9b07edb8e102",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        5760,
        2100
      ]
    },
    {
      "id": "74b5179f-502c-45d6-88e9-2c2d492603cd",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        6000,
        2100
      ]
    },
    {
      "id": "ce22f5bc-f0e1-463d-9b9a-5112f8d91f00",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        6240,
        2080
      ]
    },
    {
      "id": "c78ee758-fb71-4a4f-9450-0ffcd67a2af2",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4960,
        1840
      ],
      "parameters": {
        "width": 1580,
        "height": 640,
        "content": "# Incoming WhatsApp Webhook and Message Type Handling\"\nDescription:\n\nPurpose:\nManages the initial reception and classification of incoming WhatsApp messages from patients via the webhook system.\n\nInst"
      }
    },
    {
      "id": "83abbf61-91e2-4d1c-a42a-4f05b18583e7",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6380,
        3260
      ]
    },
    {
      "id": "4c2dcefc-fb65-42ca-8c63-8636f2906654",
      "name": "Evolution API",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        5860,
        3260
      ]
    },
    {
      "id": "85909834-7564-478b-bce8-0c3fe7bf4159",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        6100,
        3260
      ]
    },
    {
      "id": "3e200157-fbcc-4225-b982-2dfaea54cc23",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4980,
        3100
      ],
      "parameters": {
        "width": 1760,
        "height": 480,
        "content": "## \"Download Audio and Convert to MP4\"\nDescription:\n\nPurpose:\nHandles retrieval, conversion, and transcription of audio files sent by patients via WhatsApp.\n\nInstructions for Use:\n\nEvolution API downl"
      }
    },
    {
      "id": "5862d5f1-2df4-40ee-881f-a6d6e302602f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4920,
        2540
      ],
      "parameters": {
        "width": 1820,
        "height": 480,
        "content": "# \"Extract Text from Images\"\nDescription:\n\nPurpose:\nProcesses images received via WhatsApp to extract text (OCR) and describe their visual content for further contextual analysis.\n\nInstructions for Us"
      }
    },
    {
      "id": "8dbd4e6d-8b38-44d8-ba45-5cac2713f6ca",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5980,
        2620
      ]
    },
    {
      "id": "19e8d50d-4f87-408e-96f0-236932c1d120",
      "name": "AI Agent2",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        6200,
        2620
      ]
    },
    {
      "id": "0d2f9842-b011-49f5-9594-24a917dee60e",
      "name": "OpenRouter Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        6100,
        2860
      ]
    },
    {
      "id": "58f7f9c7-6f86-40ff-bfad-5467e5b3a9e4",
      "name": "Evolution API2",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        6200,
        4460
      ]
    },
    {
      "id": "2b529ab1-2a7e-44e0-b7c8-ed05e07c6def",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6960,
        1840
      ],
      "parameters": {
        "width": 1960,
        "height": 680,
        "content": "## \"Internal Clinic Assistant\"\nDescription:\n\nPurpose:\nRepresents the Internal Assistant for the clinic, used exclusively by the internal team via Telegram to manage patient rescheduling and manage a p"
      }
    },
    {
      "id": "a4a51bd1-48a6-4e32-b696-0ae77a0e05fe",
      "name": "CallToHuman",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        6240,
        4000
      ]
    },
    {
      "id": "674c5c75-a954-4306-8a02-71bdda89293c",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        8260,
        2840
      ]
    },
    {
      "id": "b398627e-2fbe-44e4-ac2f-523b03871eda",
      "name": "REMINDER",
      "type": "n8n-nodes-evolution-api.evolutionApi",
      "position": [
        8640,
        2700
      ]
    }
  ],
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "Assistente Clínica",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Assistente Clínica",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Evolution API",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "AI Agent2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Evolution API2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent2": {
      "main": [
        [
          {
            "node": "Assistente Clínica",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP GMAIL": {
      "ai_tool": [
        [
          {
            "node": "Assistente de confirmação",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "CallToHuman": {
      "ai_tool": [
        [
          {
            "node": "Assistente Clínica",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Tasks": {
      "ai_tool": [
        [
          {
            "node": "Assistente clinica interno",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MCP CALENDAR": {
      "ai_tool": [
        [
          {
            "node": "Assistente de confirmação",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Evolution API": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gatilho diário": {
      "main": [
        [
          {
            "node": "Assistente de confirmação",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Assistente Clínica",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Assistente clinica interno",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Assistente de confirmação",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Assistente Clínica": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MCP Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Assistente clinica interno",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "MCP Google Calendar2": {
      "ai_tool": [
        [
          {
            "node": "Assistente Clínica",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "Assistente clinica interno",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory1": {
      "ai_memory": [
        [
          {
            "node": "Assistente Clínica",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Receber Mensagem Telegram": {
      "main": [
        [
          {
            "node": "Assistente clinica interno",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assistente clinica interno": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Assistente de confirmação": {
      "main": [
        [
          {
            "node": "REMINDER",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar alerta de cancelamento": {
      "ai_tool": [
        [
          {
            "node": "Assistente Clínica",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}