# View workflow template details

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Read the complete definition of a workflow template. Can read built-in templates for the current language, as well as custom templates created in the current workspace.

```text
GET https://moi.matrixorigin.cn/newmoi/workflow-templates/{id}
```

## Preparation before calling

First [query workflow template list](list-workflow-templates.md) to obtain the template ID. Prepare a personal access token and target workspace ID that has access to the target workspace.


## Request parameters

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">

</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Request example</p>
```

```bash
curl "https://moi.matrixorigin.cn/newmoi/workflow-templates/$TEMPLATE_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::
::::

## Successful response

Returns `200` on success. `data` is a complete template object.


The response fields are as follows.

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>OK when successful.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>OK when successful.</dd></div>
  <div class="mo-api-field"><dt><code>data.id</code><span class="mo-api-field__type">integer</span></dt><dd>Template ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.workspace_id</code><span class="mo-api-field__type">string</span></dt><dd>The ID of the workspace to which it belongs; the built-in template is an empty string.</dd></div>
  <div class="mo-api-field"><dt><code>data.created_by</code><span class="mo-api-field__type">string</span></dt><dd>Creator ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.updated_by</code><span class="mo-api-field__type">string</span></dt><dd>Last updater ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.template_key</code><span class="mo-api-field__type">string</span></dt><dd>Built-in template identifier; custom template is an empty string.</dd></div>
  <div class="mo-api-field"><dt><code>data.name</code><span class="mo-api-field__type">string</span></dt><dd>Template name.</dd></div>
  <div class="mo-api-field"><dt><code>data.description</code><span class="mo-api-field__type">string</span></dt><dd>Template description.</dd></div>
  <div class="mo-api-field"><dt><code>data.language</code><span class="mo-api-field__type">string</span></dt><dd>Template language.</dd></div>
  <div class="mo-api-field"><dt><code>data.dsl_yaml</code><span class="mo-api-field__type">string</span></dt><dd>Workflow DSL YAML.</dd></div>
  <div class="mo-api-field"><dt><code>data.runtime_fields</code><span class="mo-api-field__type">string</span></dt><dd>Runtime field JSON text; empty string when not configured.</dd></div>
  <div class="mo-api-field"><dt><code>data.is_builtin</code><span class="mo-api-field__type">boolean</span></dt><dd>Whether it is a built-in template.</dd></div>
  <div class="mo-api-field"><dt><code>data.created_at</code><span class="mo-api-field__type">string</span></dt><dd>Creation time; may be omitted if not provided by the server.</dd></div>
  <div class="mo-api-field"><dt><code>data.updated_at</code><span class="mo-api-field__type">string</span></dt><dd>Last updated time; may be omitted if not provided by the server.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Successful response example</p>
```

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": 12,
    "workspace_id": "ws-001",
    "created_by": "user-001",
    "updated_by": "user-001",
    "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-18T10:00:00Z"
  }
}
```

:::
::::

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>Error code.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>Readable error message.</dd></div>
  <div class="mo-api-field"><dt><code>data</code><span class="mo-api-field__type">null</span></dt><dd>`null` in an error response.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Error response example</p>
```

```json
{
  "code": "ErrNotFound",
  "msg": "模板不存在",
  "data": null
}
```

:::
::::

## Follow-up operations

When the definition needs to be modified, [Update workflow template](update-workflow-template.md); when it is no longer used, [Delete workflow template](delete-workflow-template.md).
