{
  "name": "Score and route real estate leads with GPT‑4.1, MLS/CRM data, and Slack alerts",
  "nodes": [
    {
      "id": "290bbc1f-6438-486b-a093-1bb4e138b597",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1648,
        896
      ]
    },
    {
      "id": "ad313f80-67c1-4dcb-a78f-2182c5c730b5",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1424,
        896
      ]
    },
    {
      "id": "8345cc83-efc2-4bff-ae28-33d9c185f710",
      "name": "Fetch Leads from MLS/Portals",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        800
      ]
    },
    {
      "id": "ea502191-3352-4b8e-8815-990421846b7f",
      "name": "Fetch Leads from CRM/Email/Social",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1200,
        992
      ]
    },
    {
      "id": "8168dad0-bea9-4a7a-a377-c811ed8ad431",
      "name": "Merge All Lead Sources",
      "type": "n8n-nodes-base.merge",
      "position": [
        -976,
        896
      ]
    },
    {
      "id": "d874d5e4-d679-4d0d-93fd-dcc4e400e2b4",
      "name": "Lead Enrichment Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -752,
        768
      ]
    },
    {
      "id": "7126042c-a737-495e-ba50-c55350869faf",
      "name": "OpenAI Model - Enrichment",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -752,
        992
      ]
    },
    {
      "id": "e4a8cfaa-bc2a-4aff-b1ee-5534310ae8b1",
      "name": "Structured Output - Enriched Lead Data",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -624,
        992
      ]
    },
    {
      "id": "95b84d67-4689-4627-a474-9c557a8fae1a",
      "name": "Agent Routing Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        768,
        480
      ]
    },
    {
      "id": "2374dd45-4634-4974-a6db-275ad58261bc",
      "name": "OpenAI Model - Routing",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        528,
        704
      ]
    },
    {
      "id": "f17ef1f6-cdbd-4e3c-8de7-4bd0d0f09e2c",
      "name": "Structured Output - Routing Decision",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1104,
        768
      ]
    },
    {
      "id": "36d703fd-e6e0-4001-b1f6-0a4e3e650c6e",
      "name": "Lead Scoring Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        192,
        512
      ]
    },
    {
      "id": "773cca87-54fc-4c6a-81f1-8cb39c711422",
      "name": "OpenAI Model - Scoring",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        192,
        704
      ]
    },
    {
      "id": "ac3c4afe-83ff-43fd-b68c-5443c9abfeb3",
      "name": "Structured Output - Lead Score",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        352,
        752
      ]
    },
    {
      "id": "f573f9bc-6a12-4f9a-8e3c-2886ec5a8142",
      "name": "High-Priority Lead Filter",
      "type": "n8n-nodes-base.if",
      "position": [
        1728,
        480
      ]
    },
    {
      "id": "b4d2fe51-c433-4b59-9a34-cc7b41bbc946",
      "name": "Prepare High-Priority Lead Data",
      "type": "n8n-nodes-base.set",
      "position": [
        2016,
        736
      ]
    },
    {
      "id": "ffd1bda8-b27b-4126-8bd7-c63a5b3414c2",
      "name": "Prepare Standard Lead Data",
      "type": "n8n-nodes-base.set",
      "position": [
        2240,
        1120
      ]
    },
    {
      "id": "29da799a-3067-4207-bd81-b2d626ad36d8",
      "name": "Track Engagement Metrics",
      "type": "n8n-nodes-base.set",
      "position": [
        2464,
        768
      ]
    },
    {
      "id": "25360dbc-0b63-4e3d-b3d3-378532b8dade",
      "name": "Loop Over Leads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3408,
        1248
      ]
    },
    {
      "id": "1483377b-6735-46fe-8e47-61cc0155cc98",
      "name": "Lead Sentiment Analysis",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -400,
        768
      ]
    },
    {
      "id": "6c8b460a-1b93-4385-8312-bb89e65cab48",
      "name": "OpenAI Model - Sentiment",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -336,
        1056
      ]
    },
    {
      "id": "8ef35ea0-d287-4c67-a16a-69b718fe4a8a",
      "name": "Lead Knowledge Base - Insert",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        2720,
        768
      ]
    },
    {
      "id": "f1ac819b-b8e0-4719-ae8a-0e1fb2e81932",
      "name": "Embeddings OpenAI - Insert",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2688,
        992
      ]
    },
    {
      "id": "753ec094-6a96-48ed-ad4b-e0bf80e772dd",
      "name": "Document Loader - Lead Data",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        2816,
        992
      ]
    },
    {
      "id": "79c5d5c4-8173-4403-bafa-7af6c8394064",
      "name": "Text Splitter - Recursive",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        2896,
        1200
      ]
    },
    {
      "id": "1c34a407-eef4-4307-9fbe-b12f56a8f08c",
      "name": "Lead Knowledge Base - Retrieve",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        656,
        704
      ]
    },
    {
      "id": "80a942cd-a6c7-42c3-9324-04ed808fd6fb",
      "name": "Embeddings OpenAI - Retrieve",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        736,
        912
      ]
    },
    {
      "id": "52d13f50-7a80-49f9-8daf-f25d31982054",
      "name": "HTTP Request Tool - Property Data",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        944,
        704
      ]
    },
    {
      "id": "50fd95ce-5504-4140-859b-f4da6129a207",
      "name": "Store Lead in Database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        3184,
        768
      ]
    },
    {
      "id": "ad529fbb-fe99-484c-bf87-afd611213842",
      "name": "Notify Slack - High Priority",
      "type": "n8n-nodes-base.slack",
      "position": [
        2240,
        592
      ]
    },
    {
      "id": "f7ab2208-e9c5-4d81-bedd-6af2bdea693d",
      "name": "Send Email - Agent Assignment",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2240,
        928
      ]
    },
    {
      "id": "187aee6a-82df-42f3-a5ef-516e0b403dd2",
      "name": "Aggregate Daily Lead Stats",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3632,
        1248
      ]
    },
    {
      "id": "0bcca2c8-488e-4dd6-a457-9948677b279f",
      "name": "Fetch Agent Performance Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        832
      ]
    },
    {
      "id": "5e7f85de-1338-4869-89c0-b226a2be5bfe",
      "name": "Merge Lead with Agent Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1504,
        832
      ]
    },
    {
      "id": "a126842c-37f9-4c6c-9946-5992a21d916c",
      "name": "Check Sentiment Score",
      "type": "n8n-nodes-base.if",
      "position": [
        -48,
        768
      ]
    },
    {
      "id": "37909773-76c7-4280-816a-9e9ebf5cb63e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 576,
        "height": 352,
        "content": "## Prerequisites\nActive AI API accounts (OpenAI/Anthropic), e-commerce platform with webhook support\n## Use Cases\nMulti-channel order fulfillment, subscription box processing, drop-shipping automation"
      }
    },
    {
      "id": "0bdfee37-e626-418d-95a6-e4a5e9449e78",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        64
      ],
      "parameters": {
        "width": 528,
        "height": 272,
        "content": "## Setup Steps\n\n1. Configure webhook endpoint for e-commerce platform order integration\n2. Set up AI model credentials (OpenAI/Anthropic) for validation agents\n3. Connect inventory management system A"
      }
    },
    {
      "id": "c498aa38-0121-4957-9420-a7f4fc752558",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        80
      ],
      "parameters": {
        "width": 928,
        "height": 256,
        "content": "## How It Works\nThis workflow automates end-to-end e-commerce order processing from intake through fulfillment by orchestrating multiple AI-powered validation stages and external system integrations. "
      }
    },
    {
      "id": "d0b85eee-3a14-4188-bdc9-b89f90327a58",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        384
      ],
      "parameters": {
        "width": 1910,
        "height": 1120,
        "content": "## Fulfillment Orchestration and Status Communication\n**Why:** Updates order status across integrated e-commerce platforms, triggers warehouse management systems for picking/packing, sends real-time e"
      }
    },
    {
      "id": "0d6f22d3-9ee2-4b9b-bcca-f1bb12c3c4d1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        400
      ],
      "parameters": {
        "width": 1728,
        "height": 1040,
        "content": "\n## Fraud Detection and Payment Processing\n**Why:** Routes orders through fraud screening agents that analyze transaction patterns and risk indicators, processes verified payments through secure gatew"
      }
    },
    {
      "id": "5c240f6d-3844-46dd-bd7e-e49fe1690102",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        400
      ],
      "parameters": {
        "width": 1808,
        "height": 896,
        "content": "## Order Intake and Multi-Stage AI Validation\n**Why:** Captures incoming orders through webhook, deploys AI agents equipped with validation tools to verify customer information accuracy, validate orde"
      }
    }
  ],
  "connections": {
    "Loop Over Leads": {
      "main": [
        [
          {
            "node": "Aggregate Daily Lead Stats",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Lead Enrichment Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Scoring Agent": {
      "main": [
        [
          {
            "node": "Agent Routing Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent Routing Agent": {
      "main": [
        [
          {
            "node": "High-Priority Lead Filter",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Agent Performance Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Sentiment Score": {
      "main": [
        [
          {
            "node": "Lead Scoring Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Enrichment Agent": {
      "main": [
        [
          {
            "node": "Lead Scoring Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Lead Sentiment Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge All Lead Sources": {
      "main": [
        [
          {
            "node": "Lead Enrichment Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Routing": {
      "ai_languageModel": [
        [
          {
            "node": "Agent Routing Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Scoring": {
      "ai_languageModel": [
        [
          {
            "node": "Lead Scoring Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store Lead in Database": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Fetch Leads from MLS/Portals",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Leads from CRM/Email/Social",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Sentiment Analysis": {
      "main": [
        [
          {
            "node": "Check Sentiment Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Sentiment": {
      "ai_languageModel": [
        [
          {
            "node": "Lead Sentiment Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Track Engagement Metrics": {
      "main": [
        [
          {
            "node": "Lead Knowledge Base - Insert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High-Priority Lead Filter": {
      "main": [
        [
          {
            "node": "Prepare High-Priority Lead Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Standard Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model - Enrichment": {
      "ai_languageModel": [
        [
          {
            "node": "Lead Enrichment Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Text Splitter - Recursive": {
      "ai_textSplitter": [
        [
          {
            "node": "Document Loader - Lead Data",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI - Insert": {
      "ai_embedding": [
        [
          {
            "node": "Lead Knowledge Base - Insert",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Merge Lead with Agent Data": {
      "main": [
        [
          {
            "node": "High-Priority Lead Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Standard Lead Data": {
      "main": [
        [
          {
            "node": "Track Engagement Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Document Loader - Lead Data": {
      "ai_document": [
        [
          {
            "node": "Lead Knowledge Base - Insert",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI - Retrieve": {
      "ai_embedding": [
        [
          {
            "node": "Lead Knowledge Base - Retrieve",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Agent Performance Data": {
      "main": [
        [
          {
            "node": "Merge Lead with Agent Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Leads from MLS/Portals": {
      "main": [
        [
          {
            "node": "Merge All Lead Sources",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Knowledge Base - Insert": {
      "main": [
        [
          {
            "node": "Store Lead in Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Slack - High Priority": {
      "main": [
        [
          {
            "node": "Track Engagement Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email - Agent Assignment": {
      "main": [
        [
          {
            "node": "Track Engagement Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Knowledge Base - Retrieve": {
      "ai_tool": [
        [
          {
            "node": "Agent Routing Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output - Lead Score": {
      "ai_outputParser": [
        [
          {
            "node": "Lead Scoring Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Prepare High-Priority Lead Data": {
      "main": [
        [
          {
            "node": "Track Engagement Metrics",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Slack - High Priority",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Email - Agent Assignment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Leads from CRM/Email/Social": {
      "main": [
        [
          {
            "node": "Merge All Lead Sources",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "HTTP Request Tool - Property Data": {
      "ai_tool": [
        [
          {
            "node": "Agent Routing Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output - Routing Decision": {
      "ai_outputParser": [
        [
          {
            "node": "Agent Routing Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output - Enriched Lead Data": {
      "ai_outputParser": [
        [
          {
            "node": "Lead Enrichment Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}