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

# Execute Workflow

> Executes a specified workflow by processing dynamic form data with field names and types determined by the deployed ComfyUI workflow. Each workflow defines its own unique input parameters based on the nodes it contains.

**Important**: The exact parameter names and types vary for each workflow_id and deployment URL. To discover the required parameters for your workflow:
1. Check your workflow's **API Deployment Dashboard**
2. Refer to your ComfyUI workflow's input nodes

The workflow is executed on an available ComfyUI instance within the cluster based on queue size limits.



## OpenAPI

````yaml POST /api/v1/runs
openapi: 3.1.0
info:
  title: FlowScale ComfyUI API
  version: 2.0.0
servers:
  - url: https://your-deployment-api-url.pod.flowscale.ai
    description: 'Pod #your-pod (Default)'
  - url: '{apiEndpoint}'
    description: Deployed API Endpoint
    variables:
      apiEndpoint:
        default: https://your-domain.com
        description: Your project's deployed API endpoint
security: []
paths:
  /api/v1/runs:
    post:
      tags:
        - run
      summary: Execute Workflow
      description: >-
        Executes a specified workflow by processing dynamic form data with field
        names and types determined by the deployed ComfyUI workflow. Each
        workflow defines its own unique input parameters based on the nodes it
        contains.


        **Important**: The exact parameter names and types vary for each
        workflow_id and deployment URL. To discover the required parameters for
        your workflow:

        1. Check your workflow's **API Deployment Dashboard**

        2. Refer to your ComfyUI workflow's input nodes


        The workflow is executed on an available ComfyUI instance within the
        cluster based on queue size limits.
      operationId: execute_workflow_api_v1_runs_post
      parameters:
        - name: workflow_id
          in: query
          required: true
          schema:
            type: string
            title: Workflow Id
        - name: group_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Group Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                custom_field_1:
                  type: string
                  description: >-
                    Replace 'custom_field_1' with your actual parameter name.
                    Example: 'prompt', 'style', 'model_name'
                  example: your_value_here
                custom_field_2:
                  type: number
                  description: >-
                    Replace 'custom_field_2' with your numeric parameter name.
                    Example: 'strength', 'cfg_scale', 'temperature'
                  example: 7.5
                custom_field_3:
                  type: integer
                  description: >-
                    Replace 'custom_field_3' with your integer parameter name.
                    Example: 'steps', 'seed', 'width', 'height'
                  example: 20
                custom_file_upload:
                  type: string
                  format: binary
                  description: >-
                    Replace 'custom_file_upload' with your file parameter name.
                    Example: 'input_image', 'reference_image', 'mask'
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
                  - type: integer
                  - type: boolean
                  - type: string
                    format: binary
              description: >-
                ⚠️ **IMPORTANT**: The field names shown below are placeholders.
                You must replace them with the actual parameter names required
                by your specific workflow.


                **To find your workflow's parameter names:**

                1. **API Docs**: Check your deployment's auto-generated API
                Deployment Dashboard  

                3. **ComfyUI Workflow**: Look at the input nodes in your
                workflow


                **Note**: Different workflows have completely different
                parameter names and types.
            encoding:
              custom_file_upload:
                contentType: image/*,video/*,audio/*
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComfyRunResponseWrapper'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ComfyRunResponseWrapper:
      properties:
        status:
          type: string
          title: Status
        data:
          items:
            $ref: '#/components/schemas/ComfyRunResponse'
          type: array
          title: Data
        errors:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - type: 'null'
          title: Errors
        meta:
          anyOf:
            - type: object
            - type: 'null'
          title: Meta
      type: object
      required:
        - status
        - data
      title: ComfyRunResponseWrapper
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ComfyRunResponse:
      properties:
        run_id:
          type: string
          title: Run Id
        workflow_id:
          type: string
          title: Workflow Id
      type: object
      required:
        - run_id
        - workflow_id
      title: ComfyRunResponse
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````