Skip to main content

createSpawnRequest

client.swarm.createSpawnRequest(swarmId: string, data: CreateSpawnRequestBody): Promise<SpawnRequest>

Create a spawn request for a swarm.

Submits a request to spawn new agent instances within the swarm. This is used to dynamically scale the swarm by adding more agents to handle increased workload.

Parameters

ParameterTypeRequiredDescription
swarmIdstringYesThe unique identifier of the swarm
dataCreateSpawnRequestBodyYesThe spawn request details

Returns

Promise<SpawnRequest> — A promise that resolves to the created SpawnRequest object

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.swarm.createSpawnRequest('swarmId', /* CreateSpawnRequestBody */);
console.log(result);