Open File/URL
用系统默认应用打开文件或 URL。
在运行 worker 的机器上,使用默认应用或指定应用打开 URL 或文件。
工作原理
- 解析配置。
target和app缺失时回退到输入 payload 中的同名键。 target为空时从error失败输出。- 使用系统默认处理程序或
app指定的应用打开target。 - 打开命令启动后,从
out返回{ opened: <target> }。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-open-report",
"label": "Open report",
"operator_slug": "io.desktop.open",
"operator_version": "1.0.0",
"config": {
"target": "https://app.example.com/reports/{{ $json.period }}"
}
}{
"ok": true,
"data": {
"opened": "https://app.example.com/reports/2026-11"
},
"port": "out"
}配置
-
targetstring 必填 -
URL 或文件路径
-
appstring 可选 -
可选,指定应用名称
输出端口
out 默认 已为 target 启动打开命令。
数据
{
"opened": "https://app.example.com/reports/2026-11"
}error 缺少 target,或无法启动打开命令。
数据
{
"error": "target is required"
}在表达式中
后续节点可通过 $("Open File/URL").item.json.<路径> 读取此节点输出中的内容(请把 Open File/URL 换成你的节点标签)。Editor 标记工作流编辑器在 Previous Nodes 中提示的路径(输出契约);Worker 标记 worker 实际通过 out 返回的路径,依据“端口”一节所示的输出。
| 表达式 | Editor | Worker |
|---|---|---|
$("Open File/URL").item.json.opened目标已打开 |
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
target is required | error | 配置和输入 payload 中都没有 target。请设置 URL 或文件的绝对路径。 |
<open command error message> | error | 主机无法启动处理程序或 app 指定的应用。请确认该应用存在于该机器上。 |
输入契约
-
targetstring 必填 -
appstring 可选
输出契约
-
openedstring 可选 -
目标已打开
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "io.desktop.open",
"name": "Open File/URL",
"category": "io",
"version": "1.0.0",
"description": "Open a file or URL in default system application.",
"capabilities": [
"desktop",
"open",
"launch"
],
"config_schema": {
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "URL or File Path"
},
"app": {
"type": "string",
"description": "Optional specific app name"
}
},
"required": [
"target"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"target": {
"type": "string"
},
"app": {
"type": "string"
}
},
"required": [
"target"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"opened": {
"type": "string",
"description": "Target opened"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Opened",
"description": "Target opened successfully",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Failed to open target",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"desktop-agent"
],
"tags": [
"desktop",
"utility"
],
"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": {
"target": {
"type": "string",
"description": "URL or File Path"
},
"app": {
"type": "string",
"description": "Optional specific app name"
}
},
"required": [
"target"
]
}{
"type": "object",
"properties": {
"target": {
"type": "string"
},
"app": {
"type": "string"
}
},
"required": [
"target"
]
}{
"type": "object",
"properties": {
"opened": {
"type": "string",
"description": "Target opened"
}
}
}[
{
"port_id": "out",
"label": "Opened",
"description": "Target opened successfully",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Failed to open target",
"is_default": false,
"supports_condition": false
}
]执行
- 执行方式
async- 有状态
- 否
- 能力
desktopopenlaunch- 标签
desktoputility
说明与限制
out仅表示已启动打开命令,并不代表应用已完成加载目标。根据平台处理程序的不同,不存在的文件路径也可能到达out。- 目标在运行编排器 worker 的主机上打开,而不是在用户设备上。
已对照编排器代码核实 · 31e874b · 2026-11-26