Skip to content

feat: add Chatwoot integration with diagnostic tool and templates#570

Open
RenatoAscencio wants to merge 4 commits intoczlonkowski:mainfrom
RenatoAscencio:feat/chatwoot-upstream
Open

feat: add Chatwoot integration with diagnostic tool and templates#570
RenatoAscencio wants to merge 4 commits intoczlonkowski:mainfrom
RenatoAscencio:feat/chatwoot-upstream

Conversation

@RenatoAscencio
Copy link
Copy Markdown

Summary

Adds a comprehensive Chatwoot integration module to n8n-MCP:

  • Connection validator — tests Application + Platform API credentials with 10s timeout, error classification (network/dns/timeout/ssl/auth), HTTP status mapping, and secret sanitization
  • 5 workflow templates for common Chatwoot automation patterns (monitoring, sync, messaging, auto-assignment, public API)
  • chatwoot_doctor MCP tool — diagnostic tool for troubleshooting (server info, n8n connectivity, credential detection, template verification, optional Chatwoot API test)
  • 19 unit tests with 88% statement coverage

Files added/modified

src/integrations/chatwoot/
├── index.ts                    # Integration entry point + metadata
├── chatwoot-integration.ts     # Template registry + connection validation
├── connection-validator.ts     # Multi-credential testing with error classification
└── workflow-templates.ts       # 5 production-ready workflow templates

src/mcp/
├── tools-chatwoot.ts           # chatwoot_doctor tool definition
├── handlers-chatwoot.ts        # chatwoot_doctor handler (195 lines)
└── server.ts                   # +12 lines: tool registration

tests/
├── handlers-chatwoot.test.ts          # 7 tests for chatwoot_doctor
└── chatwoot-connection-validator.test.ts  # 12 tests for connection validator

README.md                       # +39 lines: integration docs + troubleshooting

Companion package

Designed for @renatoascencio/n8n-nodes-chatwoot v0.4.1 — 27 resources, 130+ operations across Chatwoot's Application, Platform, and Public APIs.

Verification

  • npm run build — compiles cleanly
  • npm run lint — no errors
  • 19/19 Chatwoot tests pass (88% coverage)
  • Tested live: chatwoot_doctor reports healthy, templates available, n8n API connected
  • End-to-end: chatbot workflow using Chatwoot node responds to Telegram messages via Chatwoot

Test plan

  • npm run build passes
  • npm test — existing tests unaffected, 19 new Chatwoot tests pass
  • Import a workflow template into n8n with @renatoascencio/n8n-nodes-chatwoot installed
  • Run chatwoot_doctor tool to verify integration health

🤖 Generated with Claude Code

RenatoAscencio and others added 4 commits February 13, 2026 19:06
Add Chatwoot integration with connection validation and workflow templates:

- Connection validator: tests Application + Platform API credentials
  with timeout (10s), error classification (network/dns/timeout/ssl),
  HTTP status mapping (401/403/404/5xx), and secret sanitization
- 5 workflow templates: conversation monitor, contact sync,
  auto-responder, CSAT follow-up, public API widget
- Integration entry point with metadata and template registry

Designed for @renatoascencio/n8n-nodes-chatwoot v0.4.1
(27 resources, 130+ operations, 3 API types)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add chatwoot_doctor tool for troubleshooting Chatwoot integration:

- Reports MCP server info (version, platform, Docker detection)
- Tests n8n API connectivity (if configured), masks secrets
- Detects Chatwoot credentials via n8n credential listing
- Verifies 5 workflow templates are available
- Optional: tests Chatwoot API directly (baseUrl/token args)
- Returns healthy/issues summary with response time
- sanitizeErrorMessage() strips tokens/keys from error strings

Always available (not gated by n8n API config).
Registered in server.ts ListTools + executeTool.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
19 tests covering:
- handlers-chatwoot (7): server info, n8n API check, Chatwoot API
  test, verbose mode, secret sanitization, missing credentials
- connection-validator (12): successful connection, 401/403/404 error
  classification, network/DNS/timeout/SSL errors, secret sanitization,
  testAll orchestration

88% statement coverage on Chatwoot modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Chatwoot Integration section with:
- Workflow templates table (5 templates)
- chatwoot_doctor diagnostic tool description
- Troubleshooting table (4 common issues)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant