Update workflow

Changes an existing workflow definition or configuration. A successful request saves the change. Changes to the definition or runtime configuration redeploy the definition but do not start a job.

PATCH https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/{workflow_id}

Before you call

Use Get workflow details to select the workflow. Prepare a personal access token with workflow update permission and the target workspace ID.

Path parameters

Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, and $WORKFLOW_ID with your own values.

curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{"description": "Synchronizes daily sales data"}'

Parameter

Type

Required

Description

workflow_id

string

Yes

Workflow ID to update.

Request body

All fields are optional, but send at least one updatable field. Do not send runtime_context. Replace workflow names, DSL, resource IDs, and trigger settings with your own values.

curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{"name": "daily-import-v2", "compute_resource_id": "compute-001"}'
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{"execution_mode": "cron", "cron_expression": "0 2 * * *"}'
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{"execution_mode": "volume_trigger", "volume_trigger": {"volume_id": 1001, "enabled": true}}'
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{"execution_mode": "dynamic_service", "dynamic_service": {"service_name": "order-query-service"}}'

Field

Type

Required

Description

name

string

No

Workflow name; cannot be empty when sent.

description

string

No

Workflow description.

dsl_yaml

string

No

Workflow DSL YAML; cannot be empty when sent.

runtime_fields

object

No

Runtime input form configuration.

runtime_layout

object

No

Runtime input form layout.

default_values

object

No

Runtime input default values.

design_graph

object

No

Workflow design graph configuration.

compute_resource_id

string

No

Associated compute resource ID.

status

string

No

Workflow status: ready or disabled.

session_id

string

No

Workflow session ID.

Field

Type

Required

Description

execution_mode

string

No

Use cron for a scheduled trigger.

cron_expression

string

Conditional

Required when execution_mode is cron.

Field

Type

Required

Description

execution_mode

string

No

Use volume_trigger for a volume trigger.

volume_trigger

object

No

Volume trigger configuration.

volume_trigger.volume_id

integer

Conditional

Required unless the runtime form supplies a volume ID.

volume_trigger.enabled

boolean

No

Enables the volume trigger.

volume_trigger.auto_dispatch_enabled

boolean

No

Automatically dispatches volume-triggered runs.

volume_trigger.vars_json

string

No

JSON text of variables for the trigger.

volume_trigger.max_concurrency

integer

No

Maximum concurrent volume-triggered runs.

Field

Type

Required

Description

execution_mode

string

No

Use dynamic_service for a dynamic service.

dynamic_service

object

No

Dynamic service configuration.

dynamic_service.service_name

string

No

Dynamic service name.

dynamic_service.input_schema

string

No

Input schema.

dynamic_service.output_schema

string

No

Output schema.

dynamic_service.result_mode

string

No

Result mode.

dynamic_service.runtime_spec_json

string

No

Runtime configuration JSON text.

Successful response

Returns 200 and the updated workflow detail. The response follows the same field grouping as Get workflow details.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workflow": {
      "id": "wf-001",
      "name": "daily-import-v2",
      "status": "ready",
      "execution_mode": "cron",
      "cron_expression": "0 2 * * *",
      "latest_workflow_version_id": "ver-002",
      "latest_version": 4,
      "updated_at": "2026-08-18T11:00:00Z"
    }
  }
}

data.workflow is the updated workflow detail.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.workflow

object

Updated workflow detail.

id

string

Workflow ID.

name

string

Workflow name.

status

string

Current workflow status.

execution_mode

string

Configured execution mode.

cron_expression

string

Cron expression for scheduled workflows.

latest_workflow_version_id

string

Latest workflow version ID, when provided.

latest_version

integer

Latest workflow version number, when provided.

updated_at

string

Last update time, when provided.

For all definition, input, execution, trigger, and compute-resource fields, see Get workflow details.

Error response

{"code": "ErrParamInvalid", "msg": "Invalid request parameter", "data": null}

Field

Type

Description

code

string

Error code.

msg

string

Error message.

data

null

Empty on error.

Next steps

Use Get workflow details to verify the saved definition or Start a workflow job to run it.

Last updated on