查询工作流详情

读取一个工作流的定义、运行配置和当前状态。

GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}

调用前准备

先通过查询工作流列表取得要读取的工作流。准备具有工作流读取权限的个人访问令牌和目标工作区 ID。

路径参数

将 $AI_STUDIO_API_KEY、$WORKSPACE_ID 和 $WORKFLOW_ID 替换为实际值。

curl "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

参数

类型

是否必填

说明

workflow_id

string

是

要读取的工作流 ID。

成功响应

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workflow": {
      "id": "wf-001",
      "name": "daily-import",
      "description": "导入每日文件",
      "source_type": "manual_dsl",
      "status": "ready",
      "available_actions": [
        "update",
        "delete",
        "run",
        "pause"
      ],
      "execution_mode": "cron",
      "cron_expression": "0 2 * * *",
      "latest_workflow_version_id": "ver-001",
      "execution_summary": {
        "total_executions": 8,
        "active_executions": 0
      },
      "trigger_summary": {
        "mode": "cron",
        "configured": true,
        "enabled": true,
        "cron_expression": "0 2 * * *"
      },
      "created_at": "2026-08-18T10:00:00Z",
      "updated_at": "2026-08-18T11:00:00Z",
      "dsl_yaml": "workflow:\\n  name: daily-import\\n  root: main\\nroot:\\n  chain: []\\n",
      "default_values": {},
      "definition_format": "dsl"
    }
  }
}

字段

类型

说明

code

string

成功代码。

msg

string

响应信息。

data

object

本次操作返回的数据。

data.workflow

object

MOWL 工作流定义。

data.workflow.id

string

工作流 ID。

data.workflow.name

string

工作流名称。

data.workflow.description

string

工作流说明。

data.workflow.source_type

string

工作流来源类型。取值为 nl2dsl、manual_dsl、manual_mowl、system、agent_automation_task

data.workflow.status

string

当前状态。取值为 ready、disabled、paused

data.workflow.available_actions

string(字符串数组)

当前状态对应的操作提示,不表示已通过当前用户的权限检查。

data.workflow.execution_mode

string

已配置的运行方式。取值为 one_shot、volume_trigger、cron、dynamic_service、task_by_version

data.workflow.cron_expression

string

Cron 表达式。仅定时触发时返回。

data.workflow.draft_id

string

草稿 ID。服务端提供时返回。

data.workflow.candidate_id

string

候选 ID。服务端提供时返回。

data.workflow.latest_workflow_version_id

string

关联标识。

data.workflow.compute_resource_id

string

关联标识。

data.workflow.compute_resource_bindings

object(对象数组)

计算资源绑定。

data.workflow.compute_resource_bindings[].id

string

当前对象的 ID。

data.workflow.compute_resource_bindings[].name

string

当前对象的名称。

data.workflow.compute_resource_bindings[].workflow_level

boolean

是否为工作流级绑定。

data.workflow.compute_resource_bindings[].node_names

string(字符串数组)

节点名称列表。

data.workflow.execution_summary

object

作业摘要。

data.workflow.execution_summary.total_executions

integer

作业总数。

data.workflow.execution_summary.active_executions

integer

活动作业数。

data.workflow.execution_summary.active_execution_id

string

关联标识。

data.workflow.execution_summary.active_execution_status

string

活动作业状态。取值为 preparing、waiting、pending、triggered、running、completed、failed、cancelled、submitted、scheduled、paused、canceled、success、succeeded、queued、cancelling、canceling

data.workflow.execution_summary.latest_execution_id

string

关联标识。

data.workflow.execution_summary.latest_execution_status

string

最近作业状态。取值为 preparing、waiting、pending、triggered、running、completed、failed、cancelled、submitted、scheduled、paused、canceled、success、succeeded、queued、cancelling、canceling

data.workflow.execution_summary.latest_execution_at

string

时间信息。

data.workflow.trigger_summary

object

触发配置摘要。

data.workflow.trigger_summary.mode

string

范围或运行模式。取值为 one_shot、volume_trigger、cron、dynamic_service、task_by_version

data.workflow.trigger_summary.configured

boolean

是否已配置。

data.workflow.trigger_summary.enabled

boolean

是否启用。

data.workflow.trigger_summary.volume_id

integer

关联标识。

data.workflow.trigger_summary.cron_expression

string

Cron 表达式。

data.workflow.trigger_summary.service_name

string

显示信息。

data.workflow.created_at

string

创建时间。采用 RFC 3339 格式。

data.workflow.updated_at

string

最近更新时间。采用 RFC 3339 格式。

data.workflow.goal

string

工作流目标。服务端提供时返回。

data.workflow.planner_model

string

规划模型。服务端提供时返回。

data.workflow.dsl_yaml

string

工作流 DSL 文本。

data.workflow.workflow

object

MOWL 工作流定义对象允许扩展键。

data.workflow.definition_format

string

定义格式。取值为 dsl、mowl、空字符串。

data.workflow.runtime_fields

object

运行表单。

data.workflow.runtime_fields.title

string

标题文本。

data.workflow.runtime_fields.description

string

当前对象的说明。

data.workflow.runtime_fields.fields

object(对象数组)

字段定义。

data.workflow.runtime_fields.fields[].field_id

string

表单字段 ID,用于运行输入和布局关联。

data.workflow.runtime_fields.fields[].label

string

显示标签。

data.workflow.runtime_fields.fields[].description

string

当前对象的说明。

data.workflow.runtime_fields.fields[].widget

string

输入控件类型。

data.workflow.runtime_fields.fields[].json_type

string

JSON 类型。

data.workflow.runtime_fields.fields[].model_type

string

模型类型标签。

data.workflow.runtime_fields.fields[].required

boolean

是否必填。

data.workflow.runtime_fields.fields[].default

JSON 值

默认值。

data.workflow.runtime_fields.fields[].has_default

boolean

是否有默认值。

data.workflow.runtime_fields.fields[].placeholder

string

输入提示。

data.workflow.runtime_fields.fields[].pattern

string

字符串匹配模式。

data.workflow.runtime_fields.fields[].runtime_config_path

string

运行配置中的字段路径。

data.workflow.runtime_fields.fields[].section

string

所属区块。

data.workflow.runtime_fields.fields[].group

string

所属分组。

data.workflow.runtime_fields.fields[].on_value

string

启用时的值。

data.workflow.runtime_fields.fields[].off_value

string

关闭时的值。

data.workflow.runtime_fields.fields[].hidden

boolean

是否隐藏。

data.workflow.runtime_fields.fields[].read_only

boolean

是否只读。

data.workflow.runtime_fields.fields[].sensitive

boolean

是否含敏感值。

data.workflow.runtime_fields.fields[].options

object(对象数组)

可选项。

data.workflow.runtime_fields.fields[].options[].label

string

显示标签。

data.workflow.runtime_fields.fields[].options[].value

JSON 值

值。

data.workflow.runtime_fields.fields[].options[].description

string

当前对象的说明。

data.workflow.runtime_fields.fields[].min

number

最小值。

data.workflow.runtime_fields.fields[].max

number

最大值。

data.workflow.runtime_fields.fields[].accept

string(字符串数组)

允许的文件类型。

data.workflow.runtime_fields.fields[].resource_type

string

资源类型。

data.workflow.runtime_fields.fields[].visible_when

object

显示条件。

data.workflow.runtime_fields.fields[].visible_when.field_id

string

表单字段 ID,用于运行输入和布局关联。

data.workflow.runtime_fields.fields[].visible_when.value

JSON 值

值。

data.workflow.runtime_fields.fields[].bind_to

string 或 object 或 null

值绑定位置。

data.workflow.runtime_fields.fields[].owner_node_name

string

该字段所属节点名称。

data.workflow.runtime_fields.fields[].owner_node_id

string

该字段所属节点的定位名。

data.workflow.runtime_layout

object

运行布局。

data.workflow.runtime_layout.version

string

当前资源版本。

data.workflow.runtime_layout.groups

object(对象数组) 或 null

字段分组。

data.workflow.runtime_layout.groups[].group_id

string

布局分组 ID。

data.workflow.runtime_layout.groups[].title

string

标题文本。

data.workflow.runtime_layout.groups[].node_name

string

显示信息。

data.workflow.runtime_layout.groups[].node_id

string

节点 ID。

data.workflow.runtime_layout.groups[].field_ids

string(字符串数组) 或 null

分组内字段 ID。

data.workflow.runtime_layout.guide

object

表单使用指南。

data.workflow.runtime_layout.guide.lead

string

引导说明。

data.workflow.runtime_layout.guide.paths

object(对象数组)

路径列表。

data.workflow.runtime_layout.guide.paths[].id

string

当前对象的 ID。

data.workflow.runtime_layout.guide.paths[].label

string

显示标签。

data.workflow.runtime_layout.guide.paths[].description

string

当前对象的说明。

data.workflow.runtime_layout.guide.paths[].field_ids

string(字符串数组) 或 null

分组内字段 ID。

data.workflow.runtime_layout.guide.groups

object(对象数组)

字段分组。

data.workflow.runtime_layout.guide.groups[].id

string

当前对象的 ID。

data.workflow.runtime_layout.guide.groups[].label

string

显示标签。

data.workflow.runtime_layout.guide.groups[].path_ids

string(字符串数组) 或 null

路径 ID 列表。

data.workflow.runtime_layout.guide.groups[].field_ids

string(字符串数组) 或 null

分组内字段 ID。

data.workflow.runtime_layout.guide.fields

object(对象数组) 或 null

字段定义。

data.workflow.runtime_layout.guide.fields[].field_id

string

表单字段 ID,用于运行输入和布局关联。

data.workflow.runtime_layout.guide.fields[].role

string

关联角色。

data.workflow.runtime_layout.guide.fields[].note

string

补充说明。

data.workflow.runtime_layout.guide.fields[].group_id

string

布局分组 ID。

data.workflow.runtime_layout.guide.fixed

object(对象数组)

是否固定。

data.workflow.runtime_layout.guide.fixed[].label

string

显示标签。

data.workflow.runtime_layout.guide.fixed[].value

string

值。

data.workflow.default_values

object

默认运行值对象允许扩展键。

data.workflow.design_graph

object

设计图对象允许扩展键。

data.workflow.notification_config

object

终态通知配置对象允许扩展键。

data.workflow.moi_workflow_def_id

string

工作流定义 ID。

错误响应

{
  "code": "ErrNotFound",
  "msg": "资源不存在"
}

字段

类型

说明

code

string

错误代码。

msg

string

错误说明。

常见 HTTP 错误

HTTP 状态码

错误代码

常见原因

建议操作

400

ErrParamInvalid、ErrWorkspaceRequired

请求字段、工作区或操作前置条件无效。

修正参数后再提交。

401

Unauthorized

认证凭据缺失或无效。

检查凭据类型、有效期及认证头。

403

ErrForbidden

当前身份或有效角色无执行该操作的权限。

使用有权限的身份,或联系管理员授权。

404

ErrNotFound

目标对象或所需引用未找到。

核对对象标识、所属工作区和当前状态。

409

ErrConflict

资源状态、请求内容或并发条件冲突。

重新读取当前状态和版本,按实际结果处理。

500

ErrServer

内部处理失败;写操作可能已有部分效果。

保留请求和追踪信息,先核对当前结果。

503

ErrServiceUnavailable

业务、运行时或授权依赖暂不可用。

恢复依赖后先核对已有结果,不自动重复写入。

最后更新于