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

  1. Prepare a personal access token with workflow job read permission and the target workspace ID.

  2. 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

workflow_id

string

Yes

Workflow ID. When provided in the path, returns 404 if the target job does not belong to this workflow.

execution_id

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

code

string

OK when the request succeeds.

msg

string

Response status message.

data

object

Returned payload for this call. Empty object {} when the job is not associated with an import task.

data.import_context

object

Associated import run context; omitted when the job is not linked to an import task.

data.import_context.task_id

string

Associated import task ID.

data.import_context.task_name

string

Import task name.

data.import_context.run_id

string

Import run record ID. Can be an empty string before a run record is created.

data.import_context.workflow_execution_id

string

Associated workflow job ID.

data.import_context.workflow_app_id

string

Associated workflow ID.

data.import_context.moi_task_id

string

Server task identifier.

data.import_context.moi_case_id

string

Server case identifier.

data.import_context.status

integer

Import run status code: 1 created, 2 running, 3 completed, 4 failed, 5 cancelled.

data.import_context.error_message

string

Import run error message; omitted when empty.

data.import_context.row_count

integer

Number of rows processed or written in this import run.

data.import_context.file_count

integer

File count recorded on the import run; 0 for structured load tasks.

data.import_context.total

integer

Total files counted across file statuses; 0 for structured load tasks.

data.import_context.total_success

integer

Number of successfully imported files; 0 for structured load tasks.

data.import_context.total_failed

integer

Number of failed import files; 0 for structured load tasks.

data.import_context.started_at

string

Start time in RFC 3339 format; omitted when not recorded.

data.import_context.ended_at

string

End time in RFC 3339 format; omitted when not recorded.

data.import_context.created_at

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

code

string

Error code.

msg

string

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Suggested action

400

ErrParamInvalid, ErrWorkspaceRequired

The target workspace header is missing or the job identifier is empty.

Check the workspace header and path parameters.

401

Unauthorized

Authentication credentials are missing or invalid.

Check that the personal access token is valid.

403

ErrForbidden

The current identity cannot read the import context for this workflow job.

Use an authorized identity, or request access from an administrator.

404

ErrNotFound

The job does not exist, or does not belong to the workflow_id specified in the path.

Verify execution_id, workflow_id, and the target workspace.

500

ErrServer

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

ErrServiceUnavailable

Authorization or storage dependencies are temporarily unavailable.

Retry the query later.

Last updated on