{
  "id": "mGgu1ixSHq7uKR9J",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Expired Listing Revival Agent",
  "tags": [],
  "nodes": [
    {
      "id": "fe1a3344-0363-463c-8312-8b382f7e6193",
      "name": "Get Listings",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        -280
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "f9b43706-6ba4-4c7a-bda7-7b27296f151e",
      "name": "Check >30 Days",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        -280
      ],
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{ Date.now() - new Date($json[\"last_activity\"]).getTime() }}",
              "value2": 2592000000,
              "operation": ">"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ef1ad425-d92d-433b-b147-178f61b1baf4",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1040,
        -280
      ],
      "parameters": {
        "message": "=Hi {{$json[\"owner_name\"]}},\n\nJust a quick heads-up\u2014your property listing titled \"{{$json[\"title\"]}}\" located in {{$json[\"location\"]}} is about to expire.\n\nSince it was last active on {{$json[\"last_activity\"]}}, there have been some exciting shifts in the market. There may be renewed buyer interest or opportunities we can capitalize on.\n\nIf you're still interested in selling your {{$json[\"property_type\"]}}, I\u2019d be happy to help you relist it and get it in front of the right audience.\n\nWould you like me to reactivate the listing for you this week?\n\nBest,  \n[Your Name]  \nReal Estate Specialist  \n",
        "subject": "Your Property Listing Is About to Expire",
        "additionalFields": {}
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "978b3493-385d-453b-a59a-fbcfa84c5bfe",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        660,
        -280
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are an assistant helping a real estate agent re-engage expired property listings.\n\nGenerate a personalized follow-up email to a property owner, based on the following data:\n\nProperty Title: {{$json[\"title\"]}}\nOwner Name: {{$json[\"owner_name\"]}}\nProperty Type: {{$json[\"property_type\"]}}\nLocation: {{$json[\"location\"]}}\nLast Activity Date: {{$json[\"last_activity\"]}}\n\nTone: Friendly but professional.\nGoal: Convince the owner to relist their property, highlight market opportunities or changes since last contact.\n\nDo not use placeholders or template-style responses. Write it like a\n"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "38f7ff60-f96b-43a2-aeae-bfa263c35907",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        -280
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "35180652-0e96-4812-8d19-1b25284d0075",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -60
      ],
      "parameters": {
        "width": 780,
        "height": 1180,
        "content": "# Expired Listing Revival Agent\n\n## Problem\nIn the real estate industry, many property listings in CRMs or spreadsheets go inactive after 30 days without any action. These expired listings are often forgotten or neglected, even though the property owner may still be interested in relisting. As a result, real estate professionals lose potential revenue and miss opportunities to close deals.\n\n## Solution\nThis automation workflow automatically detects listings that haven't had any activity for over 30 days. It then generates a personalized follow-up email using an AI model like OpenAI (GPT-4), asking the property owner if they would like to relist the property. The system sends this follow-up via email, and optionally updates the listing status based on any replies from the owner.\n\n## For Who\n- Real estate agents  \n- Real estate brokers  \n- Real estate CRM tool developers  \n- Property managers  \n- Real estate marketing teams  \n- Listing management agencies  \n\n## Scope\n- **Source:** Google Sheets (listing data)  \n- **Filter:** Listings with `last_activity` older than 30 days  \n- **Generate:** Personalized reactivation message using OpenAI  \n- **Send:** Follow-up email via Gmail or SMTP  \n- **Optional:** Update listing status in Sheet or CRM when owner replies  \n\n## How to Set Up\n\n1. **Google Sheet**  \n   Create a sheet with these columns:  \n   `title`, `owner_name`, `email`, `property_type`, `location`, `last_activity`\n\n2. **Read Sheet in n8n**  \n   Use **Google Sheets node** to load all listings.\n\n3. **Filter Listings**  \n   Use a **Set + IF node** or **Code node** to keep only rows where `last_activity` is more than 30 days ago.\n\n4. **Generate Email with AI**  \n   Use **OpenAI node** to generate a follow-up email for each expired listing.\n\n5. **Send Email**  \n   Use **Gmail or SMTP node** to send the generated email to the owner.\n\n6. **(Optional) Update Status**  \n   After email is sent, update the listing\u2019s status to `followed_up` in the sheet.\n\n---\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5a14b90b-8333-4939-945b-3b597dbee549",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -340
      ],
      "parameters": {
        "color": 3,
        "width": 1300,
        "height": 240,
        "content": "## Flow"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2359e81b-2266-47ee-8aff-daf8f21491c4",
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Listings": {
      "main": [
        [
          {
            "node": "Check >30 Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check >30 Days": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Listings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}