{
  "name": "Qualify real estate leads via SMS with GPT-4o, Twilio, and Google Sheets",
  "nodes": [
    {
      "id": "5a9086c7-c006-4797-9cf6-808e496eb683",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -3220,
        1360
      ]
    },
    {
      "id": "879f41da-4a3d-492a-8b09-f5f8e5bc9a68",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        -2720,
        1900
      ]
    },
    {
      "id": "ab202e50-c344-47ca-a279-0850eb444a21",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1540,
        1840
      ]
    },
    {
      "id": "4dffd5d2-f53d-4b19-b386-efb1eb3dd8df",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -3120,
        1740
      ]
    },
    {
      "id": "58c0ea8f-d5c2-48fb-9137-4a79db9cbe3c",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2920,
        1880
      ]
    },
    {
      "id": "7c2d3782-03d8-4f92-8b3f-9ad4bb080594",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1340,
        1840
      ]
    },
    {
      "id": "1d36cb2c-b6cd-4eda-b052-38950603a25c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3400,
        1200
      ],
      "parameters": {
        "width": 920,
        "height": 320,
        "content": "## Initial Text Message after From Submission\n"
      }
    },
    {
      "id": "6e55dc34-0d89-42dd-853c-56dcb8722d3b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3400,
        1560
      ],
      "parameters": {
        "width": 920,
        "height": 680,
        "content": "## Wait for text response & Reply\n"
      }
    },
    {
      "id": "53ecc0f7-43a7-4570-b1ce-3b50ad365828",
      "name": "Real Estate Qualifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2880,
        1680
      ]
    },
    {
      "id": "88e9c3eb-dc7c-40e6-b483-2ca6009210bd",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        1380
      ],
      "parameters": {
        "width": 1720,
        "height": 860,
        "content": "## Once the conversation is over, summarize and text lead to owner\n"
      }
    },
    {
      "id": "6891b278-3cdd-4c10-93dd-d9d12b137a39",
      "name": "Wait 5 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        -3000,
        1360
      ]
    },
    {
      "id": "6162dad2-af40-4bcb-a08f-cb4b1b33b275",
      "name": "Initial Text Message",
      "type": "n8n-nodes-base.twilio",
      "position": [
        -2760,
        1340
      ]
    },
    {
      "id": "e189af10-316c-402b-ae09-c5a4940d8cb9",
      "name": "Wait for Text Response",
      "type": "n8n-nodes-base.twilioTrigger",
      "position": [
        -3340,
        1700
      ]
    },
    {
      "id": "2aa67f37-6e9f-4a30-91ce-ae9338413a1b",
      "name": "Check if Conversation Completed",
      "type": "n8n-nodes-base.if",
      "position": [
        -2340,
        1600
      ]
    },
    {
      "id": "c1d78c94-e4ac-44be-ac8f-957b338b89cb",
      "name": "Thank Your Text",
      "type": "n8n-nodes-base.twilio",
      "position": [
        -2020,
        1460
      ]
    },
    {
      "id": "b01e4aec-ce25-465d-97f0-e1b35e076249",
      "name": "Response Text from Agent",
      "type": "n8n-nodes-base.twilio",
      "position": [
        -2120,
        1900
      ]
    },
    {
      "id": "b232d078-8780-490a-9389-e30eca969ec8",
      "name": "Query Supabase for conversation history",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1880,
        1760
      ]
    },
    {
      "id": "c18d8a47-f4df-419c-a904-c86b5418925c",
      "name": "Combine Rows",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -1720,
        1500
      ]
    },
    {
      "id": "8cbed657-22f6-4c4a-bc62-c7e2bfe383de",
      "name": "Summarize Transcript",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1520,
        1560
      ]
    },
    {
      "id": "ecf7fdc7-9d63-40af-8b22-37cf988da9bf",
      "name": "Store results in google ",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1080,
        1480
      ]
    },
    {
      "id": "50dbd5e4-3b38-4448-aa58-2e44974d9875",
      "name": "Send Lead to owner",
      "type": "n8n-nodes-base.twilio",
      "position": [
        -920,
        1760
      ]
    },
    {
      "id": "b2849c48-337a-4a4c-b104-6842e525e25a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        1200
      ],
      "parameters": {
        "width": 1720,
        "height": 120,
        "content": "## AI-Powered Real Estate Lead Responder & Qualifier (n8n Workflow)\n\n** Feel free to contact me if you need help implementing (rbreen@ynteractive.com) **"
      }
    },
    {
      "id": "54444b6d-415d-4078-91c9-019af6aad790",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4140,
        1200
      ],
      "parameters": {
        "width": 700,
        "height": 1040,
        "content": "## How to Implement\nFollow these steps to get your workflow fully running:\n\n1. Sign Up for Twilio\n👉 https://login.twilio.com/\n\nPurchase a phone number with SMS support.\n\nIn n8n, set up Twilio credenti"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Real Estate Qualifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Rows": {
      "main": [
        [
          {
            "node": "Summarize Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 Seconds": {
      "main": [
        [
          {
            "node": "Initial Text Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Wait 5 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Transcript",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Real Estate Qualifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "Real Estate Qualifier",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Transcript": {
      "main": [
        [
          {
            "node": "Store results in google ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Real Estate Qualifier": {
      "main": [
        [
          {
            "node": "Check if Conversation Completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Text Response": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store results in google ": {
      "main": [
        [
          {
            "node": "Send Lead to owner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Summarize Transcript",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check if Conversation Completed": {
      "main": [
        [
          {
            "node": "Query Supabase for conversation history",
            "type": "main",
            "index": 0
          },
          {
            "node": "Thank Your Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response Text from Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Supabase for conversation history": {
      "main": [
        [
          {
            "node": "Combine Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}