Skip to main content

Interface: PlacedProcessable<TInput, TOutput>

Defined in: packages/core/src/runtime/executor.ts:157

A Processable that runs at another place (a remote handle, a bot with an executor). It declares that place as describe().place, and the place owns its runs: startRun() and attachRun() hand them to it rather than running the node here.

Extends​

Type Parameters​

TInput​

TInput = unknown

TOutput​

TOutput = unknown

Properties​

emitsInvocationEvents?​

readonly optional emitsInvocationEvents?: boolean

Defined in: packages/core/src/types.ts:216

All events from one process() call reach its own options.onToken callback. Enables isolated step events when the same instance runs concurrently. Subscription-only implementations must not overlap observed invocations.

Inherited from​

Processable.emitsInvocationEvents


forwardsStepEvents?​

readonly optional forwardsStepEvents?: boolean

Defined in: packages/core/src/types.ts:341

True when this processable forwards its children's stream events to ProcessOptions.hooks.onStepEvent itself.

A composite that intercepts a child's stream — today only graph() — declares this so an enclosing composite knows not to also capture and replay the same events off subscribeToAll. Without the declaration, nesting two interceptors delivers every leaf event once per level: the inner fires it live with precise attribution, the outer replays its buffered copy at step end. Declared rather than sniffed (no instanceof, no structural probe), per ASK-DONT-SNIFF.

Absent means false: the composite passes hooks through (or fires only boundaries) and its enclosing graph captures leaf streams on its behalf.

Inherited from​

Processable.forwardsStepEvents

Methods​

attach()​

attach(reference, options?): Promise<ExecutionRun<InferSchemaOutput<TOutput>>>

Defined in: packages/core/src/runtime/executor.ts:161

Reattach a run without submitting its input again.

Parameters​

reference​

ExecutionReference

options?​

ProcessOptions

Returns​

Promise<ExecutionRun<InferSchemaOutput<TOutput>>>


describe()​

describe(): ProcessableStructure

Defined in: packages/core/src/types.ts:324

Everything this node says about itself beyond running: its children, the wiring composition does not imply, and the capabilities it has — where it runs, what it is for a journal, which family it belongs to, what it must release.

The walker (walk()) and every consumer that lays out, addresses, places, identifies or tears down a composition read this, so a new primitive that answers it is walked, drawn, started and closed the day it exists, and a capability is asked for rather than probed for (ASK-DONT-SNIFF).

Returns​

ProcessableStructure

Inherited from​

Processable.describe


getId()​

getId(): string

Defined in: packages/core/src/types.ts:243

This instance's id, unique within the process for its lifetime and different after a restart.

Returns​

string

Example​

const bot1 = Baleybot.create({ name: 'analyzer' });
const bot2 = Baleybot.create({ name: 'analyzer' });

bot1.getId(); // 'baleybot-1-a3f891'
bot2.getId(); // 'baleybot-2-b4c2d3'

// Same semantic name, different IDs
bot1.getName(); // 'analyzer'
bot2.getName(); // 'analyzer'

Inherited from​

Processable.getId


getName()​

getName(): string

Defined in: packages/core/src/types.ts:311

What this processable is called. A label, not a key.

Stable across runs, which getId() is not — an id embeds a timestamp and changes on every restart. That is what makes a name safe to print in a log, show on a node, or hand to a merge function.

Not unique. Two bots may both be called 'analyzer', and every unnamed loop() reports 'loop'. Anything that must address exactly one instance uses getId(), or an address — never this.

Never returns an empty string: where no name was configured, the primitive reports its kind.

Returns​

string

Inherited from​

Processable.getName


process()​

process(input, options?): Promise<InferSchemaOutput<TOutput>>

Defined in: packages/core/src/types.ts:221

Run once and resolve to the final output. Events stream to options.onToken while it runs; see ProcessOptions.onToken.

Parameters​

input​

TInput

options?​

ProcessOptions

Returns​

Promise<InferSchemaOutput<TOutput>>

Inherited from​

Processable.process


start()​

start(input, options?): Promise<ExecutionRun<InferSchemaOutput<TOutput>>>

Defined in: packages/core/src/runtime/executor.ts:159

Start work at this node's place, returning a reference another process can attach to.

Parameters​

input​

TInput

options?​

ExecutionStartOptions

Returns​

Promise<ExecutionRun<InferSchemaOutput<TOutput>>>


stream()?​

optional stream(input, options?): AsyncGenerator<BaleybotStreamEvent>

Defined in: packages/core/src/types.ts:224

The run's events as an async iterator, instead of onToken callbacks.

Parameters​

input​

TInput

options?​

Omit<ProcessOptions, "onError" | "onToken" | "onComplete">

Returns​

AsyncGenerator<BaleybotStreamEvent>

Inherited from​

Processable.stream


subscribeToAll()​

subscribeToAll(options?): Subscription

Defined in: packages/core/src/types.ts:295

Subscribe to categorized events from this processable and all nested processables:

  • onStreamEvent: Real-time content streaming (text_delta, structured_output_delta, tool_call_arguments_delta)
  • onProgressUpdate: Status updates (tool_execution_start, tool_call_stream_start, tool_call_stream_complete, reasoning)
  • onComplete: Emitted when each bot finishes processing with final output
  • onError: Error events (error, tool_validation_error)

Callbacks receive both bot ID and name for precise identification:

  • botId: Unique instance identifier (e.g., 'baleybot-1-a3f891')
  • botName: Semantic name (e.g., 'analyzer', 'router', 'processor')

Callbacks run synchronously inside the run they observe. A callback that throws fails that run with its error once every subscriber has heard the notification (see leafEvents).

Parameters​

options?​

SubscribeAllCallbacks

Returns​

Subscription

Examples​

Subscribe to all events

const subscription = pipeline.subscribeToAll({
onStreamEvent(botId, botName, event) {
if (event.type === 'text_delta') {
console.log(`[${botId}] ${botName}:`, event.content);
}
},
onProgressUpdate(botId, botName, event) {
if (event.type === 'tool_execution_start') {
console.log(`${botName} (${botId}) executing ${event.toolName}`);
}
},
onComplete(botId, botName, output) {
console.log(`${botName} completed:`, output);
},
onError(botId, botName, event) {
console.error(`${botName} error:`, event);
}
});

await pipeline.process('input');
subscription.unsubscribe();

Filter specific bots by name or ID

const subscription = pipeline.subscribeToAll({
onStreamEvent(botId, botName, event) {
console.log(`${botName}:`, event);
},
omit: ['chat-step', 'processor-42-8a3f91'] // Filter by name or ID
});

Inherited from​

Processable.subscribeToAll