> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get flow with definition

> Returns flow details including the complete definition structure



## OpenAPI

````yaml api/legacy/openapi-agents.yaml get /flows/{flow_id}/definition
openapi: 3.0.3
info:
  title: Kapso External API - Agents & Flows API
  description: >-
    API for programmatically interacting with Kapso agents, executions, and
    WhatsApp conversations. This specification includes only Agents & Flows API
    endpoints.
  version: 1.0.0
  contact:
    name: Kapso Support
servers:
  - url: https://app.kapso.ai/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /flows/{flow_id}/definition:
    get:
      tags:
        - Flows
      summary: Get flow with definition
      description: Returns flow details including the complete definition structure
      operationId: getFlowWithDefinition
      parameters:
        - name: flow_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Flow with complete definition
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FlowWithDefinition'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Flow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FlowWithDefinition:
      allOf:
        - $ref: '#/components/schemas/Flow'
        - type: object
          properties:
            definition:
              type: object
              properties:
                nodes:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Node identifier
                        example: start_node_1
                      type:
                        type: string
                        description: Node type
                        example: flow-node
                      position:
                        type: object
                        properties:
                          x:
                            type: number
                            example: 100
                          'y':
                            type: number
                            example: 200
                      data:
                        type: object
                        properties:
                          nodeType:
                            type: string
                            description: The actual flow node type
                            enum:
                              - start
                              - send_text
                              - send_template
                              - set_variable
                              - webhook
                              - wait_for_response
                              - decide
                              - send_interactive
                              - pipedream
                              - function
                              - agent
                            example: start
                          config:
                            type: object
                            description: Node configuration specific to node type
                            additionalProperties: true
                          displayName:
                            type: string
                            description: Display name for the node
                            example: Start
                edges:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        example: edge_1
                      source:
                        type: string
                        description: Source node identifier
                        example: start_node_1
                      target:
                        type: string
                        description: Target node identifier
                        example: send_text_1
                      label:
                        type: string
                        example: next
                      type:
                        type: string
                        example: default
                      flow_condition_id:
                        type: string
                        nullable: true
                        description: ID of the flow condition for decide step edges
            whatsapp_configs:
              type: array
              description: Available WhatsApp configurations for the flow
              items:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                    example: Main WhatsApp Config
                  phone_number:
                    type: string
                    example: '+1234567890'
    Error:
      type: object
      properties:
        error:
          type: string
          example: Resource not found
        status:
          type: integer
          example: 404
        message:
          type: string
          example: The requested resource could not be found
    Flow:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: flow-123abc
        name:
          type: string
          example: Customer Onboarding Flow
        description:
          type: string
          nullable: true
          example: Automated flow for onboarding new customers
        status:
          type: string
          enum:
            - draft
            - active
            - archived
          example: active
        project_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        created_by:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        last_executed_at:
          type: string
          format: date-time
          nullable: true
        execution_count:
          type: integer
          example: 42
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required for all endpoints

````