Update workflow template

Replace the content of a workflow template. The interface is updated with complete definition. Fields to be retained should also be provided in the request.

HTTP
PUT $CLOUDSIGMA_API_BASE/workflow-templates/{id}

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the workflow template details and confirm the content to be retained and modified. Prepare personal access token and target workspace ID that can access the target workspace. Updating built-in templates requires administrator privileges.

Request body

Replace the template contents in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, $TEMPLATE_ID and examples with actual values.

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": "daily-import-template",
    "description": "更新后的每日导入工作流模板",
    "dsl_yaml": "workflow:\n  name: daily-import\n  root: main\nroot:\n  chain: []\n",
    "runtime_fields": "{\"fields\":[]}",
    "is_builtin": false
  }'

Parameter

Type

Required

Description

id

integer

Yes

Template ID.

template_key

string or null

No

Can be omitted to retain the original value when updating built-in templates. Ignored in custom templates.

name

string or null

Yes

The updated template name. The custom template cannot have the same name in the current workspace and the language in which the template has been saved.

description

string or null

No

Updated template description. Cleared when omitted.

definition_format

string or null

No

Define the format.

dsl_yaml

string or null

Conditional

Required non-empty YAML text when using dsl format. Must be empty when using mowl format.

runtime_fields

string or null

No

Updated runtime field JSON text. Cleared when omitted. Must be valid JSON when provided.

is_builtin

boolean or null

No

Template type cannot be changed. Passing true when updating a custom template will be rejected.

workflow

object

No

MOWL workflow definition.

workflow.name

string or null

No

The name of the current object.

workflow.root

string or null

No

Root network name.

workflow.user_id

string or null

No

User ID.

workflow.nets

object or null

No

Network definition, the key is the network name. Objects allow extended keys.

workflow.nets["键"].transient

boolean or null

No

Whether it is a temporary object.

workflow.nets["键"].nodes

object or null

No

Node list. Objects allow extended keys.

workflow.nets["键"].nodes["键"].id

string or null

No

ID of the current object.

workflow.nets["键"].nodes["键"].version

string or null

No

The current resource version.

workflow.nets["键"].nodes["键"].in_connector

object or null

No

Enter the connection configuration.

workflow.nets["键"].nodes["键"].in_connector.type

string or null

No

type.

workflow.nets["键"].nodes["键"].in_connector.nodes

array of string or null

No

Node list.

workflow.nets["键"].nodes["键"].in_connector.queries

array of string or null

No

Query statement list.

workflow.nets["键"].nodes["键"].out_connector

object or null

No

Output connection configuration.

workflow.nets["键"].nodes["键"].out_connector.type

string or null

No

type.

workflow.nets["键"].nodes["键"].out_connector.nodes

array of string or null

No

Node list.

workflow.nets["键"].nodes["键"].out_connector.queries

array of string or null

No

Query statement list.

workflow.nets["键"].nodes["键"].var_map

object or null

No

Variable mapping. Objects allow extended keys.

workflow.provenance

object or null

No

Defines source information, which is processed by the service when saving.

workflow.provenance.task_id

string or null

No

Association ID.

workflow.provenance.artifact_id

string or null

No

Association ID.

workflow.provenance.candidate_id

string or null

No

Association ID.

workflow.provenance.catalog_revision

string or null

No

Catalog revision number.

workflow.provenance.catalog_snapshot_digest

string or null

No

Directory snapshot summary.

workflow.provenance.source_digest

string or null

No

Source definition summary.

workflow.provenance.artifact_digest

string or null

No

Product summary.

workflow.provenance.envelope_digest

string or null

No

Envelope summary.

workflow.provenance.syntax_version

string or null

No

syntax version.

workflow.provenance.compiler_version

string or null

No

Compiler version.

workflow.provenance.source_code

string or null

No

Source code.

The update preserves the original language of the template, the language setting in the request does not change it. The requested negotiated language is used when created.

The definition format defaults to dsl. When using DSL, provide a non-empty dsl_yaml and omit workflow, or fill it in as null. When using mowl, provide the workflow object and leave the DSL empty.

user_id of MOWL must be empty, provenance will be discarded. When saving, only the definition structure or JSON syntax is checked, and the workflow will not be compiled or executed.

Workflow networks and nodes are objects indexed by name. [“key”] in the table represents the actual network name or node name, not a fixed field name.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 12,
    "name": "daily-import-template",
    "description": "更新后的每日导入工作流模板",
    "dsl_yaml": "workflow: {}",
    "is_builtin": false,
    "updated_at": "2026-08-18T11:00:00Z",
    "workspace_id": "ws_01",
    "created_by": "user_01",
    "updated_by": "user_01",
    "template_key": "",
    "language": "",
    "definition_format": "dsl",
    "runtime_fields": ""
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.id

integer

Template ID.

data.workspace_id

string

The workspace ID to which it belongs. The built-in template is an empty string.

data.created_by

string

Creator ID.

data.updated_by

string

Last updated by identifier.

data.template_key

string

Built-in template identification. Custom template is an empty string.

data.name

string

The updated template name.

data.description

string

Updated template description.

data.language

string

Template language.

data.definition_format

string

Define the format.

data.workflow

JSON value

MOWL workflow definition.

data.dsl_yaml

string

Updated workflow DSL YAML.

data.runtime_fields

string

Updated runtime field JSON text.

data.is_builtin

boolean

Whether it is a built-in template.

data.created_at

string

Creation time. Omitted if not provided by the server. In RFC 3339 format.

data.updated_at

string

Last updated. Omitted if not provided by the server. In RFC 3339 format.

Error response

JSON
{
  "code": "ErrTemplateTypeImmutable",
  "msg": "工作流模板类型不能修改"
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

ErrParamInvalid, ErrWorkspaceRequired, ErrTemplateTypeImmutable, ErrSeedTemplateManaged, ErrUnsupportedLocale

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

ErrNotFound

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

ErrDuplicateName, ErrDuplicateKey, ErrAlreadyExists

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

ErrServer

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrServiceUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on