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 |
|---|---|---|---|
|
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 |
|---|---|---|---|
|
string |
No |
Workflow name; cannot be empty when sent. |
|
string |
No |
Workflow description. |
|
string |
No |
Workflow DSL YAML; cannot be empty when sent. |
|
object |
No |
Runtime input form configuration. |
|
object |
No |
Runtime input form layout. |
|
object |
No |
Runtime input default values. |
|
object |
No |
Workflow design graph configuration. |
|
string |
No |
Associated compute resource ID. |
|
string |
No |
Workflow status: |
|
string |
No |
Workflow session ID. |
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Use |
|
string |
Conditional |
Required when |
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Use |
|
object |
No |
Volume trigger configuration. |
|
integer |
Conditional |
Required unless the runtime form supplies a volume ID. |
|
boolean |
No |
Enables the volume trigger. |
|
boolean |
No |
Automatically dispatches volume-triggered runs. |
|
string |
No |
JSON text of variables for the trigger. |
|
integer |
No |
Maximum concurrent volume-triggered runs. |
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Use |
|
object |
No |
Dynamic service configuration. |
|
string |
No |
Dynamic service name. |
|
string |
No |
Input schema. |
|
string |
No |
Output schema. |
|
string |
No |
Result mode. |
|
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 |
|---|---|---|
|
string |
|
|
string |
|
|
object |
Updated workflow detail. |
|
string |
Workflow ID. |
|
string |
Workflow name. |
|
string |
Current workflow status. |
|
string |
Configured execution mode. |
|
string |
Cron expression for scheduled workflows. |
|
string |
Latest workflow version ID, when provided. |
|
integer |
Latest workflow version number, when provided. |
|
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 |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
null |
Empty on error. |
Next steps¶
Use Get workflow details to verify the saved definition or Start a workflow job to run it.