Tutorial · Beginner

Stop sorting tenant repair requests by hand

A landlord's day goes like this: one tenant emails about a leak in 4B, another about a dead socket in 7A, a third about a dishwasher in 2A. You read every message, work out who should fix it, forward it, and hope you didn't miss the urgent one. Here's how it works once it's set up. Tenants keep writing to the same email. AI reads each message and works out the apartment, the problem and how urgent it is. It logs the request in a Google Sheet and forwards it to your plumber, your electrician or your building manager. Urgent requests go out marked URGENT with you on copy, and at the end of the month the sheet holds the full history. A chat with Claude or ChatGPT only answers while you're asking it something, and this has to run on every new email with nobody there, so we build it in n8n, an automation tool you can self-host for free.
[ The result ]

Every new repair email gets logged in your sheet and forwarded to the plumber, the electrician or the building manager with nobody involved. Urgent ones are marked URGENT with you on copy, and by the end of the month the sheet is a full repair history.

[ How it's wired ]
  1. Make the spreadsheet with two tabs

    Create a new Google Sheet called "Repairs". Rename the first tab to Requests and type these headers in row 1: Date, From, Unit, Category, Urgency, Summary. This tab becomes your repair history. Add a second tab called Contractors with the headers Category, Name, Email. Add one row for each category: plumbing for your plumber, electrical for your electrician, building for your building manager. Type the categories in lowercase, exactly like in the prompt in step 3. The building row catches everything that isn't plumbing or electrical, and anything unclear, so your building manager sees it.

    Requests:    Date | From | Unit | Category | Urgency | Summary
    Contractors: Category | Name | Email
                 plumbing | Joe's Plumbing | joe@example.com
                 electrical | Spark Electric | spark@example.com
                 building | Building manager | manager@example.com
  2. Add the Gmail trigger

    In n8n, click Create workflow, then add the Gmail Trigger node. Under Credential to connect with, create a Google credential and sign in. Set Poll Times to Every Minute. Set Event to Message Received. Turn Simplify off so the node gives you the full email text. Under Filters, choose Label Names or IDs and pick a label like "Maintenance" (in Gmail, set a filter that adds this label to repair emails). You can also use Search, for example to:repairs@yourdomain.com. Leave Read Status on Unread emails only. Tenants keep writing to the same address as before. Send yourself a test email, click Fetch Test Event and check that you see the subject and the text in the output panel.

  3. Let AI read each request

    Add an Information Extractor node after the trigger. It works out the apartment, the problem and how urgent it is. In Text, paste the expression below. If the text field has a different name in your trigger output, drag it in from the left panel instead. Set Schema Type to Generate From JSON Example and paste the example below (every field in it becomes required). Click the + under Model, pick OpenAI Chat Model, add your OpenAI API key and choose gpt-6-luna. n8n loads the model list from your OpenAI account, so if gpt-6-luna doesn't show up, your account doesn't have it yet. On n8n Cloud Starter or Pro, version 2.36.0 or later, you can pick Use Gateway credits instead of adding your own key (not on Cloud Enterprise or self-hosted n8n). Don't pick gpt-4o-mini: OpenAI deprecated it and it leaves the API on January 14, 2027. Under Options, add System Prompt Template and paste the prompt. Run the node. The results show up under output (output.unit, output.category and so on).

    Text:
    Subject: {{ $json.subject }}
    From: {{ $json.from.text }}
    {{ $json.text }}
    
    JSON example:
    {"unit": "4B", "category": "plumbing", "urgency": "emergency", "summary": "Water leaking from bathroom ceiling"}
    
    System prompt:
    You read repair requests from tenants. Extract the unit number (or "unknown").
    Category must be one of: plumbing, electrical, building.
    Use building for everything else (heating, appliances, doors, locks, common areas) and whenever you are not sure.
    Urgency must be one of: emergency, normal.
    Use emergency only for active water leaks, flooding, no power, gas smell, no heat in cold weather, or anything unsafe.
    Summary: one short sentence in plain words.
  4. Log the request in the sheet

    Add a Google Sheets node and choose Append Row. Set Resource to Sheet Within Document. For Document, pick Repairs from the list. For Sheet, pick Requests. Set Mapping Column Mode to Map Each Column Manually and fill in each column with the expressions below. Run the node and check that a new row appears in your sheet.

    Date:     {{ $now.toFormat('yyyy-MM-dd HH:mm') }}
    From:     {{ $('Gmail Trigger').item.json.from.text }}
    Unit:     {{ $('Information Extractor').item.json.output.unit }}
    Category: {{ $('Information Extractor').item.json.output.category }}
    Urgency:  {{ $('Information Extractor').item.json.output.urgency }}
    Summary:  {{ $('Information Extractor').item.json.output.summary }}
  5. Find who should fix it

    Add another Google Sheets node and choose Get Row(s). Pick the Repairs document and the Contractors sheet. Under Filters, set Column to Category. In Value, paste the expression below. When the filter finds more than one match, n8n returns only the first one by default, so keep one row per category. Run it. You should see the Name and Email of your plumber, electrician or building manager.

    {{ $('Information Extractor').item.json.output.category }}
  6. Split urgent requests from normal ones

    Add an If node. Set the condition type to String > is equal to. Paste the expression below on the left and type emergency on the right. The true branch is for urgent requests and the false branch is for everything else.

    {{ $('Information Extractor').item.json.output.urgency }}
  7. Forward the request on both branches

    On the true branch, add a Gmail node (Resource: Message, Operation: Send). Set To to {{ $('Get row(s) in sheet').item.json.Email }}. If your lookup node has a different name, use that name. Set Email Type to Text. If you leave it on HTML, the line breaks in the message below collapse. Under Options, put your own address in CC, so you're on copy for every urgent request. Also under Options, turn off Append n8n attribution. It's on by default and adds "This email was sent automatically with n8n" to every email your contractors get. Use the URGENT subject below. On the false branch, add a second Gmail Send node with the same To, Email Type set to Text, the attribution turned off and the normal subject. Use the message below in both.

    Subject (true):  URGENT repair, unit {{ $('Information Extractor').item.json.output.unit }}: {{ $('Information Extractor').item.json.output.category }}
    Subject (false): Repair request, unit {{ $('Information Extractor').item.json.output.unit }}: {{ $('Information Extractor').item.json.output.category }}
    
    Message:
    Hi {{ $('Get row(s) in sheet').item.json.Name }},
    
    New repair request:
    Unit: {{ $('Information Extractor').item.json.output.unit }}
    Issue: {{ $('Information Extractor').item.json.output.summary }}
    Tenant: {{ $('Gmail Trigger').item.json.from.text }}
    
    Please reply with when you can come.
  8. Test it and turn it on

    Test with two emails, one at a time. A manual run of the Gmail Trigger will likely pick up only the newest email, so one click won't show both. First send "Water is pouring from the ceiling in 4B" to the maintenance inbox, click Execute workflow and check for a new row in Requests and an URGENT email to your plumber with you on copy. Then send "The dishwasher in 2A makes a noise", click Execute workflow again and check for a second row and a normal email to your building manager. When both work, click Publish at the top right. That's how you switch a workflow on since n8n 2.0, which no longer has an Active toggle. Later edits go live only after you publish again, and Unpublish turns the workflow off. At the end of the month, open the Requests tab: every request is there with its date, unit, category and urgency. Use Data > Create a filter to see one unit or one category. Common problems: if the expressions show empty values, the node names in them don't match yours. If an email gets no contractor, its category is missing from the Contractors tab. The AI can mislabel urgency, so keep yourself on CC for urgent requests and read the sheet every day. Source: based on the n8n template "Automate property maintenance requests with GPT-4o-mini, Jotform and Gmail" (n8n.io/workflows/9649).

DoneStuck on a step? Reply to any Daily AI Brief email and ask.
[ One tutorial a week ]

Get the next automation before it's posted.

One short email with the AI stories that matter. What happened in AI, why it matters, one tool worth trying. Free. Unsubscribe anytime.

More tutorials

All tutorials
01Find out what you missed in a long lecture with a free quiz and flashcards20 min · Beginner · 7 steps02Make Claude Code follow your project's rules in every session15 min · Beginner · 7 steps03Turn your most frequent app error into a tested fix you can review20 min · Intermediate · 7 steps
[ Daily AI Brief ]

The AI news that matters, in your inbox.

One short email with the AI stories that matter. What happened in AI, why it matters, one tool worth trying. Free. Unsubscribe anytime.