Citizen Complaint Routing & SLA Escalation
Takes complaints over WhatsApp, has AI classify them and route them to the right department, stores them in a database and confirms receipt. Complaints that miss their SLA are escalated automatically.

On this page
How it works
- A WhatsApp message arrives through a webhook.
- AI classifies the complaint (water, electricity, sanitation and so on).
- It's assigned to the right department and saved in Postgres.
- The citizen gets a confirmation with a reference.
- Every few minutes, pending complaints are checked and SLA breaches are escalated.
Use cases
- Municipal corporations
- Utility providers
- Housing societies and campuses
What you need
This workflow connects to these apps.
- n8n
- OpenAI
- HTTP
You'll need an n8n instance, on n8n Cloud or self-hosted, and these credentials. Our credentials guide shows how to create each one.
- OpenAI account
- Postgres account
- Twilio account
Setup
- Download the JSON and import it into n8n with Import from File, or copy it and paste it onto an empty canvas. The import guide walks through both.
- Connect the credentials listed above.
- Point the Sheets, Airtable, Drive, and Slack nodes at your own files and channels.
- Replace placeholder emails, phone numbers, and form links with your own.
- Times use the America/New York timezone and dates use MM/DD/YYYY. Change them if you need to, then test and activate. The setup guide covers this step by step.
Nodes
| Node | Type |
|---|---|
| OpenAI Chat Model | lmChatOpenAi |
| Simple Memory | memoryBufferWindow |
| Citizen Request Webhook | webhook |
| Extract WhatsApp Message | set |
| AI Complaint Classifier | agent |
| Route to Department | switch |
| Assign Water Department | set |
| Assign Electricity Department | set |
| Assign Sanitation Department | set |
| Save Complaint to Database | postgres |
| Generate Confirmation Message | code |
| Send WhatsApp Notification | twilio |
| SLA Scheduler (Every 5 Minutes) | scheduleTrigger |
| Fetch Pending Complaints | postgres |
| Check SLA Breach | if |
| Mark Complaint as Escalated | postgres |
| Assign Senior Officer | set |
| Generate Escalation Alert Message | code |
| Send Escalation WhatsApp Alert | twilio |
| No SLA Breach (Skip) | noOp |
Frequently asked questions
Takes complaints over WhatsApp, has AI classify them and route them to the right department, stores them in a database and confirms receipt. Complaints that miss their SLA are escalated automatically. It's a 22-node n8n workflow.
An n8n instance, on n8n Cloud or self-hosted, and credentials for OpenAI, Postgres, and Twilio. It uses only nodes that ship with n8n, so there's nothing else to install.
Download the JSON, then in n8n create a new workflow, open the menu in the top right, and choose Import from File. You can also copy the JSON and paste it onto an empty canvas.
Yes. It's free to download, import, and change, with no sign-up. You only pay for the apps it connects to, where those aren't free on your plan.



