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

# Stop Workflow Task

> Stop a running workflow task. Only supported in `streaming` mode.



## OpenAPI

````yaml /en/api-reference/openapi_workflow.json post /workflows/tasks/{task_id}/stop
openapi: 3.0.1
info:
  title: Workflow App API
  description: >-
    Workflow applications offer non-session support and are ideal for
    translation, article writing, summarization AI, and more.
  version: 1.0.0
servers:
  - url: '{api_base_url}'
    description: >-
      The base URL for the Workflow App API. Replace {api_base_url} with the
      actual API base URL.
    variables:
      api_base_url:
        default: https://api.dify.ai/v1
        description: Actual base URL of the API
security:
  - ApiKeyAuth: []
tags:
  - name: Workflows
    description: Operations for executing and managing workflows.
  - name: Files
    description: File upload and download operations.
  - name: End Users
    description: Operations related to end user information.
  - name: TTS
    description: Audio-to-text and text-to-audio conversion.
  - name: Applications
    description: Application settings, parameters, and metadata.
  - name: Human Input
    description: Endpoints for resuming paused workflows that require human input.
paths:
  /workflows/tasks/{task_id}/stop:
    post:
      tags:
        - Workflows
      summary: Stop Workflow Task
      description: Stop a running workflow task. Only supported in `streaming` mode.
      operationId: stopWorkflowTaskGeneration
      parameters:
        - name: task_id
          in: path
          required: true
          description: >-
            Task ID, can be obtained from the streaming chunk return of the [Run
            Workflow](/api-reference/workflows/run-workflow) API.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user
              properties:
                user:
                  type: string
                  description: >-
                    User identifier, must be consistent with the user passed in
                    the [Run Workflow](/api-reference/workflows/run-workflow)
                    request.
            examples:
              example:
                summary: Request Example
                value:
                  user: user_workflow_123
      responses:
        '200':
          $ref: '#/components/responses/SuccessResult'
        '400':
          description: |-
            - `not_workflow_app` : App mode does not match the API route.
            - `invalid_param` : Required parameter missing or invalid.
          content:
            application/json:
              examples:
                not_workflow_app:
                  summary: not_workflow_app
                  value:
                    status: 400
                    code: not_workflow_app
                    message: Please check if your app mode matches the right API route.
                invalid_param:
                  summary: invalid_param
                  value:
                    status: 400
                    code: invalid_param
                    message: Arg user must be provided.
components:
  responses:
    SuccessResult:
      description: Operation successful.
      content:
        application/json:
          schema:
            type: object
            properties:
              result:
                type: string
                enum:
                  - success
                description: Operation result.
          examples:
            success:
              summary: Response Example
              value:
                result: success
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key authentication. For all API requests, include your API Key in
        the `Authorization` HTTP Header, prefixed with `Bearer `. Example:
        `Authorization: Bearer {API_KEY}`. **Strongly recommend storing your API
        Key on the server-side, not shared or stored on the client-side, to
        avoid possible API-Key leakage that can lead to serious consequences.**

````