- Recipe A: the assistant asks n8n for data during the conversation, for example to look up an order.
- Recipe B: Klatt notifies n8n when the conversation ends, with its summary.
With your AI assistant
You can ask an assistant connected to Klatt’s MCP to create the webhook for you. For example:Connect my n8n workflow atThe assistant reads this guide and creates the webhook without the key. If it chose an API key, Klatt stores it as Custom header, with the header name it gave or<production URL>to my Klatt assistant<assistant>, to look up an order by its number, with a custom header credential and no key. Read Klatt’s n8n guide first.
X-Webhook-Key.
- Open the link the assistant gives you, press Generate key in Authentication, and copy the key.
- In n8n, set the Webhook node’s Header Auth credential to that header name, and paste the key as its value.
Recipe A: the assistant asks n8n during the conversation
- In n8n, add a Webhook node.
- Set the same method as in Klatt. Use
GETfor lookups. - Set the authentication to Header Auth, or Basic Auth. Create the credential with a header name such as
X-Webhook-Keyand a secret value, for example<your-secret>. - Set Respond to Using ‘Respond to Webhook’ Node.
- Set the same method as in Klatt. Use
- Add a Respond to Webhook node at the end of the workflow. Respond with a JSON object that has only the fields the assistant needs, for example
{"status": "shipped", "deliveryDate": "2026-11-04"}. - Publish the workflow and copy its Production URL, for example
https://your-n8n.example.com/webhook/order-status. The Test URL only works while the n8n editor is listening, so do not use it in Klatt. - In Klatt, open the assistant. In General, under Abilities, open Webhooks and select Add webhook. Set When it runs to During the conversation.
- Fill in the webhook.
- Method and URL: the Production URL. Put the data the assistant asks for in the query as
{{name}}, for examplehttps://your-n8n.example.com/webhook/order-status?orderId={{orderId}}. - When should the assistant use it?: which customer question triggers the lookup and what the assistant must ask first.
- Data the assistant asks for: add
orderId, with a description and a test value. Put example values in Test value, not in the description: the assistant may send an example from the description instead of what the customer says. - Authentication: Custom header, with the same header name and value as your n8n Header Auth credential. For n8n Basic Auth, choose Username and password instead. Put the secret in Authentication or in a locked (secret) header, never in a plain header or in the URL.
- Method and URL: the Production URL. Put the data the assistant asks for in the query as
- Select Test request. The result must show the JSON that n8n returned.
Requests that change data
On voice, a request that changes data during a call (POST, PUT, PATCH or DELETE) needs caller verification and the caller’s spoken confirmation. See Safety. On WhatsApp, the assistant asks the customer to confirm, and sends a POST during the conversation once they agree in their next message.Recipe B: Klatt notifies n8n when the conversation ends
-
In n8n, add a Webhook node with method
POSTand the same Header Auth setup as in Recipe A.- If your workflow is slow, set Respond to Immediately, so Klatt gets its answer fast.
- Delivery is at least once. Use the
Idempotency-Keyheader to skip a delivery you already processed. - To check that a request really comes from Klatt, see Verify the signature.
- Publish the workflow and copy its Production URL.
-
In Klatt, open Webhooks in the assistant’s Abilities, select Add webhook and set When it runs to At the end.
- URL: the Production URL.
- Authentication: the same as in n8n.
- Body: keep the default, or send only what you need, for example
summary,durationSeconds,disconnectReasonandpersonNumber:
- Optional: in Advanced, Only if…, write a condition such as “the customer promised a payment”. The request is only sent when it is true of the conversation.
-
Select Test request. It sends an example conversation, so you can see what n8n receives. A test carries
X-Klatt-Test: 1and noIdempotency-Key. - Optional: sign the requests and check the signature in n8n (see Verify the signature).
Verify the signature
A signature proves that the request came from Klatt, that its body was not changed and that it is not an old request sent again. See Signature for how it works.- In Klatt, in the webhook’s Advanced tab, select Generate secret under Signing secret, copy the secret and save the webhook.
- In n8n, open the Webhook node. In Options, turn on Raw Body, so n8n keeps the body exactly as Klatt sent it.
-
Add a Code node right after it, in Run Once for All Items mode, with this code. Replace
whsec_...with your secret:The node stops the workflow when the signature is wrong or the request is more than 5 minutes old. Otherwise it passes on the body’s fields andwebhookId. -
To process each delivery once, add a Remove Duplicates node with Remove Items Processed in Previous Executions, Keep Items Where set to Value Is New, and
webhookIdas Value to Dedupe On. -
Select Test request in Klatt. It is signed with the secret in the sheet, and its
webhookIdstarts withtest_.
crypto. On a self-hosted n8n, allow it with the environment variable NODE_FUNCTION_ALLOW_BUILTIN=crypto.
Example: debt collection
This example uses both recipes. The assistant checks a debt during the call, and n8n records the outcome afterwards. It is written for a voice assistant. On WhatsApp,personNumber is the sender’s number; read Safety before you return personal data with a GET, and note that the request at the end is sent when the conversation closes (see At the end).
- Who is on the phone.
- For a campaign that calls the assistant’s contact list, with a smart field such as “Debt reference”, send
{{contact.debt_reference}}. n8n finds the debt by reference instead of by number. See Contact data. - When the number is not in the assistant’s contact list, or on incoming calls, contact variables are empty. n8n identifies the debtor by
personNumberand looks the number up in your own system.
- For a campaign that calls the assistant’s contact list, with a smart field such as “Debt reference”, send
- Look up the debt (Recipe A,
GET).- Tell the assistant, in When should the assistant use it?, to ask for a verification datum that only the debtor knows before it calls n8n, for example the debt reference or the postal code. Add
referenceunder Data the assistant asks for, with no example value in its description. - Send both in the query. For a campaign with a smart field, use the reference from the list:
https://your-n8n.example.com/webhook/debt?debt_reference={{contact.debt_reference}}&postalCode={{postalCode}}, withpostalCodeunder Data the assistant asks for. Otherwise identify the debtor by number:https://your-n8n.example.com/webhook/debt?phone={{personNumber}}&reference={{reference}}. - In n8n, return the amount and the due date only when the debt is found and the verification datum matches.
- When they do not match, return
{"verified": false}and no other data. Limit failed attempts per number in n8n, because a caller can try several references. - Why: whoever answers the phone may not be the debtor. A
GETon voice runs without caller verification unless you add it in Advanced; here the check in n8n does that job.
- Tell the assistant, in When should the assistant use it?, to ask for a verification datum that only the debtor knows before it calls n8n, for example the debt reference or the postal code. Add
- Record the outcome (Recipe B).
-
In the assistant’s Abilities, open Capture data and add two fields:
promised_amount(type Number) andpromised_date(type Date). In each description, say what Klatt should look for, for example “the amount the customer promises to pay”. -
In Advanced, use Only if…, and send
personNumber,summary,disconnectReason,{{outcome.promised_amount}}and{{outcome.promised_date}}, so n8n knows whose outcome it is. For a campaign with a smart field, add{{contact.debt_reference}}to the body: -
The amount arrives as a number and the date as
YYYY-MM-DD. Either can benullwhen the customer did not say it, so write them in your system only when they are notnull.
-
In the assistant’s Abilities, open Capture data and add two fields:
- What this does not do. It does not record the promise during the call. That needs a request that changes data during a voice call, with caller verification (see Safety).
- Testing. The console’s test call and test chat have no number, so a URL with
{{personNumber}}or{{contact.debt_reference}}fails there. Test request sends an example number and an example value for each contact variable. Change them in the test values. It only finds a debt if your test data uses those values; otherwise expect{"verified": false}. Test the whole flow with a real call. - Personal data.
- The amount, the summary and the transcript are personal data. Ask only for the fields you need, and leave the transcript out of the body unless you need it.
- n8n keeps the data of each execution. Set how long it is kept, and how it is deleted, in n8n.
- This is not legal advice.
Troubleshooting
- The request never reaches the workflow. Use the Production URL, not the Test URL, and publish the workflow. The method in Klatt must match the method of the Webhook node; otherwise n8n answers with a 404.
- The server cannot be reached. Klatt only calls public HTTPS addresses on port 443, and does not follow redirects. A self-hosted n8n on port
:5678or onlocalhostdoes not work. Put it behind HTTPS on the standard port. - Timeouts and odd answers. Klatt waits 5 seconds by default; raise Maximum wait in Advanced up to 30 seconds if n8n needs longer. Answer with a small JSON object. Respond to Webhook sends text as
text/htmlby default, so respond with JSON. - 500 errors. If the workflow fails before it reaches Respond to Webhook, n8n answers with a 500. Klatt treats it as a server error.
- n8n rejects the request. With Header Auth, n8n answers with a 403 and
Authorization data is wrong!. Check that the header name and value in Authentication (or in your secret header) match the n8n credential exactly. Test request shows the status n8n returned. - JWT or n8n User Auth. Klatt does not sign JWTs or get n8n User Auth tokens. Use Header Auth or Basic Auth.