Execute Sommatic App
请求用户与指定的 Sommatic AI App 界面进行交互。
部分实现。请求后端创建应用交互,并返回引擎不会处理的挂起信号:运行既不等待应用,也不会沿 completed 或 timeout 继续。
工作原理
- 解析配置并合并到输入 payload 之上(配置优先)。
- 缺少
app_identifier时抛出异常:运行失败,除非被flow.try作用域捕获。 - 向后端 HITL 交互端点提交
{ type: "app_execution", app_identifier, configuration, assignee, expires_in_ms: timeout_ms };HTTP 失败会被重新抛出。 - 返回
{ __signal: "SUSPEND", __metadata: { type: "sommatic_app_interaction", id, resume_on: ["completed", "timeout"] } }。 - 信封没有端口,引擎将其路由到本节点未声明的
out:completed或timeout的连线永远不会被执行,分支结束,运行在不等待的情况下完成。
在工作流中
节点在工作流文件(draft_nodes[])中的写法,以及一次成功运行的 envelope。
{
"node_id": "node-open-intake",
"label": "Open intake app",
"operator_slug": "sommatic.app.execute",
"operator_version": "1.0.0",
"config": {
"app_identifier": "sommatic-structured-intake",
"assignee": "[email protected]",
"timeout_ms": 3600000,
"configuration": {
"case_id": "{{ $json.case_id }}"
}
}
}{
"ok": true,
"port": "out",
"__signal": "SUSPEND",
"__metadata": {
"type": "sommatic_app_interaction",
"id": "<interaction_id>",
"resume_on": [
"completed",
"timeout"
]
}
}配置
-
app_identifierstring 必填 -
前端应用/微前端的 slug 或 ID
-
assigneestring 可选 -
timeout_msinteger 可选 -
configurationobject 可选 -
传给 UI 应用的 props 或上下文
配置中会显示通用执行设置,但该节点目前不执行重试(retryOnFail、maxTries)。所有节点均未实现 continueOnFail。
代码中的行为
除 schema 描述之外,实现代码对这些键的实际处理。
-
timeout_ms - 仅作为
expires_in_ms发送给后端;编排器不会强制执行。
输出端口
completed 默认 从不触发。
timeout 从不触发。
error 从不触发:失败会以异常抛出并导致运行失败。
在表达式中
后续节点可通过 $("Execute Sommatic App").item.json.<路径> 读取此节点输出中的内容,即工作流编辑器在 Previous Nodes 中提示的路径(输出契约)。
| 表达式 |
|---|
$("Execute Sommatic App").item.json.result |
$("Execute Sommatic App").item.json.status |
错误
| 消息 | 端口 | 原因与处理 |
|---|---|---|
Missing 'app_identifier' | error | 以异常抛出。运行失败并报 Node <node_id> (sommatic.app.execute) failed: Missing 'app_identifier',或进入外层 flow.try 的 catch 节点。 |
Request failed with status code <status> | error | 后端拒绝交互请求时抛出;效果同上。 |
输入契约
-
app_identifierstring 可选 -
assigneestring 可选 -
timeout_msinteger 可选 -
configurationobject 可选
输出契约
-
resultobject 可选 -
statusstring 可选
契约(JSON Schema)
与编排器声明完全一致的定义。All 是完整的 *.definition.js;可与上方各节对照,找出文档与 schema 之间的差异。发布前可用它校验节点。
{
"slug": "sommatic.app.execute",
"name": "Execute Sommatic App",
"category": "hitl",
"version": "1.0.0",
"description": "Requests a user to interact with a specific Sommatic AI App UI.",
"capabilities": [
"ui",
"interactive",
"human"
],
"config_schema": {
"type": "object",
"required": [
"app_identifier"
],
"properties": {
"app_identifier": {
"type": "string",
"title": "App Identifier",
"description": "Slug or ID of the frontend app/micro-frontend"
},
"assignee": {
"type": "string",
"title": "Assignee",
"ui_widget": "user_picker"
},
"timeout_ms": {
"type": "integer",
"default": 3600000
},
"configuration": {
"type": "object",
"title": "App Configuration",
"description": "Props or context passed to the UI app"
},
"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": {
"app_identifier": {
"type": "string"
},
"assignee": {
"type": "string"
},
"timeout_ms": {
"type": "integer"
},
"configuration": {
"type": "object"
}
}
},
"output_contract_schema": {
"type": "object",
"properties": {
"result": {
"type": "object"
},
"status": {
"type": "string"
}
}
},
"ports": [
{
"port_id": "completed",
"label": "Completed",
"is_default": true,
"description": "Interaction completed"
},
{
"port_id": "timeout",
"label": "Timeout",
"description": "Interaction expired"
},
{
"port_id": "error",
"label": "Error"
}
],
"execution_mode": "async",
"tags": [
"ui",
"interactive"
],
"is_stateful": true,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"required": [
"app_identifier"
],
"properties": {
"app_identifier": {
"type": "string",
"title": "App Identifier",
"description": "Slug or ID of the frontend app/micro-frontend"
},
"assignee": {
"type": "string",
"title": "Assignee",
"ui_widget": "user_picker"
},
"timeout_ms": {
"type": "integer",
"default": 3600000
},
"configuration": {
"type": "object",
"title": "App Configuration",
"description": "Props or context passed to the UI app"
},
"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": {
"app_identifier": {
"type": "string"
},
"assignee": {
"type": "string"
},
"timeout_ms": {
"type": "integer"
},
"configuration": {
"type": "object"
}
}
}{
"type": "object",
"properties": {
"result": {
"type": "object"
},
"status": {
"type": "string"
}
}
}[
{
"port_id": "completed",
"label": "Completed",
"is_default": true,
"description": "Interaction completed"
},
{
"port_id": "timeout",
"label": "Timeout",
"description": "Interaction expired"
},
{
"port_id": "error",
"label": "Error"
}
]执行
- 执行方式
async- 有状态
- 是
- 重试(
retryOnFail) - 否
- 能力
uiinteractivehuman- 标签
uiinteractive
说明与限制
- 审阅时,Sommatic AI 后端未提供处理该交互请求的接口,因此该调用预计会失败,运行也随之失败。编排器的恢复操作仅接受
stoneos.industry.apply。 - 如今需要人工步骤时,请使用
human.task.create(不阻塞运行的任务)或sommatic.app.handoff(交给应用的终止节点)。 - 示例信封中的
ok和port是引擎的解读;worker 只返回__signal和__metadata。
已对照编排器代码核实 · 31e874b · 2026-11-26