This workflow combines address formatting, Google Maps geocoding, and Gemini AI to automatically extract property details and generate map URLs. By chaining these tools together, you can take raw, messy address inputs and transform them into standardized, validated property records complete with satellite and street-view imagery.
flowchart TD
A["Raw Address & Client Input"] --> B["Format & Clean Address"]
B --> C["Google Maps Geocoding"]
C --> D["Gemini AI Extraction"]
D --> E["Parse & Validate JSON"]
E --> F["Generate Map URLs & Final Output"]How the workflow operates
The process is broken down into four main stages, ensuring that data is cleaned before it is searched, and validated before it is saved.
- 1
Format Address and Client Name
First, the workflow takes raw input fields (Street, City, State, Zip, Unit, and Client Name) and standardizes them. It applies Title Case to names and cities, cleans up unit labels, and constructs a pristine
fullAddressstring. This ensures the geocoding step has the highest possible match rate. - 2
Geocode the Location
Using the cleaned
fullAddress, the workflow calls the Google Maps Geocoding API. This translates the text address into precise latitude and longitude coordinates (navLatandnavLng), which are essential for pulling accurate map images later. - 3
Extract Property Specs with AI
Next, Gemini 2.5 Flash is prompted to act as a high-speed property data extractor. It uses the formatted address and coordinates to search accessible real estate databases (like Zillow, Redfin, or local GIS records).
The AI is instructed to return a strict JSON object containing:
Square footage (
sqft)Lot acreage (
lot_acres)Property type (
ai_type)Neighborhood
- 4
Analyze Data and Generate URLs
Finally, a code step parses the AI's JSON response. It compares the AI-detected property type against the client's requested property type to flag any mismatches. It also uses the coordinates to generate direct URLs for Google Street View and Satellite imagery.
The Zero-Tolerance Lot Size Rule
To reliably distinguish between single-family homes and condos, the AI is instructed to never return 0 for a house's lot size. If the lot size truly cannot be found, it returns 0.001 as a placeholder. If a property has a lot size of 0, the system confidently flags it as a condo or commercial space.
Ensuring reliable AI JSON parsing
When asking LLMs to return JSON, they occasionally include markdown formatting (like json ) or conversational preamble. This workflow uses a robust extraction method to guarantee the data parses correctly.
The AI prompt instructs Gemini to wrap the final JSON object in custom @@@ markers:
@@@
{
"sqft": 2450,
"lot_acres": 0.25,
"ai_type": "Detached",
"neighborhood": "Oakwood Estates"
}
@@@The validation step then uses regular expressions to extract exactly what is between those markers, stripping out any unexpected text. If the markers fail, it falls back to finding the first valid { } block in the response.
Validation rules and edge cases
The final step of the workflow evaluates the extracted data and assigns a status_icon and validation_status based on specific business rules.
Property Type Mismatches
If the AI detects a property type (e.g., "Detached") that conflicts with the client's requested type (e.g., "Townhome"), the workflow flags the record with a ❌ and sets the status to Mismatch. This signals that manual review is required.
Condo Alerts
If the property type contains "town" or "condo", OR if the lot acreage is greater than 0 but less than or equal to 0.005, the system triggers a Condo Alert (❌). This is crucial for identifying attached units that might have been misclassified as detached homes.
Missing Client Data
If no client property type was provided in the initial input, the workflow defaults to the AI-detected type, marks the record with a 🔵, and sets the status to No Client PT.
Expected Output
Once the workflow completes, it returns a structured payload ready to be sent to your database or CRM.
| Output Field | Description |
|---|---|
status_icon | Visual indicator of validation (✅, ❌, ⚠️, or 🔵). |
client_pt | The final, Title-Cased property type. |
sqft | Integer representing square footage (returns 0 if unknown). |
lot_acres | Decimal representing lot size (e.g., 0.250). |
photo_url | The primary property photo (defaults to Street View if a valid image isn't found). |
street_view_url | Direct link to a 600x400 Google Street View image. |
satellite_view_url | Direct link to a 600x400 Google Satellite image (Zoom level 20). |
API Key Security
The source code examples include hardcoded Google Maps API keys. In a production environment, always store your apiKey as a secure environment variable or secret within your automation platform to prevent unauthorized usage.