Skip to content

Route Batch Tasks

POST
/api/agents/route-batch

Route multiple tasks to optimal agents in a single request.

Efficiently processes batch routing for multiple tasks with optimization for load balancing and quality.

Request Body: BatchRoutingRequest with list of tasks and optimization settings

Returns: BatchRoutingResponse with routing results for each task

Raises: HTTPException 503: If communication hub is not available HTTPException 500: For unexpected errors

BatchRoutingRequest

Request model for batch task routing operations.

Allows routing multiple tasks to optimal agents in a single request for efficient task distribution and load balancing.

Fields: tasks: List of tasks to route optimize_for: Optimization strategy (speed, quality, load_balance) allow_duplicates: Whether same agent can receive multiple tasks

Usage: POST /api/agents/routing/route-batch

object
tasks
required
Tasks

Tasks to route

Array<object>
BatchRoutingTaskItem

Individual task item for batch routing requests.

Represents a single task to be routed to an optimal agent within a batch routing operation.

Fields: task_id: Unique identifier for tracking this task description: Natural language task description for routing analysis priority: Optional priority level for routing consideration constraints: Optional constraints on agent selection

object
taskId
required
Taskid

Unique identifier for this task

string
description
required
Description

Task description for routing

string
priority
Any of:
string
constraints
Any of:
Array<string>
optimizeFor
Any of:
string
allowDuplicates
Allowduplicates

Allow same agent for multiple tasks

boolean
default: true

Successful Response

BatchRoutingResponse

Response model for batch routing operations.

Returns routing decisions for all tasks in the batch with overall statistics.

Fields: status: Operation status (success/partial/failed) results: List of routing results per task total_tasks: Number of tasks processed successful_routes: Number of successful routing decisions processing_time_ms: Total processing time in milliseconds

object
status
required
Status

Operation status

string
results
required
Results

Routing results

Array<object>
BatchRoutingResultItem

Individual routing result for a task in batch routing.

Fields: task_id: Reference to the original task recommended_agent: Optimal agent for this task confidence_score: Routing confidence (0.0-1.0) reasoning: Explanation for agent selection alternatives: Alternative agent options

object
taskId
required
Taskid

Original task identifier

string
recommendedAgent
required
Recommendedagent

Selected agent ID

string
confidenceScore
required
Confidencescore

Routing confidence

number
reasoning
required
Reasoning

Selection reasoning

string
alternatives
Any of:
Array<string>
totalTasks
required
Totaltasks

Total tasks processed

integer
successfulRoutes
required
Successfulroutes

Successful routes

integer
processingTimeMs
required
Processingtimems

Processing time

number

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object