Create workflow template¶
Create a custom workflow template in the current workspace. Creating built-in templates requires administrator privileges.
POST $CLOUDSIGMA_API_BASE/workflow-templates
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. Prepare the workflow DSL that can access the personal access token, target workspace ID and template of the target workspace.
Request body¶
Replace the template content in $CLOUDSIGMA_API_KEY, $WORKSPACE_ID, and examples with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workflow-templates" \
-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
}'
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.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string or null |
No |
Built-in template identification. Required when creating a built-in template. Ignored when creating a custom template. |
|
string or null |
Yes |
Template name. Custom templates cannot have the same name in the current workspace and current language. |
|
string or null |
No |
Template description. |
|
string or null |
No |
Define the format. |
|
string or null |
Conditional |
Required non-empty YAML text when using dsl format. Must be empty when using mowl format. |
|
string or null |
No |
JSON text of the runtime field definition. Must be valid JSON when provided. |
|
boolean or null |
No |
Whether to create it as a built-in template. When omitted, it is |
|
object |
No |
MOWL workflow definition. |
|
string or null |
No |
The name of the current object. |
|
string or null |
No |
Root network name. |
|
string or null |
No |
User ID. |
|
object or null |
No |
Network definition, the key is the network name. Objects allow extended keys. |
|
boolean or null |
No |
Whether it is a temporary object. |
|
object or null |
No |
Node list. Objects allow extended keys. |
|
string or null |
No |
ID of the current object. |
|
string or null |
No |
The current resource version. |
|
object or null |
No |
Enter the connection configuration. |
|
string or null |
No |
type. |
|
array of string or null |
No |
Node list. |
|
array of string or null |
No |
Query statement list. |
|
object or null |
No |
Output connection configuration. |
|
string or null |
No |
type. |
|
array of string or null |
No |
Node list. |
|
array of string or null |
No |
Query statement list. |
|
object or null |
No |
Variable mapping. Objects allow extended keys. |
|
object or null |
No |
Defines source information, which is processed by the service when saving. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Association ID. |
|
string or null |
No |
Catalog revision number. |
|
string or null |
No |
Directory snapshot summary. |
|
string or null |
No |
Source definition summary. |
|
string or null |
No |
Product summary. |
|
string or null |
No |
Envelope summary. |
|
string or null |
No |
syntax version. |
|
string or null |
No |
Compiler version. |
|
string or null |
No |
Source code. |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": 12,
"workspace_id": "ws-001",
"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-18T10:00:00Z",
"created_by": "user_01",
"updated_by": "user_01",
"template_key": "",
"definition_format": "dsl"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
integer |
Template ID. |
|
string |
The workspace ID to which it belongs. The built-in template is an empty string. |
|
string |
Creator ID. |
|
string |
Last updated by identifier. |
|
string |
Built-in template identification. Custom template is an empty string. |
|
string |
Template name. |
|
string |
Template description. |
|
string |
Template language. |
|
string |
Define the format. |
|
JSON value |
MOWL workflow definition. |
|
string |
Saved workflow DSL YAML. |
|
string |
Saved runtime field JSON text. Empty string when not configured. |
|
boolean |
Whether it is a built-in template. |
|
string |
Creation time. Omitted if not provided by the server. In RFC 3339 format. |
|
string |
Last updated. Omitted if not provided by the server. In RFC 3339 format. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
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 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |