n8n Auto-Triage Chat Messages to ServiceNow Incidents, Requests, and AI Agent
Chat input → LLM triage → ServiceNow incident / catalog request / AI agent with search & memory → optional summary
- Who
- IT service desks or ops teams already using n8n and ServiceNow
- You get
- Automatically classify chat messages into Incident, Service Request, or Other; create ServiceNow incidents, submit service catalog requests via HTTP, or hand off to an AI agent with web search and memory; optionally summarize results
- You need
- n8n
Constraints
Prerequisites: accessible n8n instance; ServiceNow instance with an API user that has incident-create rights; OpenAI API key; optional SerpAPI key for web search. Costs depend on API call volume. Known limitations: the HTTP Request node uses the author's demo ServiceNow dev instance URL and a fixed catalog item sys_id; replace these in production. The AI Agent systemMessage says 'creates requests,' which does not fully align with the 'Everything Else' branch handling non-ticket queries; review and adjust for your use case.
What they did
Author yajna published an n8n template that wires a chat trigger to an LLM-based text classifier for three-way routing: the Incident branch uses the native ServiceNow node to create incident records; the Request branch POSTs to the ServiceNow Service Catalog API via HTTP; the Everything Else branch delegates to an AI Agent powered by an OpenAI chat model, SerpAPI web search, and Simple Memory. All three branches can feed into a Summarization Chain for final summary generation. The template includes 15 nodes with full connections, and the workflow JSON can be imported directly.
How it went
The author reports this template is suited for support desks seeking automated triage with human-quality context and searchable memory (author_report). The template shows as published on n8n with 928 views as of the fetch date. This site has not imported or run the workflow.
Worth knowing
1. The HTTP Request node hard-codes the author's demo ServiceNow dev instance URL (dev353652.service-now.com) and a fixed catalog item sys_id; the author notes via Sticky Note that this is 'For Demo Purpose' and must be replaced for production. 2. The AI Agent systemMessage reads 'You are a helpful assistant. Who creates requests based on the user query using the tool...' yet it sits on the 'Everything Else' branch meant for non-ticket queries; the prompt semantics do not fully match the branch purpose and should be rewritten for your scenario. 3. The source description recommends structured classifier outputs with confidence thresholds (e.g., route to human review if <0.7), but this is not hard-coded in the workflow JSON. 4. All OpenAI nodes in the workflow JSON are currently set to gpt-4.1-mini; the description references the GPT-4 family, and you may switch to gpt-4.1 or gpt-4 as needed. 5. Source prompts are complete and available; nothing is missing.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenAI Chat Model node: connect OpenAI API credentials.
- OpenAI Chat Model1 node: connect OpenAI API credentials.
- OpenAI Chat Model3 node: connect OpenAI API credentials.
- HTTP Request1 node: connect serviceNowBasicApi credentials.
- Create an incident node: connect serviceNowBasicApi credentials.
- SerpAPI node: connect serpApi credentials.
Configuration to replace
- Source template is n8n public workflow #7515 (~15 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Configure chat trigger and classifier model
Add a 'When chat message received' node as the workflow trigger. Add an 'OpenAI Chat Model' sub-node, select gpt-4.1-mini (or gpt-4.1 / gpt-4), and bind an openAiApi credential. This model powers the Text Classifier.
Set up the text classifier with three-way prompt
Add a 'Text Classifier' node and connect the OpenAI Chat Model from the previous step. Keep the default input '={{ $json.chatInput }}'. Configure three categories: Incident (breakage/complaint), Request (access provisioning/resource order), and Everything Else (knowledge search, etc.). Set the systemPromptTemplate to the source prompt.
Execution prompt · Source text。Text Classifier node options.systemPromptTemplate field
Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.Configure the ServiceNow incident creation branch
From the Text Classifier's Incident output, add a 'Create an incident' node (ServiceNow type) and bind a serviceNowBasicApi credential. Keep operation as create, resource as incident, and short_description as the default expression '={{ $('When chat message received').item.json.chatInput }}'. Connect this branch output to the Summarization Chain.
Configure the service catalog HTTP request branch
From the Text Classifier's Request output, add an 'HTTP Request' node. Set method to POST, authentication to predefinedCredentialType with serviceNowBasicApi, and add header Accept: application/json. Replace the URL with your actual ServiceNow service catalog order endpoint; the template's default URL is the author's demo address and must be changed. Use a body structure based on the source example.
Execution prompt · Editorial suggestion。HTTP Request node jsonBody field; editorial suggestion based on source example, replace with your actual catalog item endpoint
={ "sysparm_quantity": 1, "variables": { "description": "{{ $('When chat message received').item.json.chatInput }}" } }Configure the AI agent branch with search and memory
From the Text Classifier's Everything Else output, add an 'AI Agent' node. Connect 'OpenAI Chat Model1' (gpt-4.1-mini) as the language model, 'Simple Memory' as memory, and 'SerpAPI' as a tool. Set the AI Agent's systemMessage to the source prompt. Connect this branch output to the Summarization Chain as well.
Execution prompt · Source text。AI Agent node options.systemMessage field
You are a helpful assistant. Who creates requests based on the user query using the tool. Always create the request using the http tool attached to you
Add the optional summarization chain and final output
At the convergence point after all three branches, add a 'Summarization Chain' node and bind 'OpenAI Chat Model3' (gpt-4.1-mini). Set summarizationMethod to stuff and set the prompt to the source template. This node receives upstream outputs and generates a CONCISE SUMMARY.
Execution prompt · Source text。Summarization Chain node options.summarizationMethodAndPrompts.values.prompt field
=Write a user friendly summary of the following: Agent Action"{text}" User Query"{{ $('When chat message received').item.json.chatInput }}" CONCISE SUMMARY:
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant: confirm inputs and credentials first, then configure nodes step by step
This block is the prompt. Ads are never placed here.
You are setting up the n8n template 7515 for ServiceNow chat triage. Confirm the following before importing or building: 1) n8n instance access; 2) OpenAI API key (for classifier, AI Agent, summarization); 3) ServiceNow instance URL and an API user with incident_create rights; 4) optional SerpAPI key; 5) your actual service catalog item order URL (replace the template's demo address). After confirmation, import the workflow JSON or configure nodes step by step. Pay special attention to the Text Classifier's three categories, whether the AI Agent systemMessage fits your 'Everything Else' use case, and replacing the HTTP Request URL and body variables.
Check credentials before importing; review AI Agent prompt semantics for your use case; replace the HTTP URL with production endpoint
Source
AI-powered ServiceNow chat triage with GPT-4 — Incident & request router · yajna · n8n.io · 2025-08-17
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.