查询工作流作业导入上下文¶
查询工作流作业关联的导入任务运行上下文,包括导入任务标识、运行状态、导入行数和文件计数。目标作业未关联导入任务时,接口返回成功响应且 data.import_context 省略;需要查看文件级处理状态时,继续调用查询工作流作业导入文件列表。
GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/import-context
调用前准备¶
请求参数¶
将 $AI_STUDIO_API_KEY、$WORKSPACE_ID、$WORKFLOW_ID 和 $EXECUTION_ID 替换为实际值。
curl "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/import-context" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
路径参数
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
是 |
工作流 ID。传入该路径参数时,若目标作业不属于指定工作流则返回 |
|
string |
是 |
工作流作业 ID。 |
仅按 execution_id 查询且不指定 workflow_id 时,可调用 GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/executions/{execution_id}/import-context。
成功响应¶
{
"code": "OK",
"msg": "OK",
"data": {
"import_context": {
"task_id": "task-001",
"task_name": "orders-import",
"run_id": "run-001",
"workflow_execution_id": "exec-001",
"workflow_app_id": "wf-001",
"moi_task_id": "mowl-task-001",
"moi_case_id": "mowl-case-001",
"status": 3,
"row_count": 1200,
"file_count": 4,
"total": 4,
"total_success": 4,
"total_failed": 0,
"started_at": "2026-08-28T10:00:00Z",
"ended_at": "2026-08-28T10:02:15Z",
"created_at": "2026-08-28T09:59:58Z"
}
}
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
请求处理成功时为 |
|
string |
请求处理的说明文本。 |
|
object |
本次操作返回的数据。作业未关联导入任务时为空对象 |
|
object |
关联的导入运行上下文;作业未关联导入任务时省略。 |
|
string |
关联的导入任务 ID。 |
|
string |
导入任务名称。 |
|
string |
导入运行记录 ID。尚未生成运行记录时可为空字符串。 |
|
string |
关联的工作流作业 ID。 |
|
string |
关联的工作流 ID。 |
|
string |
服务端任务标识。 |
|
string |
服务端运行实例标识。 |
|
integer |
导入运行状态代码: |
|
string |
导入运行错误信息;无错误时省略。 |
|
integer |
本次导入处理或写入的行数。 |
|
integer |
导入运行记录上的文件数;结构化载入任务为 |
|
integer |
按文件状态统计的文件总数;结构化载入任务为 |
|
integer |
导入成功的文件数;结构化载入任务为 |
|
integer |
导入失败的文件数;结构化载入任务为 |
|
string |
开始时间,采用 RFC 3339 格式;未记录时省略。 |
|
string |
结束时间,采用 RFC 3339 格式;未记录时省略。 |
|
string |
创建时间,采用 RFC 3339 格式;未记录时省略。 |
错误响应¶
目标作业不存在、作业不属于路径指定的工作流,或当前身份无权访问该作业时返回错误。核对工作区 ID、工作流 ID 和作业 ID 后重试。
{
"code": "ErrNotFound",
"msg": "Not Found"
}
字段 |
类型 |
说明 |
|---|---|---|
|
string |
错误代码。 |
|
string |
可读错误信息。 |
常见 HTTP 错误¶
HTTP 状态码 |
错误代码 |
常见原因 |
建议操作 |
|---|---|---|---|
400 |
|
缺少目标工作区请求头或作业标识为空。 |
检查工作区请求头和路径中的标识参数。 |
401 |
|
认证凭据缺失或已失效。 |
检查个人访问令牌是否有效。 |
403 |
|
当前身份无权读取该工作流作业的导入上下文。 |
使用有权限的身份,或联系管理员授权。 |
404 |
|
作业不存在,或作业不属于路径指定的 |
核对 |
500 |
|
读取关联导入记录失败或持久化状态异常。 |
保留请求信息,稍后核对作业与导入任务状态。 |
503 |
|
授权或存储依赖暂不可用。 |
稍后重试查询。 |