post:
  x-eov-operation-id: activateWorkflow
  x-eov-operation-handler: v1/handlers/workflows/workflows.handler
  tags:
    - Workflow
  summary: Publish a workflow
  description: Publish a workflow. In n8n v1, this action was termed activating a workflow.
  parameters:
    - $ref: '../schemas/parameters/workflowId.yml'
  requestBody:
    description: Optional parameters to publish the workflow.
    content:
      application/json:
        schema:
          type: object
          properties:
            versionId:
              type: string
              description: The specific version ID to activate or publish. If not provided, the latest version is used.
            name:
              type: string
              description: Optional name for the workflow version during activation.
            description:
              type: string
              description: Optional description for the workflow version during activation.
    required: false
  responses:
    '200':
      description: Workflow object
      content:
        application/json:
          schema:
            $ref: '../schemas/workflow.yml'
    '400':
      $ref: '../../../../shared/spec/responses/badRequest.yml'
    '401':
      $ref: '../../../../shared/spec/responses/unauthorized.yml'
    '404':
      $ref: '../../../../shared/spec/responses/notFound.yml'
