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

# Workflow ausfuhren

> Führe einen veröffentlichten Pharen Hub Workflow per UUID aus und streame den Knoten-Fortschritt über HTTP mit einem workflows:run API-Key.

Fuhrt einen veroffentlichten Workflow aus und gibt Fortschrittsinformationen zuruck. Streaming ist nur moglich, wenn der Key Streaming-Zugriff erlaubt.

<Note>
  Erforderlicher API-Key-Scope: `workflows:run`.
</Note>

## Path-Parameter

<ParamField path="workflow_uuid" type="string" required>
  UUID des Workflows.
</ParamField>

## Query-Parameter

<ParamField query="team_id" type="string" required>
  Team-UUID, zu der der Workflow gehort.
</ParamField>

<ParamField query="stream" type="boolean">
  Setze `true`, um eine Streaming-Antwort anzufordern. Der Key muss Streaming erlauben.
</ParamField>

## Body-Parameter

<ParamField body="inputs" type="object">
  Werte fur Workflow-Input-Variablen.
</ParamField>

<ParamField body="trigger_type" type="string">
  Trigger-Bezeichnung fur den Lauf. Standard ist `manual`.
</ParamField>

## Beispiel-Body

```json theme={null}
{
  "trigger_type": "api",
  "inputs": {
    "company": "Pharen"
  }
}
```


## OpenAPI

````yaml openapi.json POST /api/flow/workflows/{workflow_uuid}/execute/
openapi: 3.1.0
info:
  title: Pharen Hub API
  version: 1.0.0
  description: >-
    Scoped REST API for Pharen Hub workspaces, calendars, lists, docs,
    workflows, and agents.
servers:
  - url: '{baseUrl}'
    description: Pharen Hub API base URL
    variables:
      baseUrl:
        default: https://pharen.app
        description: >-
          The Pharen Hub API origin. Keep the default for production, or enter
          another environment such as http://localhost:8000.
security:
  - bearerAuth: []
tags:
  - name: Calendar
    description: Calendar source and event operations.
  - name: Lists
    description: Saved list data and metadata operations.
  - name: Docs
    description: Document and collection operations.
  - name: Workflows
    description: Workflow definition and execution operations.
  - name: Agents
    description: Agent catalog and chat operations.
paths:
  /api/flow/workflows/{workflow_uuid}/execute/:
    post:
      tags:
        - Workflows
      summary: Run workflow
      description: >-
        Execute a workflow with optional JSON input. Requires the
        `workflows:run` scope.
      operationId: runWorkflow
      parameters:
        - name: workflow_uuid
          in: path
          required: true
          description: Workflow UUID.
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunWorkflowRequest'
            examples:
              input:
                summary: Workflow input
                value:
                  input:
                    source: api
                    customer_id: cus_123
      responses:
        '200':
          description: Workflow execution started or completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowRun'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    RunWorkflowRequest:
      type: object
      properties:
        input:
          type: object
          additionalProperties: true
          description: JSON input passed to the workflow run.
    WorkflowRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        workflow_id:
          type: string
          format: uuid
        status:
          type: string
          example: running
        started_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: forbidden
            message:
              type: string
              example: This API key does not have the required scope.
            details:
              type: object
              additionalProperties: true
  responses:
    BadRequest:
      description: The request was malformed or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: The request did not include a valid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        The API key is valid but does not have the required scope or workspace
        access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: >-
        The requested resource was not found or is outside the key's access
        target.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Paste your Pharen API key without the Bearer prefix.
      x-default: phk_your_api_key

````