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 https://moi.matrixorigin.cn/newmoi/workflow-templates

Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace.

Request parameters

Request example

curl "https://moi.matrixorigin.cn/newmoi/workflow-templates?summary=true" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

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.

codestring
OK when successful.
msgstring
OK when successful.
dataobject[]
Template list; returns an empty array when there is no visible template.
data[].idinteger
Template ID.
data[].namestring
Template name.
data[].descriptionstring
Template description.
data[].is_builtinboolean
Whether it is a built-in template.
data[].workspace_idstring
The workspace ID in full mode; the built-in template is an empty string.
data[].created_bystring
Creator ID in full mode.
data[].updated_bystring
The last updater ID in full mode.
data[].template_keystring
The built-in template identifier in full mode; the custom template is an empty string.
data[].languagestring
Template language in full mode.
data[].dsl_yamlstring
Workflow DSL YAML in full mode.
data[].runtime_fieldsstring
Runtime field JSON text in full mode.
data[].created_atstring
Creation time in full mode; may be omitted if not provided by the server.
data[].updated_atstring
The last update time in full mode; may be omitted if not provided by the server.

Successful response example

{
  "code": "OK",
  "msg": "OK",
  "data": [
    {
      "id": 12,
      "name": "daily-import-template",
      "description": "每日导入工作流模板",
      "is_builtin": false
    }
  ]
}

Error response

codestring
Error code.
msgstring
Readable error message.
datanull
`null` in an error response.

Error response example

{
  "code": "ErrWorkspaceIDMissing",
  "msg": "需要工作区标识",
  "data": null
}

Follow-up operations

Use data[].id query workflow template details.

Last updated on