OS Notification
显示系统通知。
在运行 worker 的机器上显示操作系统原生通知,并返回通知程序的响应。
工作原理
- 解析配置。
title、message、icon和appName缺失时回退到输入 payload 中的同名键。 - 发送通知,使用
title(默认Alert)、message、icon,并以appName作为应用标识。 - 等待通知程序回调:成功时从
out输出{ response },失败时从error输出。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-notify-operator",
"label": "Notify operator",
"operator_slug": "io.desktop.notify",
"operator_version": "1.0.0",
"config": {
"title": "Batch finished",
"message": "{{ $json.processed }} documents processed",
"appName": "Sommatic Orchestrator"
}
}{
"ok": true,
"data": {
"response": "<notifier response>"
},
"port": "out"
}配置
-
titlestring 可选 -
messagestring 必填 -
iconstring 可选 -
图标路径
-
appNamestring 可选
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
appName - 代码不会应用 schema 默认值
Sommatic Orchestrator;为空时不发送应用标识。 -
message - 声明为必填,但 worker 不做校验;请始终设置。
输出端口
out 默认 通知程序已接受通知。response 为平台通知程序返回的值。
数据
{
"response": "<notifier response>"
}error 通知程序失败。error 为通知程序传回的错误对象;若调用抛出异常,则为错误消息。
数据
{
"error": "<notifier error>"
}在表达式中
后续节点可通过 $("OS Notification").item.json.<路径> 读取此节点输出中的内容(请把 OS Notification 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("OS Notification").item.json.response通知发送结果 |
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
<notifier error> | error | 主机没有可用的通知服务(例如无显示器的服务器)。请在有桌面会话的机器上运行该节点。 |
输入契约
-
titlestring 可选 -
messagestring 必填 -
iconstring 可选 -
appNamestring 可选
输出契约
-
responsestring 可选 -
通知发送结果
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "io.desktop.notify",
"name": "OS Notification",
"category": "io",
"version": "1.0.0",
"description": "Show system notification.",
"capabilities": [
"notification",
"desktop"
],
"config_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"message": {
"type": "string"
},
"icon": {
"type": "string",
"description": "Path to icon"
},
"appName": {
"type": "string",
"default": "Sommatic Orchestrator"
}
},
"required": [
"message"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"message": {
"type": "string"
},
"icon": {
"type": "string"
},
"appName": {
"type": "string"
}
},
"required": [
"message"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"response": {
"type": "string",
"description": "Notification dispatch result"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Shown",
"description": "Notification dispatched",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Notification failed",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"desktop-agent"
],
"tags": [
"desktop",
"notification"
],
"is_stateful": false,
"publisher": {
"identity": "org_link_loom",
"profile": {
"name": "Link Loom",
"verified": true,
"url": "https://me.veripass.com/link-loom",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"message": {
"type": "string"
},
"icon": {
"type": "string",
"description": "Path to icon"
},
"appName": {
"type": "string",
"default": "Sommatic Orchestrator"
}
},
"required": [
"message"
]
}{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"message": {
"type": "string"
},
"icon": {
"type": "string"
},
"appName": {
"type": "string"
}
},
"required": [
"message"
]
}{
"type": "object",
"properties": {
"response": {
"type": "string",
"description": "Notification dispatch result"
}
}
}[
{
"port_id": "out",
"label": "Shown",
"description": "Notification dispatched",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Notification failed",
"is_default": false,
"supports_condition": false
}
]执行
- 执行方式
async- 有状态
- 否
- 能力
notificationdesktop- 标签
desktopnotification
说明与限制
- 通知显示在运行编排器 worker 的主机上,而不是 Sommatic AI Web 客户端中。如需通知用户,请使用任务或消息类节点。
- 持久化时,通知程序返回的错误对象可能被序列化为空对象。
已对照编排器代码核实 · 31e874b · 2026-11-26