- Per-turn dispatch (router → sub-agent → tool) runs in-code as TypeScript inside the Vorel web app. Type-checked, version-controlled, code-reviewed. This is the synchronous AI brain that handles every customer message + voice turn.
- Around-the-brain workflows (post-booking nudges, nurture cadences, weekly digests) run in n8n: operator-editable visual workflows that consume Vorel’s public API + outbound webhooks.
n8n runs in its own container, separate from the agent hot path, behind operator-only SSO. The
around-the-brain templates are available as importable workflow exports; the operator imports and
builds the real workflow in the n8n UI per-tenant during onboarding. n8n consumes Vorel’s public
/api/v1/* API over HTTP and is never on the voice/chat dispatch path. Standing up the n8n service
per-tenant follows the operator setup runbook.The 3 v1 templates
Post-booking confirmation
Trigger: Vorel webhook on
booking.created.Flow: When the agent books an appointment, fan out: Slack notify the assigned user, push
to the tenant’s CRM via Vorel’s create-record endpoint, and schedule a 24-hour-before
reminder via Vorel’s outbound conversation send. Appointment data comes from the webhook
payload, so no extra GET is needed.Vorel API surface: POST /v1/crm/create-record · POST /v1/conversations/:id/sendAvailable as an importable workflow template (ask your Vorel operator).Lead nurture (3-day)
Trigger: n8n schedule trigger, daily 09:00 cron (
0 9 * * *).Flow: Daily, find leads stale-qualified for 3+ days, send a re-engagement WhatsApp
template via Vorel’s outbound conversation send; escalate to human handoff after 7 days. The
lead-list filter ?stale_for_days=N is the vendored shortcut for the cohort.Vorel API surface: GET /v1/leads?stale_for_days=3 · POST /v1/conversations/:id/send ·
POST /v1/leads/:id/handoff · PATCH /v1/leads/:idAvailable as an importable workflow template (ask your Vorel operator).Weekly QA rollup
Trigger: n8n schedule trigger, Monday 09:00 cron (
0 9 * * 1).Flow: Aggregate QA scores + hallucination flags + handoff reasons from the prior 7 days;
format the rollup; email or Slack the digest to the operator. Single-endpoint workflow
backed by weekly-rollup.Vorel API surface: GET /v1/analytics/weekly-rollupAvailable as an importable workflow template (ask your Vorel operator).httpRequest URL in every template against the live OpenAPI
spec; a renamed or removed endpoint would fail the build before the template silently breaks.
How operator deployment works
When n8n is stood up, the operator runs through this on each new tenant:Gate n8n behind operator-only SSO
Put the n8n domain behind SSO so only the operator team can reach it.
Issue a per-tenant Vorel API key
Create a per-tenant Vorel public API key from the admin console with the scopes each template
needs (
leads:write, conversations:write, crm:write, read).Import the workflow files
Import each template into n8n; configure credentials (the API key) + the cron timezone (per
tenant’s local time).
Around-the-brain vs. in-brain: the split
Per-turn agent dispatch is in code, not n8n:- The router → sub-agent → tool flow runs in-process via
runChatDispatch/runVoiceDispatch. - Each tool route at
/api/tools/*is JWT-authed (5-min TTL) and tenant-scoped viawithTenantContext. - This stays type-checked, code-reviewed, and version-controlled; the synchronous AI brain is too load-bearing to live in a visual editor.
- Post-booking nudges, nurture cadences, weekly digests, custom escalation flows.
- Operators clone + tune templates per-tenant without a code deploy.
- Each tenant’s workflows are isolated by API key.
Custom workflows beyond the v1 templates
Tenants who want bespoke workflows go in two directions:- Subscribe to webhooks at
/(dashboard)/settings/integrations/webhooks: receivelead.created/booking.created/ 10 other event types in your own automation system. HMAC-SHA256 signed; 6-attempt retry ladder. - Pull from the public API: every resource (conversations, leads, appointments, offerings, analytics) has GET (list) + GET (id) + POST + PATCH parity. Build whatever cohort / cron / fan-out you need.
What’s NOT supported
- Always-on n8n, today. Templates exist on disk; the n8n service is stood up per the operator runbook rather than running by default. Around-the-brain workflows aren’t running until the runbook is executed.
- Vorel-managed scheduling. Crons live in n8n; Vorel doesn’t run its own cron service today. The scheduled analytics exports/alerts are triggered by an external scheduler hitting internal endpoints.
- Visual workflow editor inside Vorel’s dashboard. n8n is the editor; we don’t ship a bespoke one.
- End-customer-facing workflow editing. n8n access is operator-team-only behind SSO. Tenants describe what they want during onboarding; the operator builds the workflow per-tenant.
Related docs
- API Reference: endpoint catalog
- Webhooks: outbound webhook contract
- Analytics: weekly-rollup endpoint
- How it works: where the in-code dispatch fits