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.

HTTP
GET $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/result

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First query the workflow job list to obtain the workflow ID and execution ID.

Request

Shell
curl "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/result" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

ParameterTypeRequiredDescription
workflow_idstringRequiredWorkflow ID.
execution_idstringRequiredJob ID.

Successful response

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

JSON
{
  "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"
          }
        ]
      }
    }
  }
}
FieldTypeDescription
codestring`OK` when successful.
msgstring`OK` when successful.
data.result.execution_idstringExecution ID.
data.result.workflow_idstringWorkflow ID.
data.result.moi_task_idstringTask ID; returned if there is a value.
data.result.moi_case_idstringCase ID; returned if there is a value.
data.result.statusstringCurrent or final execution status.
data.result.case_resultstringExecution result provided by the server; returned if there is a value.
data.result.case_errorstringExecution 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.traceobjectTrace data; return if there is a value.
data.result.trace_errorstringTrace read error; return if there is a value.
data.result.job_summaryobjectThe job summary returned when available, which can contain input, output, and step summaries.
data.result.rerun_contextobjectThis job is the source execution, node and status information returned when re-running.

Error response

JSON
{
  "code": "ErrNotFound",
  "msg": "资源不存在",
  "data": null
}
FieldTypeDescription
codestringError code.
msgstringReadable error message.
datanull`null` in an error response.

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