View workflow template list¶
Lists built-in and custom workflow templates visible in the current workspace. Built-in templates are returned in the current language; custom templates only return templates created in the current workspace.
GET $CLOUDSIGMA_API_BASE/workflow-templates
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
Request¶
curl "$CLOUDSIGMA_API_BASE/workflow-templates?summary=true" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Request parameters
Successful response¶
Returns 200 on success. summary=true when data is an array of digest objects:
When summary=true is not passed, each item returns the complete template definition:
The response fields are as follows.
In field paths, [] denotes each item in an array. For example, items[].name is the name field of each item in the items array. After a type, [] denotes an array; for example, string[] is an array of strings.
{
"code": "OK",
"msg": "OK",
"data": [
{
"id": 12,
"name": "daily-import-template",
"description": "每日导入工作流模板",
"is_builtin": false
}
]
}
| Field | Type | Description |
|---|---|---|
code | string | OK when successful. |
msg | string | OK when successful. |
data | object[] | Template list; returns an empty array when there is no visible template. |
data[].id | integer | Template ID. |
data[].name | string | Template name. |
data[].description | string | Template description. |
data[].is_builtin | boolean | Whether it is a built-in template. |
data[].workspace_id | string | The workspace ID in full mode; the built-in template is an empty string. |
data[].created_by | string | Creator ID in full mode. |
data[].updated_by | string | The last updater ID in full mode. |
data[].template_key | string | The built-in template identifier in full mode; the custom template is an empty string. |
data[].language | string | Template language in full mode. |
data[].dsl_yaml | string | Workflow DSL YAML in full mode. |
data[].runtime_fields | string | Runtime field JSON text in full mode. |
data[].created_at | string | Creation time in full mode; may be omitted if not provided by the server. |
data[].updated_at | string | The last update time in full mode; may be omitted if not provided by the server. |
Error response¶
{
"code": "ErrWorkspaceIDMissing",
"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¶
Use data[].id query workflow template details.