> ## 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 aktualisieren

> Aktualisiere Metadaten oder den Entwurfsgraphen eines Workflows

Aktualisiert Metadaten oder den Entwurfsgraphen für einen Workflow, den der API-Key-User bearbeiten kann. Ein Update am Entwurf veröffentlicht keine neue Version.

Sende in einer Anfrage entweder Metadaten (inklusive `limits`) oder ein Graph-Update. Mische sie nicht.

## Basis-URL

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

<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.                                                                                                                                                                  |
| `name`        | string | Nein         | Workflow-Name. Maximum: 60 Zeichen.                                                                                                                                                  |
| `description` | string | Nein         | Workflow-Beschreibung. Maximum: 500 Zeichen.                                                                                                                                         |
| `status`      | string | Nein         | `ACTIVE` oder `INACTIVE`. `ACTIVE` braucht eine veröffentlichte Version. Nutze `INACTIVE`, um einen laufenden Workflow zu pausieren.                                                 |
| `timezone`    | string | Nein         | Gültige IANA-Zeitzone. Wird gespeichert, wenn `status` fehlt oder `ACTIVE` ist. Wird ignoriert, wenn `status` `INACTIVE` ist, damit eine Pause die Cron-Zeitzone nicht überschreibt. |
| `nodes`       | array  | Nein         | Vollständiger Ersatz der Entwurf-Nodes. Muss zusammen mit `edges` gesendet werden, nicht mit `patch` oder Metadaten.                                                                 |
| `edges`       | array  | Nein         | Vollständiger Ersatz der Entwurf-Kanten. Muss zusammen mit `nodes` gesendet werden.                                                                                                  |
| `patch`       | object | Nein         | Inkrementelle Graph-Operationen statt eines vollständigen `nodes`- und `edges`-Ersatzes. Nicht zusammen mit `nodes` und `edges` oder mit Metadaten senden.                           |
| `limits`      | object | Nein         | Ausführungslimits. Weggelassene Felder bleiben unverändert. Sende `null` auf einem Feld, um es zu leeren. Darf mit anderen Metadaten gesendet werden, nicht mit einem Graph-Update.  |

Um den Entwurfsgraphen zu ersetzen, sende `nodes` und `edges`. Für eine inkrementelle Graph-Änderung sende `patch`. Ein redigierter Secret-Wert aus [Abrufen](/de/developer/workflow-api/get-workflow) behält das gespeicherte Secret. Sende einen neuen, nicht leeren Wert, um ein Secret zu rotieren, oder `null`, um ein Secret-Feld zu leeren.

## Beispiel

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

async function pauseWorkflow(workflowId) {
  const response = await axios.patch(
    "https://api.langdock.com/workflows/v1/update",
    {
      workflowId,
      status: "INACTIVE"
    },
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      }
    }
  );

  console.log("Status:", response.data.workflow.status);
}

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

## Antwortformat

### Erfolgreiche Antwort (200 OK)

```typescript theme={null}
{
  status: "success";
  message: "Workflow updated 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, gemischter Graph und Metadaten, `nodes` ohne `edges`, keine Felder, oder Aktivierung ohne veröffentlichte Version                                                                                                                                            |
| 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. Ein Graph-Update mit **Meeting End** ohne Meetings gibt `MEETINGS_FEATURE_FLAG_DISABLED` 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 PATCH /workflows/v1/update
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/update:
    patch:
      tags:
        - Workflows
      summary: Update a workflow
      description: >-
        Updates metadata or the draft graph. Updating the draft does not publish
        a new version.
      operationId: updateWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workflowId
              properties:
                workflowId:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 60
                description:
                  type: string
                  maxLength: 500
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - INACTIVE
                timezone:
                  type: string
                  description: Valid IANA timezone.
                nodes:
                  type: array
                  items:
                    type: object
                edges:
                  type: array
                  items:
                    type: object
                patch:
                  type: object
                  description: >-
                    Incremental graph operations. Cannot be sent with nodes and
                    edges or with metadata.
                limits:
                  type: object
                  description: >-
                    Execution caps. Omitted fields stay unchanged. Send null on
                    a field to clear it.
      responses:
        '200':
          description: Workflow updated successfully
        '400':
          description: >-
            Invalid body, mixed graph and metadata, nodes without edges, no
            fields, or activate without a published version
        '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"

````