Calling a sibling agent

Status: retired. The earlier stackbone.agent(name) surface addressed a sibling agent by name and opened a signed, multi-turn session against it. That surface is gone: there is no more session, no continuation cursor, no streaming handle to call another agent this way. What replaced it is narrower and simpler, described below.

A workspace can hold several agents. There are two ways one agent's work reaches another today, and they solve different problems.

From a workflow step — callDeepAgent()

callDeepAgent(name, input) from @stackbone/sdk/workflow runs one turn of another agent in your workspace, in-process, and resolves with its reply. Call it from inside a 'use step' function so the turn becomes a durable checkpoint:

import { callDeepAgent } from '@stackbone/sdk/workflow';

async function askSupport(plan: string) {
  'use step';
  const { text } = await callDeepAgent('support', {
    message: `A customer joined the "${plan}" plan. Give up to 3 onboarding tips.`,
  });
  return text;
}

There is no session object and no cursor to persist: each call is one self-contained turn. If a workflow needs a back-and-forth exchange with an agent, model that as several steps, each calling callDeepAgent() with the context it needs.

See Calling an agent from a workflow for the full contract, including the durability trade-off (a crash mid-turn re-runs the whole turn, so keep the agent's tools idempotent).

Within one agent — subagents

When the delegation should happen inside a single agent's own reasoning, not from a workflow, pass subagents to defineDeepAgent(...):

import { defineDeepAgent } from '@stackbone/sdk/deep';

export default defineDeepAgent({
  model: 'anthropic/claude-haiku-4.5',
  systemPrompt: 'You triage support requests and delegate billing questions.',
  subagents: [
    /* a focused sub-agent definition the main agent can hand a task to */
  ],
});

A subagent lives inside the same graph as its parent, it is not a separate top-level agent a chat client can address by model. Reach for it when you want the model itself to decide when to delegate a sub-task, and for callDeepAgent() when a workflow needs to hand work to a top-level agent.

Where to go next

The platform for agent developers.Build, ship and observe agentsthat survive prod.

© 2026 · STACKBONEBUILT WITH ❤️ FROM CANADA AND SPAIN