-
Notifications
You must be signed in to change notification settings - Fork 3
Core N8N Workflow Automation
Scope note: this page documents
ragleap-core's engine (core/,channels/), not theragleap-rag/ragleap-graphpip packages covered by the rest of this wiki. See Home for the packages wiki index.
Configure a webhook, pick which channels should trigger it, and it fires automatically after the AI replies — no code required per automation. Single-tenant, open since #141.
core/workflows.py's call_n8n_workflows(channel, message, ai_reply, context) looks up every active workflow configured for the given channel and POSTs a JSON payload to each one's webhook URL:
{
"channel": "whatsapp",
"message": "the user's original message",
"ai_reply": "the AI's answer",
"context": {}
}It never raises — a broken or slow webhook can't break the main chat reply. Each channel adapter calls it right after sending the AI's reply, wrapped in its own try/except as a second layer of safety.
| Channel | Status |
|---|---|
| ✅ Wired | |
| Telegram | ✅ Wired |
| Discord | ✅ Wired |
| Voice | ❌ Not yet — different protocol shape (WebSocket, not send-then-return). See #143 |
| Route | Purpose |
|---|---|
GET /n8n-workflows |
List workflows, optionally filtered by channel/active status |
POST /n8n-workflows |
Create a workflow (name, webhook_url, channels, is_active) |
GET /n8n-workflows/{id} |
Get one workflow |
PATCH /n8n-workflows/{id} |
Update any field |
DELETE /n8n-workflows/{id} |
Delete |
Tested end-to-end against a real, non-mocked webhook endpoint — including confirming the negative case (a workflow with channels: ["api_test"] correctly does not fire when called with channel="whatsapp") before confirming the positive case fires correctly across all three wired channels.
Multi-tenant per-workspace workflow routing, and Voice channel coverage.
#143 — wire n8n triggers into the Voice channel. The three wired text channels are a clear reference implementation for the pattern needed.