This N8n workflow is designed to automate the process of identifying top real estate teams, gathering information about them, analyzing their web presence, and generating marketing and contact data. It begins by fetching top real estate teams from RealTrends, then for each team, it finds their official website, scrapes its content, and uses AI to extract key information, generate a company overview, score the website, and create a marketing campaign idea. Finally, all this generated data is saved to a Supabase database.
The workflow is initiated by a manual trigger, which starts the process of fetching data.
- Realtrends Website Fetch: This
httpRequest
node sends a GET request to the RealTrends API to retrieve a list of top real estate teams. The request is pre-configured to fetch small-sized teams, sorted by the number of "sides" in descending order.
//Got this api by serching networks in Inspect element at fetch/XHR tab, through which this website was fetching the top real estate agents data
Once the list of teams is fetched, the following nodes process this data:
- Code: This node executes a JavaScript snippet to parse the JSON response from the "Realtrends Website Fetch" node. It filters and sorts the teams to select the top 20 based on their national rank for "sides". For each of the top 20 teams, it extracts key details such as rank, name, company, location, and sales volume.
- Loop Over Items: This node takes the list of 20 teams and iterates through them one by one, allowing the subsequent nodes to process each team individually.
//batch size is set to be 1
For each team in the loop, the workflow identifies and scrapes their official website:
- Google Search for official website: An
httpRequest
node performs a Google search using the team's name, company, and city to find their official website.
//configured and used Google own Google Search API
- Which website is official?: A
Code
node runs JavaScript to analyze the Google search results. It intelligently filters out common real estate portals like Zillow, Realtor.com, Redfin, and Compass to identify the team's actual website. If no other site is found, it defaults to the first search result.
- Scraping using Jina.ai: This
httpRequest
node uses the Jina.ai API to scrape the content of the official website identified in the previous step. The scraped content is then passed on for further analysis.
The scraped website content is fed into a series of AI-powered nodes for in-depth analysis and content generation. These tasks run in parallel for each team.
- Information Extractor: This LangChain node extracts a list of team members who are executives, team leads, realtors, owners, or agents from the scraped website content.
//also added retry on fail and continue if an error pops up in any iteration //used openrouter chatgpt 3.5 turbo instruct llm
- OpenRouter Chat Model: This node provides the AI model (OpenAI's GPT-3.5 Turbo Instruct) that the "Information Extractor" uses to process the text.
- Split Out: This node takes the extracted list of team members and splits them into individual items.
- Create a row: A Supabase node that saves each extracted team member's name, role, email, and phone number, along with the company name, into a table named
Real Estate Automate
.
- Company Overview: This LangChain agent analyzes the website content to generate a comprehensive company overview, including their core markets, team size, founders, specialties, awards, and brand tone.
Prompt Used:”Analyze the following website content and generate:
- Company Overview:
- Who they are
- Core markets
- Team size
- Principals/founders
- Specialties
- Awards
- Brand tone
Website Content: {{ $json.data }}”
- Google Gemini Chat Model: This node provides the AI model for the "Company Overview" agent.
- Create a row1: A Supabase node that saves the generated company overview into a table named
Company Overview
, linked to the respective company.
- Website Score: This LangChain agent evaluates the real estate website and assigns a total score out of 100, broken down into "Messaging & UX" and "Technical/SEO" scores, with justifications for each.
Prompt Used:
“You are an expert in web design, UX, and SEO analysis. Your task is to evaluate a given real estate website and assign a total score out of 100, split evenly between:
- Messaging & UX (50 points)
- Clarity of services offered
- Strength and visibility of calls-to-action (CTAs)
- Strength of value proposition
- Presence and quality of trust signals (testimonials, certifications, reviews, guarantees)
- Mobile friendliness and responsive design quality
- Technical/SEO (50 points)
- Likely page speed performance (based on content clues, image sizes, script load)
- Presence and quality of meta tags (title, description)
- Use of structured data/schema markup
- Accessibility (alt text, color contrast, keyboard navigation)
- Indexability by search engines
- Obvious SEO wins or missed opportunities (keywords, internal linking, headings, sitemap)
Output Format: { "total_score": <0-100>, "messaging_ux_score": <0-50>, "technical_seo_score": <0-50>, "messaging_ux_justification": [ "Bullet point reasoning for Messaging & UX score" ], "technical_seo_justification": [ "Bullet point reasoning for Technical/SEO score" ] }
Be concise, specific, and base reasoning only on the provided website content. Do not invent facts not present in the input.”
- Google Gemini Chat Model1: This node provides the AI model for the "Website Score" agent.
- Create a row2: A Supabase node that saves the website score and justifications into a table named
Website Score
, linked to the company.
- Season identifier: A
Code
node that determines the current season based on the date, which is then used to create a seasonally relevant marketing campaign.
- One Campaign Idea": This LangChain agent generates a themed, location-aware, and season-sensitive marketing campaign based on the website content. It produces a campaign theme, description, email and postcard copy, and landing page content.
Prompt Used:
“You are a marketing copywriter for a real estate brand.
Create 1 themed, location-aware, season-sensitive campaign based on the provided website content, season({{ $json.season }}), and location.
Match the brand’s tone.
Deliverables (JSON):
- campaign_theme: short name
- campaign_description: 1–2 sentence explanation
- emails: 2 items {subject ≤8 words, body ≤120 words}
- postcards: 2 items {front 40–60 words, back 40–60 words}
- landing_page: {headline ≤10 words, pitch ≤150 words, cta}
Use only facts from the content, naturally integrate location & seasonal cues.”
- Google Gemini Chat Model2: This node provides the AI model for the "One Campaign Idea" agent.
- Create a row3: A Supabase node that saves the generated campaign idea into a table named
One Campaign Idea
, linked to the company.