n8n Integration
n8n is configured through the unified API & Webhooks tool in Webhook mode. This page covers the n8n-specific setup; see the unified tool page for everything else.
How it works
- In n8n, add a Webhook node as the workflow’s trigger.
- Copy its Production URL (looks like
https://n8n.yourhost.com/webhook/abc123orhttps://your-workspace.app.n8n.cloud/webhook/abc). - In thinnestAI, add the n8n tool to your agent and paste the URL.
- When the agent decides to trigger the workflow, it POSTs a JSON payload to that URL.
- n8n receives the payload and runs downstream nodes (CRM, databases, messaging — anything n8n supports).
Setting it up
Step 1 — create the n8n workflow
- Open n8n (self-hosted or Cloud).
- Create a new workflow and add a Webhook node as the first step.
- Configure the node:
- HTTP Method:
POST - Path: a unique slug (e.g.
thinnest-leads) - Response Mode: “Immediately” (so the agent doesn’t wait on your whole workflow)
- (Optional) Authentication: set to Header Auth and add a credential like
X-Webhook-Secret: <your-random-secret>.
- HTTP Method:
- Switch to the Production URL tab on the node and copy the URL.
- Wire downstream nodes (HTTP request to your CRM, database insert, Slack message, etc.) and activate the workflow with the top-right toggle.
Step 2 — add the tool in thinnestAI
- Open your agent → Tools → Add Tool → API & Webhooks, and choose Webhook mode.
- Paste the n8n Webhook Production URL.
- (Optional) If you enabled Header Auth in n8n, paste the secret in the Header Auth Secret field. thinnestAI sends it as
X-Webhook-Secreton every request. - Save.
Step 3 — tell the agent when to use it
Add a line to your agent’s instructions:| Function | When to use |
|---|---|
send_event(event_name, customer_name, customer_email, customer_phone, notes, custom_fields) | Structured CRM-style events (new lead, support ticket, callback request). Use for most cases. |
send_webhook(data, event_type) | Free-form — send any JSON payload. Use for non-CRM data. |
Payload format
Every request n8n receives has this shape:{{ $json.body.data.customer_email }} — the whole payload sits under $json.body.
Example: support ticket → Freshdesk + Slack
Voice flow:Securing the webhook
Option 1 — Header Auth (recommended)
- In the n8n Webhook node, set Authentication to Header Auth.
- Click Create New Credential, name it, set:
- Header Name:
X-Webhook-Secret - Header Value: a long random string
- Header Name:
- In the thinnestAI tool config, paste the same random string into Header Auth Secret.
Important: The n8n tool always sends its secret on theX-Webhook-Secretheader. If your n8n Header Auth credential uses a different header name (for exampleAuthorizationorX-API-Key), n8n will reject the request because the header won’t match. If you need a custom header name, use the generic Webhook tool instead — it accepts awebhook_headersfield where you can pass any header name you want.
Option 2 — IP allow-listing (self-hosted only)
If you self-host n8n behind a reverse proxy, you can allow-list thinnestAI’s outbound IPs at the proxy level. Ask support for the current IP list if you go this route.Self-hosted vs. n8n Cloud
Both work identically with this tool. The only difference is the Webhook Production URL:| Edition | URL pattern |
|---|---|
| n8n self-hosted | https://n8n.yourdomain.com/webhook/<path> |
| n8n Cloud | https://<workspace>.app.n8n.cloud/webhook/<path> |
| n8n local dev | https://localhost:5678/webhook/<path> (won’t work from thinnestAI Cloud — use a tunnel like ngrok if you need to test locally) |
Limits & pricing
- n8n self-hosted: no per-execution fee; you’re limited by your server capacity.
- n8n Cloud: varies by plan — check your workspace’s execution quota.
- thinnestAI’s side: no per-call charge. Unlimited webhook triggers from the agent.
- Latency: the agent waits up to 15s for n8n to respond. Set the Webhook node’s Response Mode to “Immediately” so n8n acks quickly and runs downstream nodes async.
When to use n8n vs. alternatives
| Need | Use |
|---|---|
| Trigger a self-hosted automation workflow | n8n (this tool) |
| Trigger Make.com / Integromat | Use the Make.com tool |
| Generic HTTP POST to your own backend | Use the generic Webhook tool |
| Deep native integration (Gmail, HubSpot, Sheets) | Use the native Gmail / Sheets tools |
Troubleshooting
| Symptom | Fix |
|---|---|
| Agent says “Webhook returned status 404” | Workflow is deactivated in n8n. Activate it with the top-right toggle. |
| Agent says “Could not connect to webhook URL” | URL is wrong, n8n is down, or you used the Test URL instead of the Production URL. |
| n8n returns 401 / 403 | Header Auth mismatch. Re-check that the secret in thinnestAI exactly matches the n8n credential. |
| Workflow fires but fields empty | n8n downstream nodes reference the wrong path. Fields live under $json.body.data.* (not $json.*). |
| Timeout every time | Your workflow runs long and n8n isn’t set to Respond Immediately. Change the Webhook node’s Response Mode. |
Configuration reference
| Field | Required | Description |
|---|---|---|
| n8n Webhook URL | Yes | The Production URL from the Webhook node. |
| Header Auth Secret | No | Matches the n8n Webhook node’s Header Auth credential value. Sent as X-Webhook-Secret. |
Next steps
- Make.com — same pattern but for Make.com scenarios.
- CRM & Webhooks — generic webhook tool and CRM lookup patterns.
- Custom Tools — build bespoke HTTP tool calls when a webhook isn’t expressive enough.

