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

# Cancel Workflow Instance

> Cancel a running or waiting workflow instance.



## OpenAPI

````yaml post /api/v1/workflow-instances/{instance_id}/cancel
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/workflow-instances/{instance_id}/cancel:
    post:
      tags:
        - workflows
        - Workflows
      summary: Cancel Instance
      description: Cancel a running or waiting workflow instance.
      operationId: cancel_instance_api_v1_workflow_instances__instance_id__cancel_post
      parameters:
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
            title: Instance Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowInstanceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    WorkflowInstanceResponse:
      properties:
        id:
          type: string
          title: Id
        workflow_id:
          type: string
          title: Workflow Id
        account_id:
          type: string
          title: Account Id
        status:
          type: string
          title: Status
        current_step:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Step
        context:
          additionalProperties: true
          type: object
          title: Context
        started_at:
          type: string
          format: date-time
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        resume_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resume Job Id
      type: object
      required:
        - id
        - workflow_id
        - account_id
        - status
        - current_step
        - context
        - started_at
        - completed_at
        - error_message
        - resume_job_id
      title: WorkflowInstanceResponse
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````