---
title: "Publish a new workflow version"
method: POST
path: "/workflows/{workflowKey}/publish"
tags: ["workflows"]
---

# Publish a new workflow version

`POST /workflows/{workflowKey}/publish`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/workflows/{workflowKey}/publish`
- Auth: HTTP bearer

inFlightPolicy is required once a version has been published; V1 supports only continue.

## Path parameters

- `workflowKey` string, required: workflow stable key

## Request body

- object
  - `inFlightPolicy` 'continue' | 'migrate': Policy for in-progress runs

## Response `200`

Published

- object
  - `success` boolean, required
  - `workflow` object, required
  - `versionId` string, required

## Other responses

- `400`: Invalid parameters or template binding validation failed
- `401`: Missing or invalid API key
- `404`: Workflow not found
- `409`: Archived templates cannot be published

---

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