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

# Dv Workflow Rerun Handler

> Rerun a workflow. USER role requires ``can_write`` on the document path.

``s3_client`` is injected because ``DocumentIngestionService.__init__``
requires it, even though the re-ingestion path reuses the existing S3 source.



## OpenAPI

````yaml /openapi.yaml post /v1/workflows/document_versions/{workflow_id}
openapi: 3.1.0
info:
  title: Knowledge Stack API
  description: Knowledge Stack backend API for authentication and knowledge management
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Knowledge Stack API local dev server
security: []
tags:
  - name: auth
    description: Authentication and identity management
  - name: users
    description: User accounts
  - name: tenants
    description: Tenant management
  - name: invites
    description: Tenant invitations
  - name: folders
    description: Folder management
  - name: documents
    description: Document management
  - name: document-versions
    description: Document version management
  - name: sections
    description: Document sections
  - name: chunks
    description: Chunk CRUD and semantic search
  - name: chunk-lineages
    description: Chunk lineage tracking
  - name: tags
    description: Tag management
  - name: path-parts
    description: Path part traversal and tagging
  - name: Threads
    description: Thread conversations
  - name: Thread Messages
    description: Thread message management
  - name: user-permissions
    description: User path permissions
  - name: workflows
    description: Ingestion workflows
paths:
  /v1/workflows/document_versions/{workflow_id}:
    post:
      tags:
        - workflows
      summary: Dv Workflow Rerun Handler
      description: >-
        Rerun a workflow. USER role requires ``can_write`` on the document path.


        ``s3_client`` is injected because ``DocumentIngestionService.__init__``

        requires it, even though the re-ingestion path reuses the existing S3
        source.
      operationId: dv_workflow_rerun
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
        - name: authorization
          in: header
          required: false
          schema:
            type: string
            nullable: true
            title: Authorization
        - name: ks_uat
          in: cookie
          required: false
          schema:
            type: string
            nullable: true
            title: Ks Uat
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowActionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowActionResponse:
      properties:
        workflow_id:
          type: string
          title: Workflow Id
        action:
          type: string
          title: Action
        message:
          type: string
          title: Message
      additionalProperties: false
      type: object
      required:
        - workflow_id
        - action
        - message
      title: WorkflowActionResponse
      description: POST response for rerun.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````