{
  "name": "Automated law firm lead management & scheduling with AI, Jotform & Calendar",
  "nodes": [
    {
      "id": "0fa7eed1-0e6d-4370-bb11-2500e93c2ef0",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -1024,
        256
      ]
    },
    {
      "id": "0c107533-b8d0-4dc8-a073-7138a7288146",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -800,
        256
      ]
    },
    {
      "id": "69795336-f1ce-4ce8-b7fc-4379418cb83e",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -528,
        256
      ]
    },
    {
      "id": "95a55ce6-3967-4a6b-ba11-57ba9c9d0998",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -528,
        528
      ]
    },
    {
      "id": "b06b2984-c342-4db7-a46b-06679b0080db",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        240,
        320
      ]
    },
    {
      "id": "a715deb0-e11f-46df-b4ae-1cb4c214c183",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        496,
        320
      ]
    },
    {
      "id": "e157f8f8-f9da-4f03-baa3-114b199d36e0",
      "name": "GET MANY EVENTS OF DAY THE USER ASKED",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        976,
        544
      ]
    },
    {
      "id": "a4b80f3b-caf8-40c7-b787-c090b5010755",
      "name": "Create an event",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        1136,
        544
      ]
    },
    {
      "id": "937a57e5-4e9e-4302-99a7-e38ff770e453",
      "name": "Google Gemini Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        656,
        544
      ]
    },
    {
      "id": "ed687b20-55af-41a3-b815-0044bf238692",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        912,
        336
      ]
    },
    {
      "id": "6cda0580-9e50-4406-a794-2d9315498f0e",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        816,
        544
      ]
    },
    {
      "id": "4891245b-9402-44b6-8632-d6f1053a8f54",
      "name": "Know about the user enquiry",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1296,
        544
      ]
    },
    {
      "id": "3021dcef-b9ef-4a87-abe6-992081b72600",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -144,
        256
      ]
    },
    {
      "id": "6aad2ba5-1451-4150-b28a-f760061e8341",
      "name": "Send message1",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1424,
        336
      ]
    },
    {
      "id": "b90257f8-e8c0-4c63-9713-6052a9785d8f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -352
      ],
      "parameters": {
        "width": 1136,
        "height": 1056,
        "content": "## Part A: New Lead Intake & Welcome Message\n\nThis flow triggers when a potential client fills out your JotForm. It saves their data and sends an immediate welcome message.\n\n* **1. JotForm Trigger** 📥"
      }
    },
    {
      "id": "b7acce1b-992f-42bc-b9f7-4ee7670b412e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -336
      ],
      "parameters": {
        "width": 1456,
        "height": 1056,
        "content": "\n## Part B: AI-Powered Appointment Scheduling\n\nThis flow activates when the client replies to the welcome message. An AI agent then chats with them to book a consultation.\n\n* **1. WhatsApp Trigger** 💬"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [],
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Send message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message": {
      "main": [
        []
      ]
    },
    "Create an event": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Know about the user enquiry": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET MANY EVENTS OF DAY THE USER ASKED": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}