Get latest published workflow version

Reads details of the version in published status with the highest version number for the specified workflow. Returns 404 (ErrNotFound) when the workflow currently has no published version.

GET https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/versions/latest-published

Before you begin

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

  2. Call List workflows to obtain the target workflow ID; if you need to check whether any published version exists first, call List workflow versions.

Request parameters

Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, and $WORKFLOW_ID with actual values.

curl "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/versions/latest-published" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameter

Type

Required

Description

workflow_id

string

Yes

Target workflow ID, obtained from List workflows.

Successful response

Returns HTTP 200 and the latest published workflow version object. Version object keys use PascalCase on the JSON wire.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "ID": "ver-001",
    "WorkspaceID": "ws-001",
    "UserID": "user-001",
    "WorkflowDefinitionID": "def-001",
    "Version": 1,
    "WorkflowJSON": "{\"name\":\"daily-import\",\"nodes\":[]}",
    "Status": "published",
    "CreatedBy": "user-001",
    "CreatedAt": "2026-10-14T08:00:00Z",
    "PublishedAt": "2026-10-14T08:05:00Z",
    "Type": 1,
    "InputSchema": "",
    "OutputSchema": "",
    "ResultMode": 0,
    "Description": "Initial published version",
    "RuntimeSpecJSON": ""
  }
}

Field

Type

Description

code

string

OK when the request succeeds.

msg

string

Result message; OK when the request succeeds.

data

object

Latest published workflow version object.

data.ID

string

Workflow version ID.

data.WorkspaceID

string

Workspace ID that owns the version.

data.UserID

string

User ID of the workflow owner.

data.WorkflowDefinitionID

string

Workflow definition ID that owns the version.

data.Version

integer

Positive integer version number starting from 1.

data.WorkflowJSON

string

Saved workflow definition JSON string.

data.Status

string

Version status; fixed to published when returned by this endpoint.

data.CreatedBy

string

User ID of the actor who created the version.

data.CreatedAt

string

Version creation time in RFC 3339 format.

data.PublishedAt

string

Version publication time in RFC 3339 format.

data.Type

integer

Version type code: 1 for workflow, 2 for dynamic API service.

data.InputSchema

string

Saved input schema JSON string; "" when unset.

data.OutputSchema

string

Saved output schema JSON string; "" when unset.

data.ResultMode

integer

Result mode code: 0 for unspecified, 1 for single response, 2 for streaming.

data.Description

string

Version description; "" when unset.

data.RuntimeSpecJSON

string

Saved runtime specification JSON string; "" when unset.

Error response

Returns 404 (ErrNotFound) when the workflow does not exist, has no bound workflow definition, or currently has no version in published status. If only draft or deprecated versions exist, call List workflow versions to inspect all version statuses.

{
  "code": "ErrNotFound",
  "msg": "Not Found"
}

Field

Type

Description

code

string

Error code, such as ErrWorkspaceRequired, ErrForbidden, ErrNotFound, or ErrServer.

msg

string

Human-readable error message.

Last updated on