NylorunDocsBeta
Get startedBuildRunDeployReferenceMore
Agents SDK

executor

connectAgents registers agents and runs their tools from @nylorun/agents/executor.

import { connectAgents } from "@nylorun/agents/executor";

Guides: Executors, App server.

connectAgents

connectAgents(options: ConnectOptions): AgentConnection

Saves every definition, registers an executor for each runnable, and opens an authenticated event stream. When the Runtime offers an action, the executor claims it, runs your implementation, and returns the result. It runs agent tools and hooks, and workflow tool, fn, and verify nodes. Sandbox tools run in the Runtime instead.

Prop

Type

Returns an AgentConnection:

Prop

Type

Throws (via ready) ConnectionError when no connection is found, and IncompatibleRuntimeError on version skew.

const connection = connectAgents({ agents, onError: console.error });
await connection.ready;

Credentials

With an application key, PUT /v1/executors registers a derived token for each (application key, Tenant, runnable id). Tokens are never stored. Claims send only { requestId, implementationVersion }. With NYLORUN_EXECUTOR_KEY, the executor uses that pre-provisioned, single-runnable credential.

Delegation limits

Agents used as tools cannot declare approval. ctx.ask, ctx.approve, ctx.sleep, and ctx.waitFor inside a delegated agent fail with delegation.interaction-unsupported.

deriveExecutorToken

Computes the same derived executor token the SDK registers. Most apps never call it directly.

On this page