{
  "name": "Book beauty appointments and answer FAQs with GPT-4, Google Calendar, Gmail, and Instagram",
  "nodes": [
    {
      "id": "fd3f6017-2837-438f-ba19-543a2ff8cc93",
      "name": "Instagram Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -400,
        176
      ]
    },
    {
      "id": "4de714d5-a2c9-41e5-9778-20801762baf6",
      "name": "Extract Sender & Text",
      "type": "n8n-nodes-base.set",
      "position": [
        -208,
        176
      ]
    },
    {
      "id": "29e8d63e-88c6-47d5-a0fd-de0e01b15924",
      "name": "Is Voice Message?",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        176
      ]
    },
    {
      "id": "b5451385-0b0e-4b3a-86ac-5056da71ea23",
      "name": "Download Voice Audio",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        496,
        96
      ]
    },
    {
      "id": "b6270f32-48f9-4834-ac39-12e744f3b2ec",
      "name": "Transcribe Voice Message",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        720,
        96
      ]
    },
    {
      "id": "cfab60c5-c521-4fc7-a6c6-f198bcae6b25",
      "name": "Normalize User Message",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        160
      ]
    },
    {
      "id": "2b9d7079-4ad4-4678-b08e-49482ea8942e",
      "name": "FAQs (Google Docs)",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        2272,
        528
      ]
    },
    {
      "id": "e57e2758-48fe-4bee-a8be-6101b8a62d6c",
      "name": "Get Current Date & Time",
      "type": "n8n-nodes-base.dateTimeTool",
      "position": [
        2096,
        528
      ]
    },
    {
      "id": "a5efa131-7622-4b95-90a3-0ccd416ab466",
      "name": "Check Date Availability",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1936,
        512
      ]
    },
    {
      "id": "06cc1c22-a6a1-44a7-aa73-26a0c1e365e6",
      "name": "Create Calendar Reservation",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1808,
        512
      ]
    },
    {
      "id": "72cf4246-56e0-4732-9f2d-15c43024b84b",
      "name": "Send Confirmation Email",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1664,
        512
      ]
    },
    {
      "id": "408a3ee5-d541-4d40-86bc-367c0d824ab8",
      "name": "Send Instagram Reply",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2288,
        160
      ]
    },
    {
      "id": "06a5feef-903d-499e-9fb8-939aa64b9284",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1536,
        528
      ]
    },
    {
      "id": "6a045093-3458-4bb0-930c-c096b63bdc7d",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1424,
        496
      ]
    },
    {
      "id": "8e19082e-449c-4d23-88ed-64aadb3a5906",
      "name": "Check is_ecco",
      "type": "n8n-nodes-base.if",
      "position": [
        -16,
        176
      ]
    },
    {
      "id": "2fd54844-2763-40a9-9bec-68d84bd2b676",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        0
      ],
      "parameters": {
        "width": 640,
        "height": 352,
        "content": "## Preparing incoming messages\n**Extracts the incoming Instagram message and ensures it is the user’s message, not an echo or system response** "
      }
    },
    {
      "id": "f736f6d9-28c8-4373-8775-06f6f3c37072",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        0
      ],
      "parameters": {
        "width": 752,
        "height": 352,
        "content": "## Handling Voice messages\n**Filters voice messages, downloads the audio, and transcribes it into text**"
      }
    },
    {
      "id": "d3d338fb-2fd9-40a5-ba4d-2f8ac1b1ef9f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        0
      ],
      "parameters": {
        "width": 400,
        "height": 352,
        "content": "## Preparing final message\n**Normalizes the message so both text and voice inputs follow the same format before AI processing**"
      }
    },
    {
      "id": "3d3acf67-30f2-4258-89c3-957e2ced75bd",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        0
      ],
      "parameters": {
        "width": 1184,
        "height": 672,
        "content": "## Main message processing\n**Handles customer questions using the business FAQ, checks availability for appointments, creates calendar bookings, and sends confirmation emails**"
      }
    },
    {
      "id": "bd1d57c0-390e-4652-8d91-38f36716dedb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -480
      ],
      "parameters": {
        "width": 288,
        "height": 1104,
        "content": "## How it works\n\nThis workflow creates an AI assistant for Instagram direct messages.\n\nIncoming messages are received through a webhook. Text and voice messages are handled in the same flow. Voice mes"
      }
    },
    {
      "id": "9da0479b-0841-4ea7-ae6c-cb5ea16b2bde",
      "name": "Instagram AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1680,
        160
      ]
    }
  ],
  "connections": {
    "Check is_ecco": {
      "main": [
        [],
        [
          {
            "node": "Is Voice Message?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Is Voice Message?": {
      "main": [
        [
          {
            "node": "Download Voice Audio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Normalize User Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "FAQs (Google Docs)": {
      "ai_tool": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Instagram AI Agent": {
      "main": [
        [
          {
            "node": "Send Instagram Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Voice Audio": {
      "main": [
        [
          {
            "node": "Transcribe Voice Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Sender & Text": {
      "main": [
        [
          {
            "node": "Check is_ecco",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize User Message": {
      "main": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Date Availability": {
      "ai_tool": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Current Date & Time": {
      "ai_tool": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send Confirmation Email": {
      "ai_tool": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Voice Message": {
      "main": [
        [
          {
            "node": "Normalize User Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Webhook Trigger": {
      "main": [
        [
          {
            "node": "Extract Sender & Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Calendar Reservation": {
      "ai_tool": [
        [
          {
            "node": "Instagram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}