Triage Classifier
基于策略驱动的决策规则执行分层受理分诊。
借助模型把一条进件归入分类资源中的一个类别和子类别,再规范化回答:概率、置信度、路由提示、分类门控以及 needs_review 标记。对模型的暂时性故障会重试。
该算子将文本归入类别 + 子类别体系,给出置信度以及跨类别的完整概率分布,生成路由提示,并同时返回适合审计和人工复核的简要说明与更详细的理由。
典型适用场景
- 政府/法律受理分诊(PQRS、tutela、hábeas corpus 等)
- 带策略规则的企业事件路由
- 具有可追溯依据的多级分类体系归类
工作原理
- 合并上游载荷与节点配置(以配置为准)。从
knowledge_resource_id(content.structured_data.categories)加载类别;未设置时回退到内联的taxonomy.categories。 - 构建输入:若
text为非空字符串则直接使用;否则用channel、sender、subject和body(或body.data.email.body)拼出Channel:、Sender:、Subject:、Body:各行。 - 发送系统提示词,包含每个类别、其定义及展平后的子类别树,以及
general_considerations、decision_rules和routing_hints_catalog,要求严格 JSON,temperature: 0。 - 调用模型,遇到 HTTP 5xx、429 及无状态码的错误时进行有限次数重试(指数退避加随机抖动)。
- 将回答解析为 JSON(去除代码块标记,失败时截取第一个
{到最后一个})。category与分类做不区分大小写的匹配(未知名称原样保留),subcategory仅在属于该类别时保留。 - 应用分类门控:类别或子类别可声明
gate.requires_any_regex/gate.forbids_any_regex(不区分大小写)。门控失败会清空子类别(除非on_fail.null_subcategory: false),可按on_fail.set_category/set_subcategory改写,并记入gate_failed,同时强制needs_review: true。 - 缺失的概率补 0 并归一化使总和为 1,
confidence取所选类别的概率,只保留目录中的路由提示,然后从success输出。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-triage-intake",
"label": "Triage intake",
"operator_slug": "ai.classify.triage",
"operator_version": "1.0.0",
"config": {
"knowledge_resource_id": "<knowledge_resource_id>",
"subject": "{{ $json.subject }}",
"body": "{{ $json.body }}",
"sender": "{{ $json.from }}",
"channel": "email",
"general_considerations": [
"Prefer the most specific category."
],
"decision_rules": [
"Refund requests are Billing, even when they mention a product."
],
"routing_hints_catalog": [
"finance-queue",
"support-queue"
],
"confidence_threshold": 0.7,
"language": "en",
"llm_provider_id": "wf-llm-provider-xxxx",
"invocation_mode": "sync",
"llm_retry_max_attempts": 3
}
}{
"ok": true,
"data": {
"category": "Billing",
"subcategory": "Refund",
"confidence": 0.82,
"probabilities": {
"Billing": 0.82,
"Technical": 0.12,
"Sales": 0.06
},
"routing_hints": [
"finance-queue"
],
"notes": "Explicit refund request with an order number.",
"justification": "The sender asks to reverse a charge on a paid order. Billing is more specific than Sales because no new purchase is discussed.",
"needs_review": false,
"gate_failed": [],
"raw": null,
"port": "success"
},
"port": "success"
}配置
-
knowledge_resource_idstring 必填 -
包含分诊所用类别和子类别的知识资源(类型:taxonomy)。
-
general_considerationsarray<string> 可选 -
分诊时应始终考虑的高层规则。
-
decision_rulesarray<string> 可选 -
显式的决策/路由规则(具体性、优先级、例外情况)。
-
routing_hints_catalogarray<string> 可选 -
模型可以建议的路由提示白名单(可选)。
-
confidence_thresholdnumber 可选 -
置信度低于此阈值时,输出会被标记为 needs_review。
-
languagestring 可选 -
说明/理由及解读所使用的语言。示例:“es”“en”。
-
llm_provider_idstring 可选 -
`LlmProviderModel` 记录的 `id`(例如 `wf-llm-provider-*`)。编排器将调用委托给后端:sync 模式调用 `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke`,stream 模式调用 `POST /chat/conversation/execute/stream-ephemeral`(SSE)。后端根据该记录解析 endpoint + api-key + deployment,并路由到相应的适配器(Azure OpenAI、Azure Foundry、OpenAI、AWS Bedrock、Google Vertex、Link Loom Cloud、Generic)。在 webapp 的 `/cognitive-assets/llm-provider/*` 中管理。
-
invocation_modestring 可选 -
LLM 调用的传输方式。`sync` 发起一个短 HTTP 请求并阻塞直到收到完整响应(适合快速推理:分类、短文本生成)。`stream` 在 token 到达时通过 SSE 逐步接收(长文本生成或输出可能超出 HTTP 超时时必须使用)。默认为 `sync`。
-
timeout_msinteger 可选 -
等待调用完成的最长时间(stream 模式下为分块之间的空闲超时)。sync 默认 30000,stream 默认 600000。
-
llm_retry_max_attemptsinteger 可选 -
LLM 调用遇到瞬时故障(HTTP 5xx、429、网络/超时)时的总尝试次数。设为 1 即禁用重试。未设置时依次回退到 execution.maxTries 和 3。硬上限为 5。
-
llm_retry_backoff_msinteger 可选 -
LLM 重试之间指数退避的基础延迟(等待时间 = base * 2^(attempt-1) + 抖动,上限为 llm_retry_max_wait_ms)。未设置时依次回退到 execution.waitBetweenTries 和 1500。
-
llm_retry_max_wait_msinteger 可选 -
LLM 重试之间单次退避等待的上限。硬上限为 30000。
支持通用执行设置:重试(retryOnFail、maxTries、waitBetweenTries)与超时。
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
llm_retry_max_attempts - 总尝试次数,硬上限 5。未设置时:
execution.retryOnFail为false则为 1,否则取execution.maxTries,再否则为 3。 -
llm_retry_backoff_ms - 基础等待时间,每次重试翻倍并加上最多 250 毫秒的随机抖动。未设置时使用
execution.waitBetweenTries,否则为 1500。 -
llm_retry_max_wait_ms - 单次等待上限,默认 20000,硬上限 30000。
-
execution - 与其他节点不同,这里会把
retryOnFail、maxTries和waitBetweenTries作为模型调用的备用重试策略。 -
taxonomy - 未声明。旧版内联分类
{ categories: [...] },仅在knowledge_resource_id为空时使用。 -
text, subject, body, sender, channel - 不在配置 schema 中,但会先从配置读取,再从上游载荷读取。
-
confidence_threshold - 仅在模型未给出
needs_review时使用:此时needs_review为confidence < confidence_threshold。模型给出的needs_review优先,但门控失败时总会强制为true。 -
timeout_ms - 仅限 stream 模式:片段之间的空闲超时,默认 600000。在 sync 模式下不会作用于请求。
输出端口
success 默认 模型返回了带类别的有效 JSON。needs_review 表示是否需要人工复核。
{
"category": "Billing",
"subcategory": "Refund",
"confidence": 0.82,
"probabilities": {
"Billing": 0.82,
"Technical": 0.12,
"Sales": 0.06
},
"routing_hints": [
"finance-queue"
],
"notes": "Explicit refund request with an order number.",
"justification": "The sender asks to reverse a charge on a paid order. Billing is more specific than Sales because no new purchase is discussed.",
"needs_review": false,
"gate_failed": [],
"raw": null,
"port": "success"
}error 缺少输入或分类、模型调用在重试后仍失败,或回答不是可用的 JSON。
{
"error": "Model did not return valid JSON output"
}在表达式中
后续节点可通过 $("Triage Classifier").item.json.<路径> 读取此节点输出中的内容(请把 Triage Classifier 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 success 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("Triage Classifier").item.json.category选定的主类别。 | ||
$("Triage Classifier").item.json.subcategory适用时为选定的子类别,否则为 null。 | ||
$("Triage Classifier").item.json.confidence所选类别的置信度得分(0-1)。 | ||
$("Triage Classifier").item.json.probabilities各类别的概率分布。各值之和应约等于 1。 | ||
$("Triage Classifier").item.json.routing_hints用于引导下游工作流的建议路由目标/提示。 | ||
$("Triage Classifier").item.json.notes简洁的 1-2 行说明,引用关键信号和规则。 | ||
$("Triage Classifier").item.json.justification较详细的理由,说明推理过程和规则优先级。 | ||
$("Triage Classifier").item.json.needs_review当置信度低于 confidence_threshold、输出校验较弱,或分类体系层级关卡未通过时为 true。 | ||
$("Triage Classifier").item.json.gate_failed输入未满足的层级关卡。分类体系中的类别或子类别可以声明 gate({ requires_any_regex, forbids_any_regex, on_fail });输入文本不满足时,所选子类别会被置空并强制 needs_review。没有关卡失败时为空数组。 | ||
$("Triage Classifier").item.json.raw供应商的原始响应,用于审计/调试(可选)。 | ||
$("Triage Classifier").item.json.probabilities.Billing | — | |
$("Triage Classifier").item.json.probabilities.Technical | — | |
$("Triage Classifier").item.json.probabilities.Sales | — | |
$("Triage Classifier").item.json.port | — |
— Worker: worker 会返回它,但编辑器不会提示:请手动输入。对象内部的键可能取决于你的数据或配置(例如每个标签一个键)。
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
Missing input content (text/subject/body) | error | text、channel、sender、subject、body 均无内容。 |
No categories found for triage classification. Ensure the linked knowledge resource contains at least one category. | error | 分类资源中没有 structured_data.categories。 |
Model did not return valid JSON output | error | 回答无法解析为 JSON 对象。Missing 'category' in output 表示 JSON 中没有类别。 |
Knowledge resource not found: <knowledge_resource_id> | error | 该 id 不对应任何知识资源。已删除的资源会报 Knowledge resource "<name>" has been deleted. Update the node config to reference an active resource. |
[TriageClassifier] 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 为空或不是字符串。请选择具备 chat 能力的 LLM 提供方记录。 |
LLM Invocation Error: <backend message> | error | 后端拒绝了调用:提供方记录不存在或未激活、提供方报错、配额或内容过滤。请检查提供方记录和后端日志。 |
LLM Invocation Error: empty response from backend (<transport error>) | error | sync 模式:对后端的 HTTP 调用失败(网络错误、非 2xx 状态或超时)。长提示词常会触发请求超时,请改用 invocation_mode: "stream"。 |
RemoteApiService.stream: idle timeout after <timeout_ms>ms | error | stream 模式:在 timeout_ms 内未收到任何片段。若流式请求本身失败,消息为 RemoteApiService.stream: HTTP <status> — <body>。 |
输入契约
-
textstring 可选 -
要分类的主要文本内容。
-
subjectstring 可选 -
可选的主题行(邮件/表单)。
-
bodystring 可选 -
可选的正文内容。
-
senderstring 可选 -
可选的发送方(邮箱/域名/标识符)。
-
channelstring 可选 -
可选的渠道标识(email、form、api 等)。
-
metadataobject 可选 -
可选的任意元数据(请求头、标签等)。
输出契约
-
categorystring 必填 -
选定的主类别。
-
subcategorystring | null 必填 -
适用时为选定的子类别,否则为 null。
-
confidencenumber 必填 -
所选类别的置信度得分(0-1)。
-
probabilitiesobject 必填 -
各类别的概率分布。各值之和应约等于 1。
-
routing_hintsarray<string> 可选 -
用于引导下游工作流的建议路由目标/提示。
-
notesstring 可选 -
简洁的 1-2 行说明,引用关键信号和规则。
-
justificationstring 可选 -
较详细的理由,说明推理过程和规则优先级。
-
needs_reviewboolean 可选 -
当置信度低于 confidence_threshold、输出校验较弱,或分类体系层级关卡未通过时为 true。
-
gate_failedarray<object> 可选 -
输入未满足的层级关卡。分类体系中的类别或子类别可以声明 `gate`({ requires_any_regex, forbids_any_regex, on_fail });输入文本不满足时,所选子类别会被置空并强制 needs_review。没有关卡失败时为空数组。
-
rawobject 可选 -
供应商的原始响应,用于审计/调试(可选)。
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "ai.classify.triage",
"name": "Triage Classifier",
"category": "ai",
"version": "1.0.0",
"description": "Performs hierarchical intake triage with policy-driven decision rules.\n\nThis operator classifies text into a **category + subcategory** taxonomy, produces **confidence** and a full **probability distribution** across categories, generates **routing hints**, and returns both **notes** and a longer **justification** suitable for audits and human review.\n\n**Typical use cases**\n- Government / legal intake triage (PQRS, tutela, hábeas corpus, etc.)\n- Enterprise incident routing with policy rules\n- Multi-level taxonomy classification with traceable rationale",
"capabilities": [
"ai",
"classification",
"nlp",
"taxonomy",
"triage",
"routing",
"explainability"
],
"knowledge_binding": {
"enabled": true,
"resource_types": [
"taxonomy"
],
"field": "knowledge_resource_id",
"label": "Classification Taxonomy"
},
"config_schema": {
"type": "object",
"required": [
"knowledge_resource_id"
],
"properties": {
"knowledge_resource_id": {
"type": "string",
"title": "Classification Taxonomy",
"description": "Knowledge resource (type: taxonomy) containing the categories and subcategories for triage.",
"x-ui-widget": "knowledge-resource-picker",
"x-knowledge-resource-types": [
"taxonomy"
]
},
"general_considerations": {
"type": "array",
"title": "General Considerations",
"description": "High-level rules that should always be considered during triage.",
"items": {
"type": "string"
},
"default": []
},
"decision_rules": {
"type": "array",
"title": "Decision Rules",
"description": "Explicit decision/routing rules (specificity, precedence, exceptions).",
"items": {
"type": "string"
},
"default": []
},
"routing_hints_catalog": {
"type": "array",
"title": "Routing Hints Catalog",
"description": "Allowed routing hints that the model may suggest (optional).",
"items": {
"type": "string"
},
"default": []
},
"confidence_threshold": {
"type": "number",
"title": "Confidence Threshold",
"description": "If confidence is below this threshold, the output will be flagged as needs_review.",
"default": 0.7,
"minimum": 0,
"maximum": 1
},
"language": {
"type": "string",
"title": "Language",
"description": "Language used for notes/justification and interpretation. Example: \"es\", \"en\".",
"default": "es"
},
"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 (Azure OpenAI, Azure Foundry, OpenAI, AWS Bedrock, Google Vertex, Link Loom Cloud, Generic). Managed in the webapp at `/cognitive-assets/llm-provider/*`.",
"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` opens a short HTTP request and blocks until the full response arrives (ideal for fast inferences: classification, short generation). `stream` consumes tokens via SSE as they arrive (required for long generations or outputs that would exceed the HTTP timeout). 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, in stream mode, the idle timeout between chunks). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"llm_retry_max_attempts": {
"type": "integer",
"title": "LLM Retry — Max Attempts",
"description": "Total attempts for the LLM call on transient failures (HTTP 5xx, 429, network/timeout). 1 disables retry. Falls back to execution.maxTries, then 3. Hard-capped at 5.",
"minimum": 1,
"maximum": 5,
"default": 3
},
"llm_retry_backoff_ms": {
"type": "integer",
"title": "LLM Retry — Base Backoff (ms)",
"description": "Base delay for exponential backoff between LLM retries (wait = base * 2^(attempt-1) + jitter, capped by llm_retry_max_wait_ms). Falls back to execution.waitBetweenTries, then 1500.",
"minimum": 0,
"default": 1500
},
"llm_retry_max_wait_ms": {
"type": "integer",
"title": "LLM Retry — Max Wait (ms)",
"description": "Ceiling for a single backoff wait between LLM retries. Hard-capped at 30000.",
"minimum": 0,
"default": 20000
},
"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",
"description": "Incoming content and optional metadata used for intake triage.",
"properties": {
"text": {
"type": "string",
"description": "Primary text content to classify."
},
"subject": {
"type": "string",
"description": "Optional subject line (email/form)."
},
"body": {
"type": "string",
"description": "Optional body content."
},
"sender": {
"type": "string",
"description": "Optional sender (email/domain/identifier)."
},
"channel": {
"type": "string",
"description": "Optional channel identifier (email, form, api, etc.)."
},
"metadata": {
"type": "object",
"description": "Optional arbitrary metadata (headers, tags, etc.).",
"additionalProperties": true
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"category": {
"type": "string",
"description": "Selected primary category."
},
"subcategory": {
"type": [
"string",
"null"
],
"description": "Selected subcategory when applicable, else null."
},
"confidence": {
"type": "number",
"description": "Confidence score (0-1) for the selected category."
},
"probabilities": {
"type": "object",
"description": "Probability distribution across categories. Values should sum approximately to 1.",
"additionalProperties": {
"type": "number"
}
},
"routing_hints": {
"type": "array",
"description": "Suggested routing targets / hints to guide downstream workflows.",
"items": {
"type": "string"
}
},
"notes": {
"type": "string",
"description": "Concise 1-2 line explanation referencing key signals and rules."
},
"justification": {
"type": "string",
"description": "Longer justification explaining reasoning and rule precedence."
},
"needs_review": {
"type": "boolean",
"description": "True when confidence is below confidence_threshold, output validation is weak, or a taxonomy hierarchy gate failed."
},
"gate_failed": {
"type": "array",
"description": "Hierarchy gates that the input did NOT satisfy. A category or subcategory in the taxonomy may declare a `gate` ({ requires_any_regex, forbids_any_regex, on_fail }); when the input text does not satisfy it, the chosen subcategory is nulled and needs_review is forced. Empty array when no gate failed.",
"items": {
"type": "object",
"properties": {
"level": {
"type": "string",
"description": "'category' | 'subcategory'"
},
"name": {
"type": "string"
},
"reason": {
"type": "string"
}
}
}
},
"raw": {
"type": "object",
"description": "Raw provider response for audit/debug (optional).",
"additionalProperties": true
}
},
"required": [
"category",
"subcategory",
"confidence",
"probabilities"
]
},
"ports": [
{
"port_id": "success",
"label": "Classified",
"is_default": true
},
{
"port_id": "error",
"label": "Error"
}
],
"execution_mode": "async",
"tags": [
"ai",
"classifier",
"triage",
"taxonomy",
"routing"
],
"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",
"required": [
"knowledge_resource_id"
],
"properties": {
"knowledge_resource_id": {
"type": "string",
"title": "Classification Taxonomy",
"description": "Knowledge resource (type: taxonomy) containing the categories and subcategories for triage.",
"x-ui-widget": "knowledge-resource-picker",
"x-knowledge-resource-types": [
"taxonomy"
]
},
"general_considerations": {
"type": "array",
"title": "General Considerations",
"description": "High-level rules that should always be considered during triage.",
"items": {
"type": "string"
},
"default": []
},
"decision_rules": {
"type": "array",
"title": "Decision Rules",
"description": "Explicit decision/routing rules (specificity, precedence, exceptions).",
"items": {
"type": "string"
},
"default": []
},
"routing_hints_catalog": {
"type": "array",
"title": "Routing Hints Catalog",
"description": "Allowed routing hints that the model may suggest (optional).",
"items": {
"type": "string"
},
"default": []
},
"confidence_threshold": {
"type": "number",
"title": "Confidence Threshold",
"description": "If confidence is below this threshold, the output will be flagged as needs_review.",
"default": 0.7,
"minimum": 0,
"maximum": 1
},
"language": {
"type": "string",
"title": "Language",
"description": "Language used for notes/justification and interpretation. Example: \"es\", \"en\".",
"default": "es"
},
"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 (Azure OpenAI, Azure Foundry, OpenAI, AWS Bedrock, Google Vertex, Link Loom Cloud, Generic). Managed in the webapp at `/cognitive-assets/llm-provider/*`.",
"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` opens a short HTTP request and blocks until the full response arrives (ideal for fast inferences: classification, short generation). `stream` consumes tokens via SSE as they arrive (required for long generations or outputs that would exceed the HTTP timeout). 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, in stream mode, the idle timeout between chunks). Default 30000 for sync, 600000 for stream.",
"minimum": 1000
},
"llm_retry_max_attempts": {
"type": "integer",
"title": "LLM Retry — Max Attempts",
"description": "Total attempts for the LLM call on transient failures (HTTP 5xx, 429, network/timeout). 1 disables retry. Falls back to execution.maxTries, then 3. Hard-capped at 5.",
"minimum": 1,
"maximum": 5,
"default": 3
},
"llm_retry_backoff_ms": {
"type": "integer",
"title": "LLM Retry — Base Backoff (ms)",
"description": "Base delay for exponential backoff between LLM retries (wait = base * 2^(attempt-1) + jitter, capped by llm_retry_max_wait_ms). Falls back to execution.waitBetweenTries, then 1500.",
"minimum": 0,
"default": 1500
},
"llm_retry_max_wait_ms": {
"type": "integer",
"title": "LLM Retry — Max Wait (ms)",
"description": "Ceiling for a single backoff wait between LLM retries. Hard-capped at 30000.",
"minimum": 0,
"default": 20000
},
"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",
"description": "Incoming content and optional metadata used for intake triage.",
"properties": {
"text": {
"type": "string",
"description": "Primary text content to classify."
},
"subject": {
"type": "string",
"description": "Optional subject line (email/form)."
},
"body": {
"type": "string",
"description": "Optional body content."
},
"sender": {
"type": "string",
"description": "Optional sender (email/domain/identifier)."
},
"channel": {
"type": "string",
"description": "Optional channel identifier (email, form, api, etc.)."
},
"metadata": {
"type": "object",
"description": "Optional arbitrary metadata (headers, tags, etc.).",
"additionalProperties": true
}
}
}{
"type": "object",
"properties": {
"category": {
"type": "string",
"description": "Selected primary category."
},
"subcategory": {
"type": [
"string",
"null"
],
"description": "Selected subcategory when applicable, else null."
},
"confidence": {
"type": "number",
"description": "Confidence score (0-1) for the selected category."
},
"probabilities": {
"type": "object",
"description": "Probability distribution across categories. Values should sum approximately to 1.",
"additionalProperties": {
"type": "number"
}
},
"routing_hints": {
"type": "array",
"description": "Suggested routing targets / hints to guide downstream workflows.",
"items": {
"type": "string"
}
},
"notes": {
"type": "string",
"description": "Concise 1-2 line explanation referencing key signals and rules."
},
"justification": {
"type": "string",
"description": "Longer justification explaining reasoning and rule precedence."
},
"needs_review": {
"type": "boolean",
"description": "True when confidence is below confidence_threshold, output validation is weak, or a taxonomy hierarchy gate failed."
},
"gate_failed": {
"type": "array",
"description": "Hierarchy gates that the input did NOT satisfy. A category or subcategory in the taxonomy may declare a `gate` ({ requires_any_regex, forbids_any_regex, on_fail }); when the input text does not satisfy it, the chosen subcategory is nulled and needs_review is forced. Empty array when no gate failed.",
"items": {
"type": "object",
"properties": {
"level": {
"type": "string",
"description": "'category' | 'subcategory'"
},
"name": {
"type": "string"
},
"reason": {
"type": "string"
}
}
}
},
"raw": {
"type": "object",
"description": "Raw provider response for audit/debug (optional).",
"additionalProperties": true
}
},
"required": [
"category",
"subcategory",
"confidence",
"probabilities"
]
}[
{
"port_id": "success",
"label": "Classified",
"is_default": true
},
{
"port_id": "error",
"label": "Error"
}
]执行
- 执行方式
async- 有状态
- 否
- 重试(
retryOnFail) - 是
- 能力
aiclassificationnlptaxonomytriageroutingexplainability- 标签
aiclassifiertriagetaxonomyrouting
说明与限制
- 缺少
llm_provider_id以及其他没有 HTTP 状态码的错误也会被重试,因此配置错误会耗尽所有尝试及等待后才失败。 gate_failed中每项为{ level, name, reason };reason是固定的西班牙语字符串,例如requires_any_regex: ninguno coincidió或forbids_any_regex coincidió: <pattern>。无效的正则会被忽略。language(默认es)只决定提示词中的语言说明行。- 该 worker 将字段直接放在返回值顶层而非
data内,因此引擎把整个返回值存为节点输出:port和raw会与结果字段一起出现在$json中。 - 模型调用经由 Sommatic AI 后端完成,后端根据
llm_provider_id指定的提供方记录解析端点、凭据和部署;编排器从不持有提供方密钥。invocation_mode: "sync"(默认)等待完整回答;"stream"以 SSE 事件读取回答并拼接各片段。 timeout_ms仅在 stream 模式下生效,表示片段之间允许的最长空闲时间(默认 600000)。在 sync 模式下该值只写入日志,不会作用于 HTTP 请求,因此以平台默认请求超时为准。- 在 stream 模式下,后端端点不应用采样参数,因此固定的
temperature: 0仅在 sync 模式下生效。 - 每次运行都会从后端读取知识资源(超时 10 秒)。状态不是
active的资源仍会被使用,并在日志中记录警告。
已对照编排器代码核实 · 31e874b · 2026-11-26