---
title: "Deploy Workflow"
method: PATCH
path: "/v3/workflow-editor/drafts/{workflow_id}/deploy"
tags: ["workflow-editor"]
---

# Deploy Workflow

`PATCH /v3/workflow-editor/drafts/{workflow_id}/deploy`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/workflow-editor/drafts/{workflow_id}/deploy`
- Auth: HTTP bearer

Deploy (activate/deactivate) a v3 workflow.

This endpoint:
1. Parses the YAML and validates every node against the node registry.
2. Materializes ``WorkflowNode`` + ``WorkflowNodeConnection`` rows in the DB.
3. If the workflow is a draft, promotes it to its parent (same as v2).
4. Sets ``is_active`` and increments ``deployed_version``.

Can also be called on an already-deployed workflow to deactivate it.

## Path parameters

- `workflow_id` string, uuid, required

## Headers

- `mentium-workspace-id` string, nullable

## Request body

- WorkflowDeployRequest: Request to deploy (activate/deactivate) a workflow.
  - `is_active` boolean: Whether to activate or deactivate the workflow.

## Response `200`

Successful Response

- WorkflowDeployOut: Response after deploying a workflow.
  - `id` string, required
  - `name` string, nullable
  - `is_active` boolean, required
  - `is_draft` boolean, required
  - `deployed_version` integer, required
  - `yaml_content` string, required
  - `node_count` integer: Number of materialized nodes
  - `parent_workflow_warnings` ParentWorkflowWarning[]: Parent workflows that were deactivated because they failed validation after this sub-workflow's contract changed.
    - `workflow_id` string, required
    - `workflow_name` string, nullable
    - `reason` string, required
  - `webhook_api_key` string, nullable: Raw API key for the HTTP trigger webhook. Only present on the first deploy when require_auth is enabled. Store it securely; the server does not retain the plaintext.

## Other responses

- `422`: Validation Error

---

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