Skip to main content
You can connect an assistant to n8n in two ways:
  • 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.
No n8n node is needed. The recipes use n8n’s Webhook node and Klatt webhooks.

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 at <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.
The 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 X-Webhook-Key.
  1. Open the link the assistant gives you, press Generate key in Authentication, and copy the key.
  2. In n8n, set the Webhook node’s Header Auth credential to that header name, and paste the key as its value.
Never give the key to the assistant, in the chat or anywhere else.

Recipe A: the assistant asks n8n during the conversation

  1. In n8n, add a Webhook node.
    • Set the same method as in Klatt. Use GET for lookups.
    • Set the authentication to Header Auth, or Basic Auth. Create the credential with a header name such as X-Webhook-Key and a secret value, for example <your-secret>.
    • Set Respond to Using ‘Respond to Webhook’ Node.
  2. 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"}.
  3. 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.
  4. In Klatt, open the assistant. In General, under Abilities, open Webhooks and select Add webhook. Set When it runs to During the conversation.
  5. Fill in the webhook.
    • Method and URL: the Production URL. Put the data the assistant asks for in the query as {{name}}, for example https://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.
  6. Select Test request. The result must show the JSON that n8n returned.
See Webhooks for the variables, limits and what the assistant does with the answer.

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

  1. In n8n, add a Webhook node with method POST and 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-Key header to skip a delivery you already processed.
    • To check that a request really comes from Klatt, see Verify the signature.
  2. Publish the workflow and copy its Production URL.
  3. 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, disconnectReason and personNumber:
  4. 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.
  5. Select Test request. It sends an example conversation, so you can see what n8n receives. A test carries X-Klatt-Test: 1 and no Idempotency-Key.
  6. Optional: sign the requests and check the signature in n8n (see Verify the signature).
See Webhooks for when the request is sent, retries and the full list of variables.

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.
  1. In Klatt, in the webhook’s Advanced tab, select Generate secret under Signing secret, copy the secret and save the webhook.
  2. In n8n, open the Webhook node. In Options, turn on Raw Body, so n8n keeps the body exactly as Klatt sent it.
  3. 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 and webhookId.
  4. 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 webhookId as Value to Dedupe On.
  5. Select Test request in Klatt. It is signed with the secret in the sheet, and its webhookId starts with test_.
The secret is part of the workflow, so anyone who can edit the workflow can read it. On n8n Cloud the Code node can use 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 personNumber and looks the number up in your own system.
  • 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 reference under 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}}, with postalCode under 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 GET on voice runs without caller verification unless you add it in Advanced; here the check in n8n does that job.
  • Record the outcome (Recipe B).
    • In the assistant’s Abilities, open Capture data and add two fields: promised_amount (type Number) and promised_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 be null when the customer did not say it, so write them in your system only when they are not null.
  • 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 :5678 or on localhost does 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/html by 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.