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

# Execute Dynamic

> Execute an agent or team dynamically without pre-creating entity.

Creates an ephemeral agent/team and executes it immediately.
The entity is not persisted to the agents/teams table.

Workflow:
1. Auto-resolve worker queue if not provided
2. Generate ephemeral entity_id
3. Store full entity definition in execution_metadata
4. Start dedicated Temporal workflow
5. Link to meta_agent_session_id if provided



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json post /api/v1/dynamic-executions/execute
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/dynamic-executions/execute:
    post:
      tags:
        - Dynamic Executions
      summary: Execute Dynamic
      description: |-
        Execute an agent or team dynamically without pre-creating entity.

        Creates an ephemeral agent/team and executes it immediately.
        The entity is not persisted to the agents/teams table.

        Workflow:
        1. Auto-resolve worker queue if not provided
        2. Generate ephemeral entity_id
        3. Store full entity definition in execution_metadata
        4. Start dedicated Temporal workflow
        5. Link to meta_agent_session_id if provided
      operationId: execute_dynamic_api_v1_dynamic_executions_execute_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DynamicExecutionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DynamicExecutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DynamicExecutionRequest:
      properties:
        prompt:
          type: string
          title: Prompt
          description: User prompt
        entity:
          $ref: '#/components/schemas/DynamicEntityDefinition'
          description: Agent or team definition
        worker_queue_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Queue Id
          description: Worker queue ID (auto-selected if omitted)
        meta_agent_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Meta Agent Session Id
          description: Parent meta agent session ID
        is_shared:
          type: boolean
          title: Is Shared
          description: Allow other org members to view
          default: false
        privacy_level:
          type: string
          enum:
            - private
            - org
            - public
          title: Privacy Level
          default: private
        execution_environment:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Execution Environment
      type: object
      required:
        - prompt
        - entity
      title: DynamicExecutionRequest
      description: Request for dynamic agent/team execution
    DynamicExecutionResponse:
      properties:
        execution_id:
          type: string
          title: Execution Id
        workflow_id:
          type: string
          title: Workflow Id
        status:
          type: string
          title: Status
        entity_id:
          type: string
          title: Entity Id
        worker_queue_id:
          type: string
          title: Worker Queue Id
        message:
          type: string
          title: Message
      type: object
      required:
        - execution_id
        - workflow_id
        - status
        - entity_id
        - worker_queue_id
        - message
      title: DynamicExecutionResponse
      description: Response from dynamic execution
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DynamicEntityDefinition:
      properties:
        entity_type:
          type: string
          enum:
            - agent
            - team
          title: Entity Type
          default: agent
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Display name
        system_prompt:
          type: string
          title: System Prompt
          description: System instructions
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
          description: LiteLLM model ID
          default: kubiya/claude-sonnet-4
        model_params:
          additionalProperties: true
          type: object
          title: Model Params
          description: Model parameters (temperature, max_tokens, etc.)
        capabilities:
          items:
            type: string
          type: array
          title: Capabilities
        configuration:
          additionalProperties: true
          type: object
          title: Configuration
        mcp_servers:
          additionalProperties: true
          type: object
          title: Mcp Servers
          description: MCP server configs (stdio/sse transport)
        skill_ids:
          items:
            type: string
          type: array
          title: Skill Ids
          description: Control Plane skill IDs to attach
        subagents:
          anyOf:
            - items:
                $ref: '#/components/schemas/DynamicEntityDefinition'
              type: array
            - type: 'null'
          title: Subagents
          description: Team members (only for entity_type=team)
        runtime:
          type: string
          enum:
            - default
            - claude_code
          title: Runtime
          description: Execution runtime
          default: claude_code
      type: object
      required:
        - system_prompt
      title: DynamicEntityDefinition
      description: Inline entity definition for dynamic agent/team execution
    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:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your Kubiya API token (format: Bearer <token>)'

````