{
  "id": "aOw33WR3ZaVBg84x",
  "name": "Rental Analyzer",
  "tags": [],
  "nodes": [
    {
      "id": "ce2c008a-7f57-42dc-8e92-1c7b26bcee70",
      "name": "Main Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -544
      ],
      "parameters": {
        "color": 3,
        "width": 460,
        "height": 684,
        "content": "## \ud83c\udfe0 Rental Rate Analyzer\n\n### What it does\nThis workflow accepts a property address via chat and automatically pulls rental estimates from three sources \u2014 Zillow, HUD Fair Market Rent, and Rentometer \u2014 then uses an AI agent to compile a clean, tabular rental analysis.\n\n### How it works\n1. User submits a property address through the chat interface.\n2. The AI Agent queries Zillow for a rent Zestimate.\n3. The agent converts the property zipcode to a CBSA code via the HUD USPS lookup tool.\n4. Using the CBSA code, the agent queries HUD Fair Market Rent for bedroom-matched rates.\n5. The agent queries Rentometer for local rent comps.\n6. A formatted rental analysis table is returned in the chat.\n\n### Setup\n- [ ] Add your Apify API key (uses the `maxcopell/zillow-detail-scraper` actor)\n- [ ] Register for a free HUD API key at [huduser.gov](https://www.huduser.gov/hudapi/public/register) and add as HTTP Bearer credential\n- [ ] Add your Rentometer API key as an HTTP Bearer credential\n- [ ] Connect your OpenAI API key to the OpenAI Chat Model node\n\n### Customization\nSwap `gpt-4.1-mini` for a more powerful model if analysis quality needs improvement."
      },
      "typeVersion": 1
    },
    {
      "id": "4a943030-3d2a-4ca5-8463-edb45cd61c80",
      "name": "Warning Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        832,
        -544
      ],
      "parameters": {
        "width": 460,
        "height": 100,
        "content": "\u26a0\ufe0f **All three API keys must be configured before running.**\nMissing credentials will cause the AI Agent to fail silently or return incomplete data."
      },
      "typeVersion": 1
    },
    {
      "id": "68d93474-d161-4d74-a4b2-17374d371a88",
      "name": "Agent Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        -544
      ],
      "parameters": {
        "color": 7,
        "width": 360,
        "height": 340,
        "content": "## \ud83d\udcac Chat Interface & AI Agent\nReceives the property address from the user and orchestrates all tool calls in the correct order.\n\n## \ud83d\udd27 Rental Data Tools\nFour tools available to the AI Agent. Called in order: Zillow \u2192 Zipcode-to-CBSA \u2192 HUD Fair Market Rent \u2192 Rentometer."
      },
      "typeVersion": 1
    },
    {
      "id": "b9110a8c-f7f4-4b4a-aaa4-42715c5face2",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        896,
        -192
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are an expert a rental analysis for properties. \nYou will be provided an address and must pull all rental comparables using the tools at your disposal. Use the data from each tool to develop a tabular rental analysis. Only call each tool once.\n\nRun the tools in this order:\nZillow Rent --> Zipcode-to-cbsa --> HUD Fair Market Rent\n\nFrom the \"Zillow Rent\" tool you will extract the value within the field \n\"rentZestimate\" from the tools response to your request.\n\nWhen using the \"HUD Fair Market Rent\" tool, you must first call the \"Zipcode-to-cbsa\" tool to convert the property's zipcode into a cbsa format for the \"HUD Fair Market Rent\" tool. From the response use the fields that match our bedroom count and are within our zipcode."
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6b1a26b2-7f6c-4723-8ad1-60d5374ee21d",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        640,
        32
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "9d32eda1-0e82-4d54-9880-524b55434479",
      "name": "Rentometer1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1312,
        32
      ],
      "parameters": {
        "url": "https://www.rentometer.com/api/v1/summary",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "address",
              "value": "={{ $fromAI('parameters0_Value', 'The physical address of the property in string format', 'string') }}"
            },
            {
              "name": "bedrooms",
              "value": "={{ $fromAI('parameters1_Value', 'number of bedrooms in string format', 'string') }}"
            },
            {
              "name": "baths",
              "value": "={{ $fromAI('parameters2_value', 'bathroom count') > 1.5 ? '1.5' : '1' }}"
            }
          ]
        },
        "toolDescription": "Rentometer Rent Comps"
      },
      "typeVersion": 4.2
    },
    {
      "id": "532f969f-f0bc-46bf-857e-e4585f2f5ca7",
      "name": "Zillow Rent1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1152,
        32
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/maxcopell~zillow-detail-scraper/run-sync-get-dataset-items",
        "fields": "rentZestimate,bedrooms,bathrooms",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ JSON.stringify({ addresses: [$fromAI('address', 'address of the property')], extractBuildingUnits: 'all' }) }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "fieldsToInclude": "selected",
        "genericAuthType": "httpBearerAuth",
        "optimizeResponse": true
      },
      "typeVersion": 4.2
    },
    {
      "id": "2ffb082e-d5a1-45ba-8de9-2d2c07bb2d26",
      "name": "HUD Fair Market Rent1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1008,
        32
      ],
      "parameters": {
        "url": "={{ $fromAI('URL', 'https://www.huduser.gov/hudapi/public/fmr/data/{entityid} \u2014 entityid is the CBSA value from the zipcode-to-cbsa tool concatenated with 99999', 'string') }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "toolDescription": "HUD Fair market Rent "
      },
      "typeVersion": 4.2
    },
    {
      "id": "8842df45-a545-4dd6-a52a-9c01280e5a42",
      "name": "Zipcode-to-cbsa1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        848,
        32
      ],
      "parameters": {
        "url": "https://www.huduser.gov/hudapi/public/usps",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "type",
              "value": "2"
            },
            {
              "name": "query",
              "value": "={{ $fromAI('parameters1_Value', 'Place the property addresses zipcode in here.', 'string') }}"
            }
          ]
        },
        "toolDescription": "Convert the Zipcode into CBSA"
      },
      "typeVersion": 4.2
    },
    {
      "id": "e5de788d-a4a0-4bc1-abfa-aaa9f341d282",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        624,
        -192
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.4
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "b9e0ab36-0254-4cbd-8f60-e548b613c373",
  "connections": {
    "Rentometer1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Zillow Rent1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Zipcode-to-cbsa1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HUD Fair Market Rent1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}