I built an AI email agent for a towing company. Here's what actually made it hard. ๐งต
The client was drowning in emails. Vehicle releases, invoice disputes, insurance adjusters, frustrated customers. Repetitive, time-sensitive, and legally sensitive. A perfect automation target.
I built the whole thing in n8n with GPT Here's how the pipeline works:
1 โ Gmail trigger polls every minute for new emails
2 โ Filter out self-sent emails to prevent reply loops
3 โ AI classifies urgency, category, tone, and sender intent
4 โ Business hours check (America/Toronto timezone)
5 โ High urgency โ instant Telegram alert to the owner
6 โ 30-min wait, then fetch the full thread
7 โ Check if the last reply was already theirs โ skip if so
8 โ AI drafts and sends a contextual acknowledgment
The hardest part wasn't the pipeline. It was the system prompt.
Towing companies operate in a legally grey space โ releasing a vehicle, confirming a payment, or acknowledging a balance can carry real liability. So the AI had to be useful without ever being authoritative. Every response needed to feel human and helpful, while deferring every actual decision to billing or dispatch.
I spent more time on prompt guardrails than on the n8n nodes. Things like: don't use names from the incoming greeting (they're usually addressing internal staff, not the sender), never validate a claim even if the sender says it's already been approved, and route Interac deposit notifications silently โ no reply, just a Telegram ping to the owner.
Thread memory via a custom session key keeps the AI context-aware across multi-message conversations. Structured output parsers keep responses predictable. The whole thing runs unattended.
Clients now get a reply in under a minute. The team gets a Telegram summary. No one touches a routine email anymore.
If you're an automation dev, the unglamorous truth is: the plumbing is easy. Understanding the client's legal and operational risk is where the real work lives.
#n8n #AIAgents #WorkflowAutomation #PromptEngineering #LLM #Automation #BuildInPublic #OpenAI #NoCode #FreelanceDev