Zendesk support chatbot for n8n that raises tickets
An n8n support chatbot that tries to resolve questions from your help content first, and raises a Zendesk ticket with priority and tags only when a human is needed.
Prerequisites
- An n8n instance, cloud or self-hosted
- A Zendesk account with admin or agent access, and your Zendesk subdomain
- A Zendesk API token, from Admin Center → Apps and integrations → APIs → API tokens
- An OpenAI API key (or another chat model credential)
- Your help centre or FAQ copy as plain text
A support chatbot that answers from your help content by default and raises a Zendesk ticket only when it cannot resolve something, or the visitor asks for a person.
What you'll build
The ticket that lands in Zendesk carries a subject, a description, a priority and tags identifying it came from the chatbot and which session, not a raw transcript dump. The bot treats a ticket as the fallback rather than the default: a support bot that raises a ticket the moment someone asks a question defeats the point of having one.
How it works
- A webhook receives each widget message and checks a shared secret.
- An AI agent tries to answer from your
knowledgetext first. - It only raises a ticket if the issue is not covered, or the visitor explicitly asks for a person. It needs the visitor's email and a clear description first.
- The agent also classifies urgency using only
low,normal,highorurgent, mapped directly onto Zendesk's priority field. Most things should benormal; the prompt reserveshighandurgentfor issues that are actively blocking, such as a failed login or payment. - The create_ticket tool is a separate workflow that validates the email and calls the Zendesk Tickets API. There is no consent gate, because no marketing list is involved.
What it costs
The workflow is free to download and use. Your AI provider charges per conversation, and your n8n hosting and the plan for the service you connect apply as normal. For N8N Chat UI plans, see pricing.
Set it up
- Generate an API token. In Zendesk go to Admin Center → Apps and integrations → APIs → API tokens and create one. Copy it now.
- Create the credential. In n8n, create an HTTP Basic Auth credential. The username is your email with a literal
/tokensuffix, for example[email protected]/token(type/tokenexactly, it is not a placeholder). The password is the API token, not your Zendesk password. Getting this format wrong is the most common mistake with this recipe. - Import the workflow. Download the file with the button at the top of this page and import it with Workflows → Import from File. It holds the main chatbot and its tool workflow on one canvas, each in a labelled section.
- Move each tool into its own workflow. n8n tools call a separate workflow, so for each tool section below the main flow: select its nodes, copy them, create a new empty workflow and paste. Save it, then open the matching tool node under the agent and select that workflow. Attach the Basic Auth credential to Create Zendesk ticket.
- Fill in the settings. In Chatbot settings set
company_name,knowledge(your help content) and a randomwebhook_secret. In the create ticket workflow's Tool settings setzendesk_subdomain, the part before.zendesk.comin your Zendesk URL. - Add your AI credential. Open GPT-4.1 mini model and add your OpenAI credential. Swap the node for another chat model if you prefer.
Test it
Send a test message before you connect a widget. n8n's built-in chat panel needs a Chat Trigger, so it will not open for this workflow. Instead, click Test workflow, then send a POST request to the Test URL shown on the Chat webhook node:
curl -X POST 'YOUR_TEST_URL' \
-H 'Content-Type: application/json' \
-d '{"chatInput":"Hello","sessionId":"test-1","metadata":{"webhook_secret":"YOUR_SECRET"}}'The test URL listens for one request each time you click Test workflow. For a longer conversation, activate the workflow and send requests to the production URL, then read each run under Executions. Reuse the same sessionId to continue a conversation, because memory is kept per session.
Things to try:
- Ask something your
knowledgetext covers. It should answer directly with no ticket. - Ask something it does not cover. It should try to help, then offer a ticket.
- Ask for a person explicitly. It should move straight to collecting your email and a description.
- Describe an active outage or login failure. The ticket should be
highorurgent. A vague, mildly annoyed message should benormal. - Give an invalid email. The bot should ask again and raise nothing.
Add it to your site
Activate the workflow and use its production webhook URL as your widget's chat endpoint. Send the same secret in the widget metadata, for example metadata: { page_url: window.location.href, webhook_secret: 'YOUR_SECRET' }. The metadata docs explain how metadata reaches n8n.
Any chat front end that can POST chatInput, sessionId and metadata to a webhook and read { "output": "..." } back will work. N8N Chat UI is built for exactly this.
Troubleshooting
I get a 401 from Zendesk
Almost always the credential format. Check the username has the literal /token suffix and the password is the API token.
I get a 401 immediately, even with correct credentials
The workflow's own secret check runs before your request ever reaches Zendesk. Check metadata.webhook_secret in your request matches webhook_secret in Chatbot settings.
Tickets have the wrong priority
Check the urgency guidance in the agent's system prompt is intact. The model needs the explicit low, normal, high and urgent instruction to avoid defaulting everything to urgent.
Does this replace my existing Zendesk email connector?
No. It creates tickets through the API alongside however tickets already reach Zendesk. Nothing about your current setup changes.
The bot replies but the tool never runs
The tool node is not linked to its workflow. Open it and select the workflow you created from the tool section. A bare placeholder ID means it is still unlinked.
My conversations reset when n8n restarts
Memory is an in-memory buffer so the template works as soon as you import it. A restart or redeploy drops conversations in progress. Before a busy launch, swap Conversation memory for Postgres Chat Memory. Nothing else changes.
Take it further
knowledge is a flat text field, as in the other chatbot recipes. If your help content outgrows a pasted block, the Supabase knowledge base chatbot shows the swap to a vector store, and the same swap works here.