Delete a workflow version

Permanently deletes a draft version record under the specified workflow. Versions in published or deprecated status cannot be deleted; to retire a published version, call Deprecate a workflow version.

DELETE https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/versions/{version_id}

Before you begin

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

  2. Call List workflow versions or Get workflow version details to verify that the target version Status is draft and confirm that the workflow is not managed by an agent automation task.

Request parameters

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

curl -X DELETE "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/versions/$VERSION_ID" \
  -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.

version_id

string

Yes

Draft version ID to delete (Status must be draft), obtained from List workflow versions.

Successful response

Returns HTTP 200 and confirms that the draft version record has been deleted.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "deleted": true
  }
}

Field

Type

Description

code

string

OK when the request succeeds.

msg

string

Result message; OK when the request succeeds.

data

object

Deletion result object.

data.deleted

boolean

Whether the version record has been deleted; true on success.

Error response

Returns 404 (ErrNotFound) when the workflow does not exist, the version does not exist (including repeated deletion), or the version does not belong to the target workflow definition, and 409 (ErrWorkflowUpdateManagedByAutomation) when the workflow is managed by an agent automation task. Calling this endpoint on a published or deprecated version fails because only draft versions can be deleted.

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

Field

Type

Description

code

string

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

msg

string

Human-readable error message.

Last updated on