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

# Create execution batch

> Create a new execution batch with items and configuration



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml post /execution-batches
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - description: V2 API
    url: https://odyssey.asteroid.ai/agents/v2
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Execution
  - name: Files
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Execution Batches
  - name: Scheduled Executions
  - name: Schema
  - name: Documentation
  - name: Context
  - name: Admin Customer Activity
paths:
  /execution-batches:
    post:
      tags:
        - Execution Batches
      summary: Create execution batch
      description: Create a new execution batch with items and configuration
      operationId: ExecutionBatchesCreate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agents.ExecutionBatch.CreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agents.ExecutionBatch.Base'
          description: >-
            The request has succeeded and a new resource has been created as a
            result.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Agents.ExecutionBatch.CreateRequest:
      description: Request to create a new execution batch
      properties:
        agentId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Agent ID for this batch
        config:
          allOf:
            - $ref: '#/components/schemas/Agents.ExecutionBatch.BatchConfig'
          description: Batch configuration
        items:
          description: Items to execute in this batch
          items:
            $ref: '#/components/schemas/Agents.ExecutionBatch.BatchItem'
          type: array
        name:
          description: Human-readable name for the batch
          type: string
        startAt:
          description: When to start triggering executions
          format: date-time
          type: string
      required:
        - agentId
        - name
        - startAt
        - config
        - items
      type: object
    Agents.ExecutionBatch.Base:
      description: Execution batch with status counts
      properties:
        agentId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Agent ID this batch belongs to
        awaitingCapacityCount:
          description: Number of items awaiting capacity
          type: integer
        cancelledCount:
          description: Number of cancelled items
          type: integer
        concurrencyGroupId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            Batches sharing a group share one concurrency budget rather than
            each getting

            its own. Equals the batch's own id for a one-off batch; a recurring
            batch

            carries the id of the schedule that produced it.
        config:
          allOf:
            - $ref: '#/components/schemas/Agents.ExecutionBatch.BatchConfig'
          description: Batch configuration
        createdAt:
          description: Creation timestamp
          format: date-time
          type: string
        failedCount:
          description: Number of items that could not be triggered and will not be retried
          type: integer
        id:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Unique identifier for the batch
        name:
          description: Human-readable name for the batch
          type: string
        pendingCount:
          description: Number of pending items
          type: integer
        startAt:
          description: When to start triggering executions
          format: date-time
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/Agents.ExecutionBatch.Status'
          description: Current batch status
        totalCount:
          description: Total number of items
          type: integer
        triggeredCount:
          description: Number of triggered items
          type: integer
        updatedAt:
          description: Last update timestamp
          format: date-time
          type: string
      required:
        - id
        - agentId
        - name
        - startAt
        - config
        - concurrencyGroupId
        - status
        - pendingCount
        - triggeredCount
        - cancelledCount
        - awaitingCapacityCount
        - failedCount
        - totalCount
        - createdAt
        - updatedAt
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.uuid:
      format: uuid
      type: string
    Agents.ExecutionBatch.BatchConfig:
      description: Discriminated union of batch configuration types (discriminated by type)
      discriminator:
        mapping:
          maxConcurrent:
            $ref: '#/components/schemas/Agents.ExecutionBatch.MaxConcurrentConfig'
          timeBatching:
            $ref: '#/components/schemas/Agents.ExecutionBatch.TimeBatchingConfig'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/Agents.ExecutionBatch.TimeBatchingConfig'
        - $ref: '#/components/schemas/Agents.ExecutionBatch.MaxConcurrentConfig'
      type: object
    Agents.ExecutionBatch.BatchItem:
      description: Item to be executed in a batch
      properties:
        agentProfileId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            Optional agent profile to use. Mutually exclusive with
            agentProfilePoolId.
        agentProfilePoolId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: >-
            The ID of the agent profile pool to select a profile from when this
            item is

            triggered. Mutually exclusive with agentProfileId.
        executionOptions:
          allOf:
            - $ref: '#/components/schemas/Agents.Agent.ExecutionOptions'
          description: >-
            Per-execution runtime options for this item, such as its variant
            key.
        inputVars:
          description: Input variables for the execution
          type: object
          unevaluatedProperties: {}
        metadata:
          description: Metadata for the execution
          type: object
          unevaluatedProperties:
            type: string
        workflowId:
          allOf:
            - $ref: '#/components/schemas/Common.uuid'
          description: Workflow ID to execute
      required:
        - workflowId
      type: object
    Agents.ExecutionBatch.Status:
      description: Execution batch status
      enum:
        - pending
        - running
        - paused
        - completed
        - cancelled
      type: string
    Agents.ExecutionBatch.MaxConcurrentConfig:
      description: Max concurrent execution configuration
      properties:
        maxConcurrent:
          description: Maximum number of executions running at the same time
          type: integer
        type:
          description: Config type discriminator
          enum:
            - maxConcurrent
          type: string
      required:
        - type
        - maxConcurrent
      type: object
    Agents.ExecutionBatch.TimeBatchingConfig:
      description: Time-based batching configuration
      properties:
        batchInterval:
          description: Seconds to wait between each batch of executions
          type: integer
        batchSize:
          description: Maximum number of executions to trigger in each batch
          type: integer
        type:
          description: Config type discriminator
          enum:
            - timeBatching
          type: string
      required:
        - type
        - batchSize
        - batchInterval
      type: object
    Agents.Agent.ExecutionOptions:
      description: Per-execution runtime options.
      properties:
        softTimeoutMins:
          description: >-
            Soft timeout in minutes. When the execution has been running longer
            than this value, a message is injected on every subsequent step
            urging the agent to wrap up and produce output. Must be greater than
            0 and less than the agent's hard timeout (max_timeout_mins).
          minimum: 1
          type: integer
        variantKey:
          description: >-
            Identifies which variant this execution is for, scoping its shared
            files and scripts to a per-variant subdirectory under each node's
            shared folder. It does not change which agent or workflow runs.
            Normalised to a filesystem-safe slug by the server. Requires the
            agent to have `variant_mode` enabled, and a variant-mode agent
            requires it on every execution.
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Asteroid-Agents-Api-Key
      type: apiKey

````