> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enginy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish workflow

> Publish a workflow's current draft as a new version. Pass an optional `revision` (from `GET /v1/workflow/{workflowId}`) for optimistic concurrency.

Responses include direct Enginy app URLs when available. The response includes an `appUrl` to the workflow editor. MCP agents should return those URLs to users whenever they are present in the response.

    > **Required scope:** `WORKFLOWS_WRITE`
    >
    > **Rate limit:** 30 requests per minute



## OpenAPI

````yaml https://openapi.enginy.ai/definitions.json post /v1/workflow/{workflowId}/publish
openapi: 3.1.0
info:
  title: Enginy API
  version: 1.0.0
  description: Public API for Enginy platform
servers:
  - url: https://openapi.enginy.ai
    description: Configured server
security: []
tags:
  - name: AI Variables
    description: >-
      Manage AI variables and discover the entity fields you can reference in
      prompts and entity requests.
  - name: Inbox
    description: >-
      Inbox endpoints for listing contact threads, reading thread messages,
      managing tags, and sending manual replies.
  - name: Workflows
    description: >-
      Build, validate, publish, run, and inspect advanced (graph) workflows,
      plus the block/condition catalog needed to author a workflow plan.
paths:
  /v1/workflow/{workflowId}/publish:
    post:
      tags:
        - Workflows
      summary: Publish workflow
      description: >-
        Publish a workflow's current draft as a new version. Pass an optional
        `revision` (from `GET /v1/workflow/{workflowId}`) for optimistic
        concurrency.


        Responses include direct Enginy app URLs when available. The response
        includes an `appUrl` to the workflow editor. MCP agents should return
        those URLs to users whenever they are present in the response.

            > **Required scope:** `WORKFLOWS_WRITE`
            >
            > **Rate limit:** 30 requests per minute
      parameters:
        - schema:
            type: string
          required: true
          name: workflowId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                revision:
                  type: string
                  description: Optimistic concurrency token.
      responses:
        '200':
          description: Workflow published
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                      appUrl:
                        type: string
                        format: uri
                      version:
                        type: number
                      isPublished:
                        type: boolean
                        enum:
                          - true
                    required:
                      - id
                      - appUrl
                      - version
                      - isPublished
                required:
                  - status
                  - message
                  - data
        '400':
          description: The workflow ID is not a positive integer.
        '403':
          description: >-
            Advanced workflows are not enabled for this workspace. Ask your
            workspace admin to enable the feature.
        '404':
          description: Workflow not found or not writable.
        '409':
          description: >-
            A revision conflict (the draft changed since the provided revision —
            re-read the workflow and retry), the trigger is already being
            updated by another publish (retry shortly), or the workflow is open
            in the collaborative app editor (close it there and retry).
        '422':
          description: The stored draft fails publish validation.
        '500':
          description: The workflow could not be published.
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````