AI-powered CRM Lead Scoring & Workflow Automation using n8n, Ollama, MySQL, Docker, and PHP REST API.
AI CRM Automation is a workflow automation project that automatically analyzes incoming CRM leads using a local Large Language Model (LLM).
Instead of manually reviewing every lead, the workflow sends customer information to Ollama (Dolphin Llama 3), generates an AI-based lead score, assigns a priority level, determines the qualification status, and stores the results back into MySQL.
The entire process is orchestrated by n8n and runs locally using Docker.
- 🤖 AI-powered Lead Scoring
- ⚡ Automated CRM Workflow
- 🧠 Local LLM with Ollama
- 🐬 MySQL Database Integration
- 🔄 Loop Processing for Multiple Leads
- 📝 AI-generated Qualification Reason
- 📊 Automatic Priority Classification
- 🐳 Docker Deployment
- 🌐 REST API Communication
- 🔒 Fully Local & Private
The workflow performs the following steps:
- Query unprocessed leads from MySQL
- Loop through each lead
- Send lead data to Ollama
- AI analyzes the lead
- Generate:
- Score
- Priority
- Status
- Reason
- Parse AI response
- Update MySQL
- Save activity log
Leads waiting for AI processing.
AI automatically updates:
- Score
- Priority
- Status
- AI Reason
{
"id": 2,
"score": 85,
"priority": "High",
"status": "Qualified",
"reason": "Interested in CRM automation and AI integration."
}| Technology | Purpose |
|---|---|
| n8n | Workflow Automation |
| Ollama | Local LLM |
| Dolphin Llama 3 | AI Lead Analysis |
| Docker | Containerization |
| MySQL | Database |
| PHP | REST API |
| JSON | Data Exchange |
ai-crm-automation
│
├── docs
│ ├── architecture.png
│ ├── thumbnail.png
│ ├── workflow.png
│ ├── mysql-before.png
│ └── mysql-after.png
│
├── docker
├── mysql
├── php
├── workflows
│
├── docker-compose.yml
├── README.md
└── LICENSE
git clone https://github.com/ibam28/ai-crm-automation.gitdocker compose up -dsource database.sqlOpen n8n
Import:
workflows/ai-crm-automation.json
ollama servePull model
ollama pull dolphin-llama


