Detect Intent
Detecta la intención del usuario en un texto de entrada y extrae los parámetros relevantes para el enrutamiento posterior.
Detecta la intención del usuario en text frente a un catálogo de intenciones (en línea y/o de un recurso de conocimiento) y enruta a detected o unknown, con los parámetros extraídos.
Este operador clasifica el texto de entrada frente a un catálogo de intenciones configurable y produce una intención principal, una puntuación de confianza, los parámetros extraídos e indicaciones de enrutamiento para la orquestación del workflow.
Operaciones
- Detección de intención: Compara el texto con un catálogo de intenciones con nombre, descripción y ejemplos.
- Extracción de parámetros: Extrae los parámetros clave-valor (slots) relevantes para la intención detectada.
- Enrutamiento: Ofrece indicaciones de enrutamiento para orientar las bifurcaciones posteriores del workflow.
Casos de uso
- Enrutar mensajes de un chatbot según la intención del usuario (p. ej., "book_appointment", "check_status", "complaint").
- Triaje de correos y categorización automática según su propósito.
- Clasificación de las entradas del Command Center para la ejecución explícita frente a la asistida por inferencia.
- Enrutamiento de recepción multicanal con escalamiento a revisión humana según la confianza.
Cómo funciona
- Combina el payload anterior con la configuración del nodo (gana la configuración) y lee
text,contextychannel; lanzaMissing 'text'sitextestá vacío. - Reúne intenciones de
intents(cada elemento necesitaname) y añade las decontent.structured_data.intentsdelknowledge_resource_idcuyo nombre no esté ya (sin distinguir mayúsculas). Falla si no queda ninguna. - Envía un prompt de sistema de clasificador con el catálogo, el umbral y un formato JSON estricto; el mensaje de usuario une
Channel:,Context:ytext;temperature: 0. - Interpreta la respuesta como JSON.
primary_intentse empareja sin distinguir mayúsculas con el catálogo; cualquier otro valor pasa aunknown. Cada intención del catálogo ausente enall_intentsse añade con confianza 0. needs_reviewes el valor del modelo o, si falta,confidence < confidence_threshold. Sale pordetectedsalvo que la intención seaunknown.
En un workflow
El nodo tal como aparece en un archivo de workflow (draft_nodes[]) y el envelope de una ejecución exitosa.
{
"node_id": "node-detect-intent",
"label": "Detect intent",
"operator_slug": "ai.intent",
"operator_version": "1.0.0",
"config": {
"text": "{{ $json.message }}",
"channel": "chat",
"intents": [
{
"name": "track_order",
"description": "The user wants to know where an order is",
"examples": "where is my order, tracking number"
},
{
"name": "cancel_order",
"description": "The user wants to cancel an order"
},
{
"name": "refund",
"description": "The user asks for money back"
}
],
"allow_multiple": false,
"confidence_threshold": 0.7,
"language": "en",
"llm_provider_id": "wf-llm-provider-xxxx",
"invocation_mode": "sync"
}
}{
"ok": true,
"data": {
"primary_intent": "track_order",
"confidence": 0.92,
"all_intents": [
{
"intent": "track_order",
"confidence": 0.92
},
{
"intent": "cancel_order",
"confidence": 0.05
},
{
"intent": "refund",
"confidence": 0.03
}
],
"parameters": {
"order_id": "4521"
},
"routing_hint": "order-status-flow",
"needs_review": false,
"raw": null,
"port": "detected"
},
"port": "detected"
}Configuración
-
llm_provider_idstring Opcional -
El `id` de un registro `LlmProviderModel` (p. ej. `wf-llm-provider-*`). El orquestador delega en el backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` en modo sync, o `POST /chat/conversation/execute/stream-ephemeral` (SSE) en modo stream. El backend resuelve endpoint + api-key + deployment a partir del registro y enruta al adaptador correspondiente.
-
invocation_modestring Opcional -
Transporte de la llamada al LLM. `sync` se bloquea hasta recibir la respuesta completa. `stream` consume los tokens mediante SSE (necesario para generaciones largas). Predeterminado: `sync`.
-
timeout_msinteger Opcional -
Tiempo máximo de espera para que termine la invocación (o tiempo máximo de inactividad entre fragmentos en modo stream). Predeterminado: 30000 en sync, 600000 en stream.
-
intentsarray<object> Opcional -
Define las intenciones que se detectan. Cada una necesita un nombre y una descripción.
-
allow_multipleboolean Opcional -
Permite detectar varias intenciones en una misma entrada.
-
confidence_thresholdnumber Opcional -
Marca la salida como needs_review cuando la confianza queda por debajo de este umbral.
-
knowledge_resource_idstring Opcional -
Carga el catálogo de intenciones desde un Knowledge Resource en lugar de la configuración en línea.
-
languagestring Opcional -
Código del idioma de salida (p. ej., "en", "es").
Su configuración muestra los ajustes de ejecución compartidos, pero este nodo aún no aplica reintentos (retryOnFail, maxTries). Ningún nodo aplica continueOnFail.
Comportamiento en el código
Lo que hace la implementación con estas claves más allá de lo que dice el esquema.
-
confidence_threshold - No cambia el puerto: una intención del catálogo con baja confianza sigue saliendo por
detected. Solo fijaneeds_reviewcuando el modelo no lo envía. -
text, context, channel - No está en el esquema de configuración (está en el contrato de entrada), pero se lee primero de la configuración y luego del payload anterior.
-
timeout_ms - Solo en modo stream: timeout de inactividad entre fragmentos, por defecto 600000. En modo sync no se aplica a la petición.
-
execution - Declarado pero ignorado: ni el worker ni el motor leen
retryOnFail,maxTries,waitBetweenTries,continueOnFail,alwaysOutputDatanitimeout_msde este bloque.
Puertos de salida
detected por defecto La intención principal pertenece al catálogo, sea cual sea su confianza. Revisa needs_review para la baja confianza.
{
"primary_intent": "track_order",
"confidence": 0.92,
"all_intents": [
{
"intent": "track_order",
"confidence": 0.92
},
{
"intent": "cancel_order",
"confidence": 0.05
},
{
"intent": "refund",
"confidence": 0.03
}
],
"parameters": {
"order_id": "4521"
},
"routing_hint": "order-status-flow",
"needs_review": false,
"raw": null,
"port": "detected"
}unknown El modelo respondió unknown, ninguna intención o un nombre fuera del catálogo.
{
"primary_intent": "unknown",
"confidence": 0.2,
"all_intents": [
{
"intent": "track_order",
"confidence": 0.1
},
{
"intent": "cancel_order",
"confidence": 0.05
},
{
"intent": "refund",
"confidence": 0.05
}
],
"parameters": {},
"routing_hint": null,
"needs_review": true,
"raw": null,
"port": "unknown"
}error Falta text o el catálogo, falló la llamada al modelo o la respuesta no era JSON.
{
"error": "Model did not return valid JSON output"
}En expresiones
Lo que un nodo posterior puede leer de la salida de este nodo con $("Detect Intent").item.json.<ruta> (escribe la etiqueta de tu nodo en lugar de Detect Intent). Editor marca las rutas que sugiere el editor de workflows en Previous Nodes (el contrato de salida); Worker marca las rutas que el worker devuelve de verdad por detected, según la salida que muestra Puertos.
| Expresión | Editor | Worker |
|---|---|---|
$("Detect Intent").item.json.primary_intentEl nombre de la intención principal detectada o "unknown". | ||
$("Detect Intent").item.json.confidencePuntuación de confianza (0-1) de la intención principal. | ||
$("Detect Intent").item.json.all_intentsDistribución de probabilidad entre todas las intenciones del catálogo. | ||
$("Detect Intent").item.json.parametersParámetros clave-valor extraídos que son relevantes para la intención. | ||
$("Detect Intent").item.json.routing_hintSiguiente acción o destino de enrutamiento sugerido. | ||
$("Detect Intent").item.json.needs_reviewTrue cuando la confianza está por debajo del umbral. | ||
$("Detect Intent").item.json.parameters.order_id | — | |
$("Detect Intent").item.json.raw | — | |
$("Detect Intent").item.json.port | — |
— Worker: El worker la devuelve pero el editor no la sugiere: escríbela a mano. Las claves dentro de objetos pueden depender de tus datos o de la configuración (por ejemplo, una clave por etiqueta).
Errores
| Mensaje | Puerto | Causa y solución |
|---|---|---|
Missing 'text' | error | No hay text en la configuración ni en el payload anterior. |
No intents found. Provide intents in the config or link a Knowledge Resource with an intent catalog. | error | Ni intents ni el recurso aportan una intención con name. Si no hay intenciones en línea y la carga del recurso falla, se devuelve ese error de carga. |
Model did not return valid JSON output | error | La respuesta no se pudo interpretar como objeto JSON. |
[AiIntent] Missing 'llm_provider_id' in node config (LlmProviderModel.id, e.g. 'wf-llm-provider-*'). The legacy 'model_id' alias is no longer supported — update the node config to use 'llm_provider_id'. | error | llm_provider_id está vacío o no es un texto. Elige un registro de proveedor LLM con capacidad de chat. |
LLM Invocation Error: <backend message> | error | El backend rechazó la llamada: registro de proveedor inexistente o inactivo, error del proveedor, cuota o filtro de contenido. Revisa el registro de proveedor y los logs del backend. |
LLM Invocation Error: empty response from backend (<transport error>) | error | Modo sync: falló la llamada HTTP al backend (error de red, estado distinto de 2xx o timeout). Los prompts largos suelen agotar el timeout de la petición; cambia a invocation_mode: "stream". |
RemoteApiService.stream: idle timeout after <timeout_ms>ms | error | Modo stream: no llegó ningún fragmento dentro de timeout_ms. Si la petición de stream falla, el mensaje es RemoteApiService.stream: HTTP <status> — <body>. |
Contrato de entrada
-
textstring Obligatorio -
El texto de entrada cuya intención se analiza.
-
contextstring Opcional -
Contexto opcional de la conversación o la sesión.
-
channelstring Opcional -
Identificador opcional del canal (chat, email, api, etc.).
Contrato de salida
-
primary_intentstring Opcional -
El nombre de la intención principal detectada o "unknown".
-
confidencenumber Opcional -
Puntuación de confianza (0-1) de la intención principal.
-
all_intentsarray<object> Opcional -
Distribución de probabilidad entre todas las intenciones del catálogo.
-
parametersobject Opcional -
Parámetros clave-valor extraídos que son relevantes para la intención.
-
routing_hintstring Opcional -
Siguiente acción o destino de enrutamiento sugerido.
-
needs_reviewboolean Opcional -
True cuando la confianza está por debajo del umbral.
Contratos (JSON Schema)
La definición exactamente como la declara el orquestador. All es el *.definition.js completo; compáralo con las secciones de arriba para ver diferencias entre la documentación y el esquema. Úsala para validar un nodo antes de publicar.
{
"slug": "ai.intent",
"name": "Detect Intent",
"category": "ai",
"version": "1.0.0",
"description": "Detects user intent from text input and extracts relevant parameters for downstream routing.\n\nThis operator classifies input text against a configurable intent catalog, producing a primary intent, confidence score, extracted parameters, and routing hints for workflow orchestration.\n\n**Operations**\n- **Intent Detection:** Matches text against a catalog of named intents with descriptions and examples.\n- **Parameter Extraction:** Extracts key-value slot parameters relevant to the detected intent.\n- **Routing:** Provides routing hints to guide downstream workflow branching.\n\n**Use Cases**\n- Chatbot message routing based on user intent (e.g., \"book_appointment\", \"check_status\", \"complaint\").\n- Email triage and automatic categorization by purpose.\n- Command Center input classification for explicit vs. inference-assisted execution.\n- Multi-channel intake routing with confidence-based human review escalation.",
"capabilities": [
"ai",
"nlp",
"intent",
"classification",
"routing"
],
"knowledge_binding": {
"enabled": true,
"resource_types": [
"intent_catalog"
],
"field": "knowledge_resource_id",
"label": "Intent Catalog"
},
"config_schema": {
"type": "object",
"properties": {
"llm_provider_id": {
"type": "string",
"title": "LLM Provider",
"description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
"x-ui-widget": "llm-provider-picker",
"x-llm-provider-capabilities": [
"chat"
]
},
"invocation_mode": {
"type": "string",
"title": "Invocation Mode",
"description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
"enum": [
"sync",
"stream"
],
"default": "sync"
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"intents": {
"type": "array",
"title": "Intent Catalog",
"description": "Define the intents to detect. Each needs a name and description.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Intent Name"
},
"description": {
"type": "string",
"title": "Description"
},
"examples": {
"type": "string",
"title": "Example Phrases"
}
},
"required": [
"name",
"description"
]
},
"default": []
},
"allow_multiple": {
"type": "boolean",
"title": "Allow Multiple Intents",
"description": "Allow detecting multiple intents in a single input.",
"default": false
},
"confidence_threshold": {
"type": "number",
"title": "Confidence Threshold",
"description": "Flag as needs_review when confidence falls below this threshold.",
"default": 0.7,
"minimum": 0,
"maximum": 1
},
"knowledge_resource_id": {
"type": "string",
"title": "Intent Catalog (Knowledge Resource)",
"description": "Load intent catalog from a Knowledge Resource instead of inline config.",
"ui_widget": "knowledge_resource_picker"
},
"language": {
"type": "string",
"title": "Language",
"description": "Output language code (e.g., \"en\", \"es\").",
"default": "en"
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text input to analyze for intent."
},
"context": {
"type": "string",
"description": "Optional conversation or session context."
},
"channel": {
"type": "string",
"description": "Optional channel identifier (chat, email, api, etc.)."
}
},
"required": [
"text"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"primary_intent": {
"type": "string",
"description": "The detected primary intent name or \"unknown\"."
},
"confidence": {
"type": "number",
"description": "Confidence score (0-1) for the primary intent."
},
"all_intents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"intent": {
"type": "string"
},
"confidence": {
"type": "number"
}
}
},
"description": "Probability distribution across all catalog intents."
},
"parameters": {
"type": "object",
"description": "Extracted key-value parameters relevant to the intent."
},
"routing_hint": {
"type": "string",
"description": "Suggested next action or routing target."
},
"needs_review": {
"type": "boolean",
"description": "True when confidence is below the threshold."
}
}
},
"ports": [
{
"port_id": "detected",
"label": "Detected",
"is_default": true
},
{
"port_id": "unknown",
"label": "Unknown"
},
{
"port_id": "error",
"label": "Error"
}
],
"execution_mode": "async",
"tags": [
"ai",
"nlp",
"intent",
"routing",
"classification"
],
"is_stateful": false,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"llm_provider_id": {
"type": "string",
"title": "LLM Provider",
"description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
"x-ui-widget": "llm-provider-picker",
"x-llm-provider-capabilities": [
"chat"
]
},
"invocation_mode": {
"type": "string",
"title": "Invocation Mode",
"description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
"enum": [
"sync",
"stream"
],
"default": "sync"
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"intents": {
"type": "array",
"title": "Intent Catalog",
"description": "Define the intents to detect. Each needs a name and description.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Intent Name"
},
"description": {
"type": "string",
"title": "Description"
},
"examples": {
"type": "string",
"title": "Example Phrases"
}
},
"required": [
"name",
"description"
]
},
"default": []
},
"allow_multiple": {
"type": "boolean",
"title": "Allow Multiple Intents",
"description": "Allow detecting multiple intents in a single input.",
"default": false
},
"confidence_threshold": {
"type": "number",
"title": "Confidence Threshold",
"description": "Flag as needs_review when confidence falls below this threshold.",
"default": 0.7,
"minimum": 0,
"maximum": 1
},
"knowledge_resource_id": {
"type": "string",
"title": "Intent Catalog (Knowledge Resource)",
"description": "Load intent catalog from a Knowledge Resource instead of inline config.",
"ui_widget": "knowledge_resource_picker"
},
"language": {
"type": "string",
"title": "Language",
"description": "Output language code (e.g., \"en\", \"es\").",
"default": "en"
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The text input to analyze for intent."
},
"context": {
"type": "string",
"description": "Optional conversation or session context."
},
"channel": {
"type": "string",
"description": "Optional channel identifier (chat, email, api, etc.)."
}
},
"required": [
"text"
]
}{
"type": "object",
"properties": {
"primary_intent": {
"type": "string",
"description": "The detected primary intent name or \"unknown\"."
},
"confidence": {
"type": "number",
"description": "Confidence score (0-1) for the primary intent."
},
"all_intents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"intent": {
"type": "string"
},
"confidence": {
"type": "number"
}
}
},
"description": "Probability distribution across all catalog intents."
},
"parameters": {
"type": "object",
"description": "Extracted key-value parameters relevant to the intent."
},
"routing_hint": {
"type": "string",
"description": "Suggested next action or routing target."
},
"needs_review": {
"type": "boolean",
"description": "True when confidence is below the threshold."
}
}
}[
{
"port_id": "detected",
"label": "Detected",
"is_default": true
},
{
"port_id": "unknown",
"label": "Unknown"
},
{
"port_id": "error",
"label": "Error"
}
]Ejecución
- Ejecución
async- Con estado
- No
- Reintentos (
retryOnFail) - No
- Capacidades
ainlpintentclassificationrouting- Etiquetas
ainlpintentroutingclassification
Notas y límites
- Se pide
reasoningal modelo, pero no se devuelve.parametersse pasa tal cual desde el modelo como objeto. - El worker devuelve sus campos en el primer nivel en lugar de dentro de
data, así que el motor guarda todo el valor devuelto como salida del nodo:portyrawaparecen en$jsonjunto a los campos del resultado. rawes la respuesta cruda del proveedor en modo sync ynullen modo stream.- La llamada al modelo pasa por el backend de Sommatic AI, que resuelve el registro de proveedor indicado en
llm_provider_id(endpoint, credenciales, despliegue); el orquestador nunca guarda llaves del proveedor.invocation_mode: "sync"(por defecto) espera la respuesta completa;"stream"la lee como eventos SSE y une los fragmentos. timeout_mssolo tiene efecto en modo stream, como tiempo máximo de inactividad entre fragmentos (por defecto 600000). En modo sync el valor se registra en el log, pero no se aplica a la petición HTTP, así que rige el timeout por defecto de la plataforma.- En modo stream el endpoint del backend no aplica los parámetros de muestreo, así que la
temperature: 0fija solo tiene efecto en modo sync. - El recurso de conocimiento se lee del backend en cada ejecución (timeout de 10 s). Un recurso cuyo estado no es
activese usa igual, con una advertencia en el log. - Sin reintentos automáticos: el motor no aplica
execution.retryOnFail,maxTriesniwaitBetweenTriesen este nodo; una llamada fallida sale directamente porerror.
Revisado contra el código del orquestador · 31e874b · 2026-11-26