Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

n8n: An AI Call and Ticket Router That Returns Strict JSON (Category, Urgency, Summary) and a Switch Node That Acts on It

说明与用途

该配方帮助小型办公室使用 AI 对来电和工单进行分类(类别、紧急程度和摘要),并通过 n8n 将其自动路由到正确的团队。

问题

Incoming calls or tickets often land with the wrong person, causing repeated customer explanations and delayed responses.

结果

The recipe enables a small office to automatically route calls or tickets to the correct team based on AI-generated categories, urgency, and summary, reducing manual forwarding and improving response times.

工作流

  • 1. Define a JSON schema with required properties and strict validation.
  • 2. Test the schema and prompt with a curl call to OpenAI’s chat completions API.
  • 3. In n8n, add an HTTP Request node after the trigger to call the OpenAI API with the JSON body.
  • 4. Parse the JSON response and use a Switch node on the "category" field to route to the appropriate team or person.
  • 5. Handle the "other" fallback when the model is uncertain.
  • 6. Optionally, forward the summary and caller details to the chosen recipient.

证据

The answer comes back as a JSON string in choices[0].message.content.

来源

The enum on category is what makes the Switch node reliable later.

来源

  • 记录日期: 2026-10-23T16:11:38.216Z