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

# Workflow veröffentlichen

> Veröffentliche den aktuellen Entwurf als Produktionsversion

Veröffentlicht den aktuellen Entwurf als neue Produktionsversion. Das ist dieselbe Aktion wie **Veröffentlichen** im Builder. Die neue Version wird aktiv, geplante Trigger und Webhook-Trigger starten, und der Workflow wird auf `ACTIVE` gesetzt.

## Basis-URL

```
https://api.langdock.com/workflows/v1/publish
```

<Warning>
  **Dedicated Deployments**

  Ersetze `api.langdock.com` durch `<your-deployment-url>/api/public` in allen Anfragen.
</Warning>

## Erforderliche Scopes

Dieser Endpoint erfordert den `WORKFLOW_WRITE_API` Scope (**Workflow-Schreib-API**) und Bearbeiterzugriff.

## Parameter

| Parameter     | Typ    | Erforderlich | Beschreibung                                                                       |
| ------------- | ------ | ------------ | ---------------------------------------------------------------------------------- |
| `workflowId`  | string | Ja           | UUID des Workflows.                                                                |
| `bumpType`    | string | Ja           | Versionserhöhung: `major`, `minor` oder `patch`.                                   |
| `description` | string | Nein         | Versionsbeschreibung. Maximum: 255 Zeichen.                                        |
| `timezone`    | string | Nein         | Gültige IANA-Zeitzone. Wird nur gespeichert, wenn ein gültiger Name gesendet wird. |

Veröffentlichen wird abgelehnt, wenn der Entwurf einen getrennten Trigger hat, wenn ein Webhook unauthentifiziert ist und der Workspace Webhook-Auth verlangt, oder wenn der Workflow eine Vorlage ist. Pausiere einen laufenden Workflow mit [Aktualisieren](/de/developer/workflow-api/update-workflow) und `status: "INACTIVE"`.

## Beispiel

```javascript theme={null}
const axios = require("axios");

async function publishWorkflow(workflowId) {
  const response = await axios.post(
    "https://api.langdock.com/workflows/v1/publish",
    {
      workflowId,
      bumpType: "patch",
      description: "Initial production version"
    },
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      }
    }
  );

  console.log("Published version:", response.data.workflow.activeVersion?.version);
}

publishWorkflow("550e8400-e29b-41d4-a716-446655440000");
```

## Antwortformat

### Erfolgreiche Antwort (200 OK)

```typescript theme={null}
{
  status: "success";
  message: "Workflow published successfully";
  workflow: object;
}
```

`workflow` entspricht dem Objekt in der [Workflow API Übersicht](/de/developer/workflow-api/workflows-overview).

## Fehlerbehandlung

| Statuscode | Beschreibung                                                                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400        | Ungültiger Body, getrennter Trigger, Webhook-Auth erforderlich, Vorlage oder fehlender Entwurf                                                                               |
| 401        | Ungültiger oder fehlender API-Key                                                                                                                                            |
| 403        | Fehlender `WORKFLOW_WRITE_API` Scope oder Bearbeiterzugriff. Ein fehlender Workflow, eine Vorlage oder ein Workflow in einem anderen Workspace gibt denselben Status zurück. |
| 429        | Rate Limit überschritten                                                                                                                                                     |
| 500        | Interner Serverfehler                                                                                                                                                        |

<Info>
  Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu [Best Practices für API-Schlüssel](/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices).
</Info>


## OpenAPI

````yaml POST /workflows/v1/publish
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /workflows/v1/publish:
    post:
      tags:
        - Workflows
      summary: Publish a workflow
      description: Publishes the current draft as a new production version.
      operationId: publishWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workflowId
                - bumpType
              properties:
                workflowId:
                  type: string
                  format: uuid
                bumpType:
                  type: string
                  enum:
                    - major
                    - minor
                    - patch
                description:
                  type: string
                  maxLength: 255
                timezone:
                  type: string
                  description: Valid IANA timezone. Stored only when a valid name is sent.
      responses:
        '200':
          description: Workflow published successfully
        '400':
          description: >-
            Invalid body, disconnected trigger, webhook auth required, template
            workflow, or missing draft
        '401':
          description: Invalid or missing API key
        '403':
          description: >-
            Missing WORKFLOW_WRITE_API scope or editor access. A missing
            workflow, a template, or a workflow in another workspace also
            returns this status.
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````