{"name":"Listing Update Notifier","nodes":[{"id":"schedule","type":"n8n-nodes-base.scheduleTrigger","name":"Poll MLS Every 15min","position":[250,300],"parameters":{"rule":{"interval":[{"field":"minutes","minutesInterval":15}]}}},{"id":"fetchListings","type":"n8n-nodes-base.httpRequest","name":"Fetch MLS Updates","position":[450,300],"parameters":{"url":"={{$env.MLS_API_URL}}/listings/updates","method":"GET","queryParameters":{"since":"={{$now.minus({minutes:15}).toISO()}}"}}},{"id":"filterNew","type":"n8n-nodes-base.filter","name":"Filter Meaningful Changes","position":[650,300],"parameters":{"conditions":{"string":[{"value1":"={{$json.change_type}}","operation":"isNotEmpty"}]}}},{"id":"matchBuyers","type":"n8n-nodes-base.httpRequest","name":"Match Against Buyer Profiles","position":[850,300],"parameters":{"url":"={{$env.CRM_API}}/buyers/match","method":"POST","body":{"listing":"={{$json}}"}}},{"id":"aiSummary","type":"n8n-nodes-base.openAi","name":"AI Property Brief","position":[1050,300],"parameters":{"model":"gpt-4o-mini","prompt":"Write a concise, compelling property brief for a buyer. Highlight: why this matches their criteria, key features, neighborhood highlights, and a suggested offer strategy. Keep it under 200 words.\n\nListing: {{JSON.stringify($json.listing)}}\nBuyer criteria: {{JSON.stringify($json.buyer_criteria)}}"}},{"id":"sendSMS","type":"n8n-nodes-base.twilio","name":"SMS Alert to Buyer","position":[1250,200],"parameters":{"to":"={{$json.buyer_phone}}","body":"New match: {{$json.listing.address}} — ${{$json.listing.price}}. {{$json.brief_summary}}. Reply YES to schedule showing."}},{"id":"emailBrief","type":"n8n-nodes-base.sendGrid","name":"Email Full Brief","position":[1250,400],"parameters":{"to":"={{$json.buyer_email}}","subject":"New Listing Match: {{$json.listing.address}}"}},{"id":"alertAgent","type":"n8n-nodes-base.slack","name":"Notify Agent","position":[1450,300],"parameters":{"channel":"#listing-alerts","text":"Listing match: {{$json.listing.address}} matched {{$json.buyer_name}} ({{$json.match_score}}% match)"}}],"connections":{"Poll MLS Every 15min":{"main":[[{"node":"Fetch MLS Updates","type":"main","index":0}]]},"Fetch MLS Updates":{"main":[[{"node":"Filter Meaningful Changes","type":"main","index":0}]]},"Filter Meaningful Changes":{"main":[[{"node":"Match Against Buyer Profiles","type":"main","index":0}]]},"Match Against Buyer Profiles":{"main":[[{"node":"AI Property Brief","type":"main","index":0}]]},"AI Property Brief":{"main":[[{"node":"SMS Alert to Buyer","type":"main","index":0},{"node":"Email Full Brief","type":"main","index":0}]]},"SMS Alert to Buyer":{"main":[[{"node":"Notify Agent","type":"main","index":0}]]},"Email Full Brief":{"main":[[{"node":"Notify Agent","type":"main","index":0}]]}}}