Simple Python alternative to the complex n8n workflow.
Slack Webhook → Extract Lead → SerpAPI Search → Claude Code (GLM) → Slack Reply
pip install -r requirements.txtEdit ~/.config/claude-code/config.json (or C:\Users\YOURUSER\.claude\config.json on Windows):
{
"apiProvider": "openai-compatible",
"apiKey": "6024c744cdc4468b8b337ff4df5038be.mmQhTB8WHG1rSXOp",
"baseUrl": "https://api.z.ai/api/coding/paas/v4",
"modelId": "glm-4"
}export SLACK_BOT_TOKEN="xoxb-..."
export SERPAPI_KEY="..."
export PORT=5678Or edit the defaults in lead_qualifier.py.
python lead_qualifier.pyUse Cloudflare Tunnel or ngrok to expose localhost:
cloudflare tunnel --url http://localhost:5678Then add the webhook URL to your Slack app:
https://your-tunnel-url.cloudflare.net/webhook
lead_qualifier.py- Main server (reuses all n8n logic)requirements.txt- Python dependenciesREADME.md- This file
- ✅ Lead extraction (same regex as n8n)
- ✅ SerpAPI dentist verification
- ✅ Claude Code CLI with GLM-4
- ✅ JSON response parsing
- ✅ Slack reply with emoji/status
- ✅ Error handling & logging