Optimize Website for Qualified Leads

Заказчик: AI | Опубликовано: 14.02.2026

OVERALL ARCHITECTURE You will create 4 main workflows in n8n: Lead Capture Workflow Lead Assignment Workflow Provider Response Workflow (Accept/Reject with Countdown) Admin Monitoring Workflow You can deploy n8n on: VPS (DigitalOcean / AWS / Hostinger) Docker n8n Cloud WORKFLOW 1: Lead Capture (User Submits Form) Trigger Webhook Node (POST) Input (from Android App) { "location": "Downtown", "service": "Plumbing", "name": "John Doe", "phone": "1234567890" } Nodes Structure Webhook (POST /new-lead) Set Node → format lead data Database Node (MySQL/Postgres/Firebase) Insert lead Status = "NEW" Execute Workflow Node → Trigger "Lead Assignment Workflow" Respond to Webhook WORKFLOW 2: Lead Assignment (Admin Rules Engine) This workflow auto-assigns based on rules set by admin. Nodes Execute Workflow Trigger Database → Get Available Providers Filter: service = lead.service location = lead.location status = "AVAILABLE" IF Node If provider exists → continue Else → Mark as "UNASSIGNED" Assign Provider Update lead: assigned_to = provider_id status = "WAITING_PROVIDER" Send Push Notification Firebase Cloud Messaging (FCM) Or HTTP call to notification service Wait Node (30 sec) IF status still WAITING_PROVIDER Reassign to next provider WORKFLOW 3: Provider Accept/Reject Flow When provider clicks ACCEPT or REJECT. Trigger Webhook: /lead-accept /lead-reject ACCEPT FLOW Webhook Update Lead: status = "IN_PROGRESS" Update Provider: status = "BUSY" Notify Admin Notify User REJECT FLOW Webhook Update lead: status = "REASSIGN" Trigger Assignment Workflow Again Countdown Logic in n8n Use: Wait Node → 30 seconds After wait: Check DB If no response → auto reject + reassign WORKFLOW 4: Admin Monitoring System This runs continuously. Option A: Polling Cron Node (every 1 minute) Fetch all leads Send summary to Admin Panel API Option B: Event Driven (Recommended) On every: Lead Created Assigned Accepted Completed Send: WebSocket message Or HTTP callback to Admin panel Database Structure (Recommended) Leads Table | id | name | phone | service | location | status | assigned_to | created_at | Statuses: NEW WAITING_PROVIDER IN_PROGRESS COMPLETED REASSIGN CANCELLED Providers Table | id | name | service | location | status | device_token | Statuses: AVAILABLE BUSY OFFLINE Push Notification Setup Use: Firebase Cloud Messaging n8n HTTP Request Node Send device_token Security Setup Important for production: Add API Key validation in Webhook Use JWT authentication Enable HTTPS Use rate limiting