Update workflow template¶
Replaces the contents of a workflow template. The interface is updated as fully defined; fields to be retained should also be provided in the request.
HTTP
PUT $CLOUDSIGMA_API_BASE/workflow-templates/{id}
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
First query workflow template details to obtain the current complete definition; the fields to be retained should be copied to this request. Updating built-in templates also requires administrator rights.
Request¶
Shell
curl -X PUT "$CLOUDSIGMA_API_BASE/workflow-templates/$TEMPLATE_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "<TEMPLATE_NAME>",
"description": "<DESCRIPTION>",
"dsl_yaml": "<WORKFLOW_DSL_YAML>",
"runtime_fields": "{\"fields\":[]}",
"is_builtin": false
}'
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Required | The updated template name. Custom templates cannot have the same name in the current workspace and language. |
description | string | Updated template description; this field will be cleared if not passed. | |
dsl_yaml | string | Required | Updated workflow DSL YAML. |
runtime_fields | string | The updated runtime field JSON text; if not passed, the field will be cleared. Must be valid JSON when provided. | |
is_builtin | boolean | Template type cannot be changed. When updating a custom template set to true, it will be rejected; the permissions of the built-in template are verified by the server based on the original template type. | |
template_key | string | Can be omitted to retain the original value when updating a built-in template; it is ignored and cleared in custom templates. It cannot be used to change the template type. |
Successful response¶
Returns 200 on success. data is the updated complete template object.
The response fields are as follows.
JSON
{
"code": "OK",
"msg": "OK",
"data": {
"id": 12,
"workspace_id": "ws-001",
"created_by": "user-001",
"updated_by": "user-002",
"template_key": "",
"name": "daily-import-template",
"description": "更新后的每日导入工作流模板",
"language": "zh-CN",
"dsl_yaml": "workflow: {}",
"runtime_fields": "{\"fields\":[]}",
"is_builtin": false,
"created_at": "2026-08-18T10:00:00Z",
"updated_at": "2026-08-18T11:00:00Z"
}
}
| Field | Type | Description |
|---|---|---|
code | string | OK when successful. |
msg | string | OK when successful. |
data.id | integer | Template ID. |
data.workspace_id | string | The ID of the workspace to which it belongs; the built-in template is an empty string. |
data.created_by | string | Creator ID. |
data.updated_by | string | Last updater ID. |
data.template_key | string | Built-in template identifier; custom template is an empty string. |
data.name | string | The updated name. |
data.description | string | Updated description. |
data.language | string | Template language. |
data.dsl_yaml | string | Updated workflow DSL YAML. |
data.runtime_fields | string | Updated runtime field JSON text. |
data.is_builtin | boolean | The original type of the template. |
data.created_at | string | Creation time; may be omitted if not provided by the server. |
data.updated_at | string | Last updated time; may be omitted if not provided by the server. |
Error response¶
JSON
{
"code": "ErrTemplateTypeImmutable",
"msg": "不能修改模板类型",
"data": null
}
| Field | Type | Description |
|---|---|---|
code | string | Error code. |
msg | string | Readable error message. |
data | null | `null` in an error response. |
Follow-up operations¶
Query workflow template details confirms the update result.
Last updated on