{
  "id": "M3htaKFJfCuko2uB",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Real Estate Intelligence Tracker with Bright Data & OpenAI",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    },
    {
      "id": "ZOwtAMLepQaGW76t",
      "name": "Building Blocks",
      "createdAt": "2025-04-13T15:23:40.462Z",
      "updatedAt": "2025-04-13T15:23:40.462Z"
    },
    {
      "id": "ddPkw7Hg5dZhQu2w",
      "name": "AI",
      "createdAt": "2025-04-13T05:38:08.053Z",
      "updatedAt": "2025-04-13T05:38:08.053Z"
    }
  ],
  "nodes": [
    {
      "id": "7dc6c3d9-55e0-4f32-b00d-96c92482eca8",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1700,
        -210
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "196a1630-ca74-4fee-a7bf-0555a3693908",
      "name": "Set URL and Bright Data Zone",
      "type": "n8n-nodes-base.set",
      "position": [
        -1480,
        -210
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3aedba66-f447-4d7a-93c0-8158c5e795f9",
              "name": "url",
              "type": "string",
              "value": "https://www.redfin.com/IL/Chicago/5814-W-Roscoe-St-60634/home/13464782"
            },
            {
              "id": "4e7ee31d-da89-422f-8079-2ff2d357a0ba",
              "name": "zone",
              "type": "string",
              "value": "web_unlocker1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "80131d8e-b359-4b2a-8291-faf9c4e8892f",
      "name": "Perform Bright Data Web Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1260,
        -210
      ],
      "parameters": {
        "url": "https://api.brightdata.com/request",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "zone",
              "value": "={{ $json.zone }}"
            },
            {
              "name": "url",
              "value": "={{ $json.url }}"
            },
            {
              "name": "format",
              "value": "raw"
            },
            {
              "name": "data_format",
              "value": "markdown"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2b0c3867-3c8d-4dc2-b9e9-fc9f074efaea",
      "name": "Markdown to Textual Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1040,
        -210
      ],
      "parameters": {
        "text": "=You need to analyze the below markdown and convert to textual data. Please do not output with your own thoughts. Make sure to output with textual data only with no links, scripts, css etc.\n\n{{ $json.data }}",
        "messages": {
          "messageValues": [
            {
              "message": "You are a markdown expert"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "52dc4add-92e6-4118-948e-63c4a706a017",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1720,
        -640
      ],
      "parameters": {
        "width": 400,
        "height": 320,
        "content": "## Note\n\nDeals with the Realestate data extraction by utilizing the Bright Data Web Unlocker Product.\n\n**Please make sure to set the Real-estate website URL with the Bright Data zone name. Also update the Webhook Notification URL of your interest**"
      },
      "typeVersion": 1
    },
    {
      "id": "0b64779e-d4c6-4c67-8b67-fcddac760db6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1260,
        -640
      ],
      "parameters": {
        "width": 480,
        "height": 320,
        "content": "## LLM Usages\n\nOpenAI GPT 4o model is being used.\n\nBasic LLM Chain for converting the markdown to textual content.\n\nInformation Extractor is being used for the structured data extraction."
      },
      "typeVersion": 1
    },
    {
      "id": "9d4eaebe-eb56-4d57-abe6-7d2beaff5af0",
      "name": "Review Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -500,
        -560
      ],
      "parameters": {
        "text": "=Extract all the reviews from the provided content\n\n {{ $json.text }}",
        "options": {},
        "schemaType": "fromJson",
        "jsonSchemaExample": "[{\n      \"@type\": \"Review\",\n      \"datePublished\": \"2025-04-29\",\n      \"review\": \"Incredible support and empathy. Shemi truly listened and understood my concerns. Outstanding service!\",\n      \"rating\": {\n        \"@type\": \"Rating\",\n        \"value\": \"5\"\n      }\n    }]"
      },
      "typeVersion": 1
    },
    {
      "id": "84473d2e-4243-402a-98b3-b80179b9a5ae",
      "name": "Structured Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -500,
        -100
      ],
      "parameters": {
        "text": "=Extract structured data from the provided content\n\n {{ $json.text }}",
        "options": {},
        "schemaType": "fromJson",
        "jsonSchemaExample": "{\n  \"@context\": \"https://schema.org\",\n  \"@type\": \"Offer\",\n  \"itemOffered\": {\n    \"@type\": \"SingleFamilyResidence\",\n    \"name\": \"Luxury 4BHK Villa with Pool in Herzliya\",\n    \"description\": \"A stunning 4-bedroom villa featuring private pool, garden, smart-home automation, and ocean views. Located in one of Herzliya\u2019s premium neighborhoods.\",\n    \"address\": {\n      \"@type\": \"PostalAddress\",\n      \"streetAddress\": \"456 Seaside Road\",\n      \"addressLocality\": \"Herzliya\",\n      \"postalCode\": \"4685105\",\n      \"addressCountry\": \"IL\"\n    },\n    \"floorSize\": {\n      \"@type\": \"QuantitativeValue\",\n      \"value\": 300,\n      \"unitCode\": \"MTK\"\n    },\n    \"numberOfRooms\": 7,\n    \"numberOfBedrooms\": 4,\n    \"numberOfBathroomsTotal\": 3,\n    \"amenityFeature\": [\n      {\n        \"@type\": \"LocationFeatureSpecification\",\n        \"name\": \"Swimming Pool\",\n        \"value\": true\n      },\n      {\n        \"@type\": \"LocationFeatureSpecification\",\n        \"name\": \"Smart Home Enabled\",\n        \"value\": true\n      },\n      {\n        \"@type\": \"LocationFeatureSpecification\",\n        \"name\": \"Sea View\",\n        \"value\": true\n      }\n    ],\n    \"image\": [\n      \"https://brightrealty.com/listings/villa1_front.jpg\",\n      \"https://brightrealty.com/listings/villa1_pool.jpg\",\n      \"https://brightrealty.com/listings/villa1_living.jpg\"\n    ],\n    \"petsAllowed\": \"Yes\",\n    \"url\": \"https://brightrealty.com/properties/luxury-4bhk-villa-herzliya\"\n  },\n  \"priceCurrency\": \"ILS\",\n  \"price\": \"8500000\",\n  \"availability\": \"https://schema.org/InStock\",\n  \"seller\": {\n    \"@type\": \"RealEstateAgent\",\n    \"name\": \"Bright Realty Services\",\n    \"url\": \"https://brightrealty.com\",\n    \"telephone\": \"+1234567890\",\n    \"email\": \"user@example.com\",\n    \"address\": {\n      \"@type\": \"PostalAddress\",\n      \"streetAddress\": \"123 Main St\",\n      \"addressLocality\": \"Tel Aviv\",\n      \"postalCode\": \"6100000\",\n      \"addressCountry\": \"IL\"\n    }\n  }\n}"
      },
      "typeVersion": 1
    },
    {
      "id": "d1b44002-2a50-4c0c-bf55-bf57a994bd2b",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        460,
        -520
      ],
      "parameters": {
        "columns": {
          "value": {
            "data": "={{ $json.data }}"
          },
          "schema": [
            {
              "id": "data",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "data",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "data"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DGx_-sZ59wZlrhQRfj-qyMFMF6Z1IxpJrSNHD8rTZR8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1DGx_-sZ59wZlrhQRfj-qyMFMF6Z1IxpJrSNHD8rTZR8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1DGx_-sZ59wZlrhQRfj-qyMFMF6Z1IxpJrSNHD8rTZR8/edit?usp=drivesdk",
          "cachedResultName": "Real-estate data"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "9f203292-0806-48a9-a409-f64706b1b0b6",
      "name": "Create a binary data for Structured Data Extract",
      "type": "n8n-nodes-base.function",
      "position": [
        460,
        -320
      ],
      "parameters": {
        "functionCode": "items[0].binary = {\n  data: {\n    data: new Buffer(JSON.stringify(items[0].json, null, 2)).toString('base64')\n  }\n};\nreturn items;"
      },
      "typeVersion": 1
    },
    {
      "id": "9a64deed-1f56-4e10-9e11-31bfcfd6abac",
      "name": "Write the structured content to disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        680,
        -320
      ],
      "parameters": {
        "options": {},
        "fileName": "=d:\\Realestate-StructuredData.json",
        "operation": "write"
      },
      "typeVersion": 1
    },
    {
      "id": "83e7f6d7-216c-496b-9011-47d0b95561ba",
      "name": "Merge the responses",
      "type": "n8n-nodes-base.merge",
      "position": [
        20,
        -320
      ],
      "parameters": {},
      "typeVersion": 3.1
    },
    {
      "id": "cf515b99-e139-48f8-9878-7950fa352d1e",
      "name": "Aggregate the responses",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        240,
        -320
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "a93e59ab-f384-4b05-90f8-71b305a3bfb7",
      "name": "Initiate a Webhook Notification for the Structured Data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        -120
      ],
      "parameters": {
        "url": "https://webhook.site/7b5380a0-0544-48dc-be43-0116cb2d52c2",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "summary",
              "value": "={{ $json.data }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a2f0de15-7d1d-42bb-aa22-1a3bd359ead5",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1720,
        -1100
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 400,
        "content": "## Logo\n\n\n![logo](https://images.seeklogo.com/logo-png/43/1/brightdata-logo-png_seeklogo-439974.png)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6ecb7f50-2d16-43e2-b999-98492ec81668",
      "name": "OpenAI Chat Model for Markdown to Textual",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -960,
        20
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fe6f00e3-efaa-4d57-8abd-1fbc789152a9",
      "name": "OpenAI Chat Model for Structured Data",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -420,
        120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4ce2647e-9796-4bfd-8dc2-0aa7f7466824",
      "name": "OpenAI Chat Model for Review Data Extractor",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -420,
        -340
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fad15f6e-0ccb-4810-94d6-bc4f42527071",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -640
      ],
      "parameters": {
        "color": 3,
        "width": 1000,
        "height": 760,
        "content": "## Outbound Data Push\nOutbound data handling by merging, aggregating the data and pushing the same to multiple sources such as Google Sheets, Save to Disk, Webhook Notification"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "db35bf88-1a4c-482e-abfd-49349b35952b",
  "connections": {
    "Merge the responses": {
      "main": [
        [
          {
            "node": "Aggregate the responses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Review Data Extractor": {
      "main": [
        [
          {
            "node": "Merge the responses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate the responses": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Initiate a Webhook Notification for the Structured Data",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create a binary data for Structured Data Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Data Extractor": {
      "main": [
        [
          {
            "node": "Merge the responses",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set URL and Bright Data Zone": {
      "main": [
        [
          {
            "node": "Perform Bright Data Web Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perform Bright Data Web Request": {
      "main": [
        [
          {
            "node": "Markdown to Textual Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Set URL and Bright Data Zone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Markdown to Textual Data Extractor": {
      "main": [
        [
          {
            "node": "Review Data Extractor",
            "type": "main",
            "index": 0
          },
          {
            "node": "Structured Data Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Structured Data": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Markdown to Textual": {
      "ai_languageModel": [
        [
          {
            "node": "Markdown to Textual Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model for Review Data Extractor": {
      "ai_languageModel": [
        [
          {
            "node": "Review Data Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create a binary data for Structured Data Extract": {
      "main": [
        [
          {
            "node": "Write the structured content to disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}