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 $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¶
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
| Parameter | Type | Required | Description |
|---|---|---|---|
workflow_id | string | Required | Workflow ID. |
execution_id | string | Required | Job ID. |
Successful response¶
Returns 200 on success. Determine the current status of the result based on data.result.status.
{
"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"
}
]
}
}
}
}
| Field | Type | Description |
|---|---|---|
code | string | `OK` when successful. |
msg | string | `OK` when successful. |
data.result.execution_id | string | Execution ID. |
data.result.workflow_id | string | Workflow ID. |
data.result.moi_task_id | string | Task ID; returned if there is a value. |
data.result.moi_case_id | string | Case ID; returned if there is a value. |
data.result.status | string | Current or final execution status. |
data.result.case_result | string | Execution result provided by the server; returned if there is a value. |
data.result.case_error | string | Execution error provided by the server; returned if there is a value. |
data.result.node_states | object[] | 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_actions | string[] | Operations allowed in the current state. |
data.result.trace | object | Trace data; return if there is a value. |
data.result.trace_error | string | Trace read error; return if there is a value. |
data.result.job_summary | object | The job summary returned when available, which can contain input, output, and step summaries. |
data.result.rerun_context | object | This job is the source execution, node and status information returned when re-running. |
Error response¶
{
"code": "ErrNotFound",
"msg": "资源不存在",
"data": null
}
| Field | Type | Description |
|---|---|---|
code | string | Error code. |
msg | string | Readable error message. |
data | null | `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.