List workflow job import files¶
List paginated file-level import records associated with a workflow job, with optional filtering by import file status. Structured load tasks and jobs not associated with an import task return an empty data.files array.
GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/import-files
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; you can also call Get workflow job import context first to check whether the job is linked to an import run.
Request parameters¶
Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, $WORKFLOW_ID, and $EXECUTION_ID with actual values.
Read the first page
curl --get "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/import-files" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "page=1" \
--data-urlencode "page_size=20"
Filter failed files by status
Status code 3 indicates failed import files. Pass comma-separated integer codes or repeat the status query parameter to match multiple statuses.
curl --get "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/import-files" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "page=1" \
--data-urlencode "page_size=20" \
--data-urlencode "status=3"
Read the next page
Increment page by 1 on each request until the cumulative number of returned files reaches data.total or data.files on the current page is empty.
curl --get "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/import-files" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--data-urlencode "page=2" \
--data-urlencode "page_size=20"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Workflow ID. When provided in the path, returns |
|
string |
Yes |
Workflow job ID. |
Query parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Page number as a non-negative integer; |
|
integer |
No |
Number of items per page, from |
|
string |
No |
Filter by import file status code. Accepts a single integer, comma-separated integers (such as |
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-files. To retry failed import files, pass data.files[].id of the failed items to Retry failed files.
Successful response¶
data.total is the number of files matching the active status filter; data.total_sum is the total number of files across all statuses in this import run.
{
"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": 4,
"error_message": "1 file failed",
"row_count": 900,
"file_count": 4,
"total": 4,
"total_success": 3,
"total_failed": 1,
"started_at": "2026-08-28T10:00:00Z",
"ended_at": "2026-08-28T10:02:15Z",
"created_at": "2026-08-28T09:59:58Z"
},
"files": [
{
"id": "file-001",
"name": "orders_20260828.csv",
"type": 1,
"status": 3,
"size": 20480,
"update_time": 1756375335,
"reason": "column count mismatch at line 42",
"user": "alice",
"start_time": 1756375200,
"end_time": 1756375335,
"path": "imports/orders/orders_20260828.csv",
"run_id": "run-001"
}
],
"total": 1,
"total_sum": 4,
"total_success": 3,
"total_failed": 1
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Response status message. |
|
object |
Returned payload for this call. |
|
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. |
|
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. |
|
array of object |
Import file records on the current page. Empty when no files match, when the job has no import task, or for structured load tasks. |
|
string |
Import file record ID. |
|
string |
File name. |
|
integer |
File type code. |
|
integer |
Import file status code: |
|
integer |
File size in bytes. |
|
integer |
Last update Unix timestamp in seconds; |
|
string |
Failure reason for the file import; omitted when empty. |
|
string |
Username recorded on the import task; omitted when empty. |
|
integer |
Processing start Unix timestamp in seconds; |
|
integer |
Processing end Unix timestamp in seconds; |
|
string |
Saved file path; omitted when empty. |
|
string |
Associated import run ID. |
|
integer |
Total number of files matching the active filter. |
|
integer |
Total number of files across all statuses in this import run. |
|
integer |
Number of succeeded files in this import run. |
|
integer |
Number of failed files in this import run. |
Error response¶
An error is returned when pagination parameters are out of range, status contains non-integer text, the target job does not exist, or the caller lacks permission to access the job.
{
"code": "ErrParamInvalid",
"msg": "Bad Request"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Suggested action |
|---|---|---|---|
400 |
|
|
Correct the pagination and status filter parameters before retrying. |
401 |
|
Authentication credentials are missing or invalid. |
Check that the personal access token is valid. |
403 |
|
The current identity cannot read import files 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 |
|
|
Use only status codes |
503 |
|
Authorization or storage dependencies are temporarily unavailable. |
Retry the query later. |