API
Integrations
n8n Integration
20 min
this guide explains how to integrate unith digital humans with n8n , a powerful automation platform, using webhooks this allows digital humans to send collected conversation data to an external system for processing and dynamic response although unith does not currently provide a native integration with n8n (as we do with zapier), this approach enables full interoperability and automation capabilities using http post requests and n8n's flexible workflow engine we’re actively working on a native n8n app as well, which will be available soon to make integration even easier what is n8n? n8n https //n8n io/ is a fair code licensed workflow automation tool that enables you to connect various systems, apis, and databases using a visual, node based interface you can self host it or run it in the cloud workflows are built by chaining nodes like webhooks, http requests, databases, emails, and more in the context of unith, n8n is ideal for capturing structured data from digital humans storing or forwarding data to crms, databases, or ticketing systems sending dynamic responses back to the digital human during a conversation use case enable a digital human in oc mode to send structured user data—like name, email, or issue descriptions—to an n8n webhook , which processes the data and optionally returns a custom response to the avatar in real time architecture flow \[user interacts with the digital human] ↓ \[the llm detects a trigger based on prompt instructions] ↓ \[the digital human activates a tool → sends post request] ↓ \[n8n receives the post via webhook node] ↓ \[n8n processes data (optional triggers external actions)] ↓ \[n8n returns a json response via the respond to webhook node] prerequisites to proceed, you will need a unith digital human with oc (open conversation) mode enabled access to the unith api a running instance of n8n https //n8n io/ (locally or hosted) optionally, ngrok https //ngrok com/ for exposing local n8n endpoints to the internet step 1 set up your webhook in n8n open your n8n editor add a webhook node to your workflow configure it as follows http method post path create ticket (you can choose your own path) response mode using "respond to webhook" node activate the workflow to generate the public url (e g https //your subdomain/webhook/create ticket ) copy this url — it will be used in the tool definition in the next step ⚠️ n8n will automatically generate the full webhook url based on your instance's environment and the path you define step 2 define a tool for the digital human tools allow the llm to invoke external services during a conversation you'll define a tool that sends a post to your n8n webhook tool json example { "conversationsettings" { "tools" \[ { "name" "create ticket", "description" "submit a support ticket with user provided information", "parameters" \[ { "name" "username", "type" "string", "description" "user's full name" }, { "name" "useremail", "type" "string", "description" "user's email address" }, { "name" "userissue", "type" "string", "description" "issue description" } ], "url" "https //your subdomain/webhook/create ticket" } ] } } apply the tool using the unith api curl x put \\ 'https //platform api unith ai/head/\<head id>/conversation settings' \\ h 'authorization bearer \<your api token>' \\ h 'content type application/json' \\ d '\<your tool json>' replace \<head id> with your digital human's id \<your api token> with your authenticated bearer token \<your tool json> with the json structure shown above step 3 define prompt instructions the prompt must clearly guide the llm on when and how to invoke the tool example if the user wants to open a support ticket, collect their name, email, and a description of the issue as soon as the user provides the issue description, immediately call the create ticket tool with the parameters 'name', 'email' and 'issuedescription' make sure the parameter names in the prompt match those defined in the tool's configuration step 4 build the n8n workflow a basic setup may include the following nodes \[webhook (post)] ↓ \[optional call apis, write to database, send email] ↓ \[respond to webhook] set node configuration example create a json output like { "message" "tell the user thank you, {{ $json username }} we have received your issue '{{ $json userissue }}' " } this message will be returned directly to the digital human and it will be used in the conversation respond to webhook node status code 200 response data first entry json content type application/json step 5 testing & validation once your webhook node is configured and your workflow is activated , you can test whether your digital human’s tool is correctly reaching n8n go to your webhook node in n8n click "execute node" n8n will go into "listening" mode and wait for an incoming request use ngrok if running n8n locally to get a public url trigger the tool in a conversation to simulate a live request monitor incoming requests and responses via http //localhost 4040 (if you are using ngrok ui) you can also check n8n’s execution logs to debug or monitor workflows summary for more advanced use cases, n8n can also store data in google sheets, airtable, notion, or databases trigger ticket creation in platforms like zendesk or jira send confirmation emails to users integrate with crm systems or internal apis need assistance? feel free to contact the unith support team at support\@unith ai mailto\ support\@unith ai