View workflow job results

Read the execution results, node status and currently available actions of a workflow job. The result may still be in a non-final state; check the response for the result status rather than just relying on the HTTP status to determine success.

GET https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/result

Preparation before calling

First query the workflow job list to obtain the workflow ID and execution ID. Prepare a personal access token and target workspace ID that has access to the target workspace.

Path parameters

workflow_idstringRequired
Workflow ID.
execution_idstringRequired
Job ID.

Request example

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

Successful response

Returns 200 on success. Determine the current status of the result based on data.result.status.

codestring
`OK` when successful.
msgstring
`OK` when successful.
data.result.execution_idstring
Execution ID.
data.result.workflow_idstring
Workflow ID.
data.result.moi_task_idstring
Task ID; returned if there is a value.
data.result.moi_case_idstring
Case ID; returned if there is a value.
data.result.statusstring
Current or final execution status.
data.result.case_resultstring
Execution result provided by the server; returned if there is a value.
data.result.case_errorstring
Execution error provided by the server; returned if there is a value.
data.result.node_statesobject[]
Node tracking status list. Each item may contain `span_id`, `parent_span_id`, `node_id`, `node_name`, `workitem_id`, Z XQPROTECT30TOKEN, `kind`, `status`, `error`, time, `duration_ms` and `attrs_json`. where `node_name` is the trace name, not the separate `node_key` field.
data.result.available_actionsstring[]
Operations allowed in the current state.
data.result.traceobject
Trace data; return if there is a value.
data.result.trace_errorstring
Trace read error; return if there is a value.
data.result.job_summaryobject
The job summary returned when available, which can contain input, output, and step summaries.
data.result.rerun_contextobject
This job is the source execution, node and status information returned when re-running.

Successful response example

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "result": {
      "execution_id": "exec-001",
      "workflow_id": "wf-001",
      "moi_task_id": "task-001",
      "moi_case_id": "case-001",
      "status": "completed",
      "case_result": "{}",
      "node_states": [
        {
          "span_id": "span-001",
          "node_name": "load",
          "status": "completed",
          "duration_ms": 1200
        }
      ],
      "available_actions": [],
      "job_summary": {
        "steps": [
          {
            "name": "load",
            "display_name": "加载数据",
            "status": "completed"
          }
        ]
      }
    }
  }
}

Error response

codestring
Error code.
msgstring
Readable error message.
datanull
`null` in an error response.

Error response example

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

Follow-up operations

After obtaining the node key from the workflow DSL, query the workflow job node. In the current tracking data, the node_name of the node status is often displayed as node:<NODE_KEY>, but the actual node key in the DSL should still be passed when calling, instead of treating the display string as node_key.

Last updated on