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

# Add Node



## OpenAPI

````yaml /openapi.json post /api/v1/workflows/{workflow_id}/nodes
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/workflows/{workflow_id}/nodes:
    post:
      tags:
        - Workflows
      summary: Add Node
      operationId: add_node_api_v1_workflows__workflow_id__nodes_post
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workflow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowNodeCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowNodeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowNodeCreate:
      properties:
        node_type:
          type: string
          title: Node Type
          description: 'Node type: task | api_call | distribution | transform'
          default: task
        position:
          type: integer
          minimum: 0
          title: Position
        parallel_group:
          anyOf:
            - type: integer
            - type: 'null'
          title: Parallel Group
        depends_on:
          items:
            type: string
            format: uuid
          type: array
          title: Depends On
        task_template:
          additionalProperties: true
          type: object
          title: Task Template
          description: >-
            Task definition template (required for task nodes, may include
            {{variables}})
        node_config:
          additionalProperties: true
          type: object
          title: Node Config
          description: >-
            Type-specific config: api_call={provider, params},
            transform={operation, params}, distribution={platform, params}
        input_mapping:
          additionalProperties: true
          type: object
          title: Input Mapping
        max_retries:
          type: integer
          maximum: 5
          minimum: 0
          title: Max Retries
          default: 1
      type: object
      required:
        - position
      title: WorkflowNodeCreate
    WorkflowNodeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        workflow_id:
          type: string
          format: uuid
          title: Workflow Id
        node_type:
          type: string
          title: Node Type
          default: task
        position:
          type: integer
          title: Position
        parallel_group:
          anyOf:
            - type: integer
            - type: 'null'
          title: Parallel Group
        depends_on:
          items:
            type: string
            format: uuid
          type: array
          title: Depends On
        task_template:
          additionalProperties: true
          type: object
          title: Task Template
        node_config:
          additionalProperties: true
          type: object
          title: Node Config
        input_mapping:
          additionalProperties: true
          type: object
          title: Input Mapping
        retry_count:
          type: integer
          title: Retry Count
          default: 0
        max_retries:
          type: integer
          title: Max Retries
          default: 1
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - workflow_id
        - position
        - created_at
      title: WorkflowNodeResponse
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````