Get workflow job import context¶
Read the import task run context associated with a workflow job, including the import task identifiers, run status, row count, and file counts. When the target job is not associated with an import task, the endpoint returns a successful response with data.import_context omitted; to inspect per-file statuses, continue with List workflow job import files.
GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/import-context
Before you begin¶
Prepare a personal access token with workflow job read permission and the target workspace ID.
Obtain the workflow ID and job ID via Start workflow job or View workflow jobs.
Request parameters¶
Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, $WORKFLOW_ID, and $EXECUTION_ID with actual values.
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"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Workflow ID. When provided in the path, returns |
|
string |
Yes |
Workflow job ID. |
When querying by execution_id without specifying workflow_id, call GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/executions/{execution_id}/import-context.
Successful response¶
{
"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"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Response status message. |
|
object |
Returned payload for this call. Empty object |
|
object |
Associated import run context; omitted when the job is not linked to an import task. |
|
string |
Associated import task ID. |
|
string |
Import task name. |
|
string |
Import run record ID. Can be an empty string before a run record is created. |
|
string |
Associated workflow job ID. |
|
string |
Associated workflow ID. |
|
string |
Server task identifier. |
|
string |
Server case identifier. |
|
integer |
Import run status code: |
|
string |
Import run error message; omitted when empty. |
|
integer |
Number of rows processed or written in this import run. |
|
integer |
File count recorded on the import run; |
|
integer |
Total files counted across file statuses; |
|
integer |
Number of successfully imported files; |
|
integer |
Number of failed import files; |
|
string |
Start time in RFC 3339 format; omitted when not recorded. |
|
string |
End time in RFC 3339 format; omitted when not recorded. |
|
string |
Creation time in RFC 3339 format; omitted when not recorded. |
Error response¶
An error is returned when the target job does not exist, does not belong to the workflow specified in the path, or the current identity lacks permission to access the job. Verify the workspace ID, workflow ID, and job ID before retrying.
{
"code": "ErrNotFound",
"msg": "Not Found"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Suggested action |
|---|---|---|---|
400 |
|
The target workspace header is missing or the job identifier is empty. |
Check the workspace header and path parameters. |
401 |
|
Authentication credentials are missing or invalid. |
Check that the personal access token is valid. |
403 |
|
The current identity cannot read the import context for this workflow job. |
Use an authorized identity, or request access from an administrator. |
404 |
|
The job does not exist, or does not belong to the |
Verify |
500 |
|
Failed to read the associated import record or persisted status is invalid. |
Retain the request details and recheck the job and import task states later. |
503 |
|
Authorization or storage dependencies are temporarily unavailable. |
Retry the query later. |