---
title: "Save workflow as template"
method: POST
path: "/v4/templates/from-workflow"
tags: ["Templates"]
---

# Save workflow as template

`POST /v4/templates/from-workflow`

## Request

- Base URL: `https://api.kadoa.com`
- URL: `https://api.kadoa.com/v4/templates/from-workflow`
- Auth: API key in header `x-api-key`

Extract a workflow's prompt, schema, validation rules, and notifications into a new template or as a new version of an existing template. The source workflow is not modified (v1: no auto-link).

## Request body

- SaveFromWorkflowBody: Request body for saving a workflow's config as a template (new or existing)
  - `workflowId` string, uuid, required: Source workflow ID to extract config from
  - `name` string: Name for the new template (required if templateId is not set)
  - `description` string: Description for the new template
  - `templateId` string, uuid: Existing template ID to add a new version to (mutually exclusive with name)
  - `includeParts` string[]: Which workflow parts to include in the template. If omitted, all parts are included.

## Response `201`

201

- SaveFromWorkflowResponse: Response for saving a workflow as a template
  - `error` false, required: Error flag (always false on success)
  - `success` true, required: Success flag
  - `data` object, required
    - `templateId` string, uuid, required: Template ID (new or existing)
    - `version` number, required: Published version number
    - `isNew` boolean, required: Whether a new template was created

## Other responses

- `400`: 400
- `401`: 401
- `404`: 404
- `409`: 409
- `500`: 500

---

[API](https://skmtc.dev/kadoa/apis/kadoa-api.md) · [All operations](https://skmtc.dev/kadoa/apis/kadoa-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kadoa/apis/kadoa-api/revisions/bf7803c927b4?raw)
