zgba Network

How I Built an Embedded Chatwoot Dashboard App for 1-Click Webhook Runbooks & Ticket Spikes

If you run Chatwoot in production for customer support, you already know how great it is as an open-source omnichannel inbox. However, during high-volume ticket spikes—like a product launch, a billing issue, or a server outage—support teams quickly run into three workflow bottlenecks: No Outbound Webhooks in Native Macros: Agents cannot manually click a macro button inside a ticket to trigger an external HTTP webhook (like an n8n workflow, a Stripe refund check, or a Jira bug escalation) while simultaneously tagging the ticket. Execution Order & Retries: When chaining multiple actions (applying labels, updating custom attributes, posting internal notes, and calling external APIs), you need deterministic step order and automatic retries if a webhook times out. Spike Triage Visibility: During a surge, managers need to see real-time category velocity and first-response metrics without exporting data. To solve this without modifying Chatwoot’s core Ruby on Rails codebase, I built ProfitPilot (Spike Support Toolkit)—a companion add-on that embeds natively inside Chatwoot. 🛠️ How It Works Inside Chatwoot Instead of forcing support agents to switch tabs to an external dashboard, ProfitPilot uses Chatwoot’s Dashboard App architecture to render directly inside the agent conversation view (ProfitPilotTool tab). When an agent opens a ticket, ProfitPilot automatically receives the conversation context (conversation.id, contact, and currentAgent) and displays 1-Click Active Runbooks: Handle Refund Request (BILLING): Acknowledges the refund request, applies tracking labels, sets custom attributes, and dispatches a billing notification webhook. Escalate Bug to Engineering (ENGINEERING): Posts a private internal engineering note, tags the conversation with severity, updates tracking attributes, and alerts developers via webhook. VIP Priority Escalation (SUPPORT): Tags the conversation as high-priority, notifies the on-call team, and logs an internal SLA tracking note. Subscription Cancellation & Retention (BILLING): Triggers a targeted retention offer, logs churn reason attributes, and tags the account. 🏗️ Architecture Under the Hood I designed the toolkit with multi-tenancy, high throughput, and strict data privacy in mind: Chatwoot Agent UI (Embedded Dashboard App Tab) ⬇️ (Sends conversation context via HTTPS / HMAC / REST) Node.js + Express Ingress (Protected by Helmet CSP, Rate Limiters, and SSRF validation) ⬇️ (Queues execution job & logs metadata) BullMQ + Redis Worker Queue (Ordered step execution + idempotent retries) & PostgreSQL + Prisma (Multi-tenant scoped, zero chat PII stored) ⬇️ (Dispatches actions in strict sequence) Outbound Executors (Updates Chatwoot labels/attributes/notes via API + triggers external HTTP webhooks like n8n) 1. Deterministic, Resumable Runbook Engine (BullMQ + Redis) When an agent clicks a Runbook, the job is queued in BullMQ. The worker executes each step in strict stepIndex order: add_label → Applies conversation labels via the Chatwoot API set_attribute → Updates conversation/contact custom attributes send_message → Posts public replies or private internal notes with dynamic template variables http_webhook → Dispatches an SSRF-safe HTTP payload to external tools like n8n, Make, Slack, or internal microservices If step 3 of a 4-step runbook fails due to a network timeout, steps 1 and 2 are marked COMPLETED (idempotent), allowing the execution to resume from step 3 without duplicating messages or tags. 2. Privacy & GDPR by Design (Zero Message PII) One of the biggest concerns companies have with support add-ons is data privacy. ProfitPilot never stores customer conversation bodies or message text. For real-time triage analytics, our webhook processor only extracts conversation metadata (tags, status, timestamps, and message counts) and runs an automated retention sweep to purge old logs. 🧪 Looking for Early Beta Testers (Free Beta Trial) We are currently opening up a free beta trial for developers, self-hosters, and support teams actively running Chatwoot (especially if you pair Chatwoot with n8n or manage high ticket volumes). 🚀 Live Web App: https://app.profitpilottool.com 💬 Chatwoot GitHub Show & Tell: Discussion #16204 If you are using Chatwoot and want to test 1-click Runbooks on your instance—or if there is a specific workflow trigger you wish Chatwoot had—drop a comment below! I’d love to hear your feedback.

View original article