本页内容
Sommatic 文档
打开控制台

Execute Sommatic App

请求用户与指定的 Sommatic AI App 界面进行交互。

以 Markdown 查看
在以下应用中打开
人工介入 部分可用 sommatic.app.execute 版本 1.0.0 执行方式: async

部分实现。请求后端创建应用交互,并返回引擎不会处理的挂起信号:运行既不等待应用,也不会沿 completed 或 timeout 继续。

工作原理

  1. 解析配置并合并到输入 payload 之上(配置优先)。
  2. 缺少 app_identifier 时抛出异常:运行失败,除非被 flow.try 作用域捕获。
  3. 向后端 HITL 交互端点提交 { type: "app_execution", app_identifier, configuration, assignee, expires_in_ms: timeout_ms };HTTP 失败会被重新抛出。
  4. 返回 { __signal: "SUSPEND", __metadata: { type: "sommatic_app_interaction", id, resume_on: ["completed", "timeout"] } }。
  5. 信封没有端口,引擎将其路由到本节点未声明的 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 }}"
    }
  }
}

配置

app_identifier string 必填

前端应用/微前端的 slug 或 ID

assignee string 可选
timeout_ms integer 可选

默认值: 3600000

configuration object 可选

传给 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.resultobject
$("Execute Sommatic App").item.json.statusstring

错误

消息 端口 原因与处理
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_identifier string 可选
assignee string 可选
timeout_ms integer 可选
configuration object 可选

输出契约

result object 可选
status string 可选

契约(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
    }
  }
}

执行

执行方式
async
有状态
是
重试(retryOnFail)
否
能力
uiinteractivehuman
标签
uiinteractive

说明与限制

  • 审阅时,Sommatic AI 后端未提供处理该交互请求的接口,因此该调用预计会失败,运行也随之失败。编排器的恢复操作仅接受 stoneos.industry.apply。
  • 如今需要人工步骤时,请使用 human.task.create(不阻塞运行的任务)或 sommatic.app.handoff(交给应用的终止节点)。
  • 示例信封中的 ok 和 port 是引擎的解读;worker 只返回 __signal 和 __metadata。

已对照编排器代码核实 · 31e874b · 2026-11-26

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

仅安装技能包,不会自动更新;需要时重新运行即可。

npx skills add https://docs.sommatic.ai
智能体如何读取本文档