Documentation / @agentick/core / ProcedureOptions
Interface: ProcedureOptions ​
Defined in: kernel/src/procedure.ts:444
Configuration options for creating a procedure.
Example ​
const proc = createProcedure({
name: 'myProcedure',
schema: z.object({ input: z.string() }),
middleware: [loggingMiddleware],
timeout: 5000,
}, async ({ input }) => input.toUpperCase());See ​
createProcedure - Create a procedure with these options
Properties ​
executionBoundary? ​
optionalexecutionBoundary:ExecutionBoundaryConfig
Defined in: kernel/src/procedure.ts:511
Declarative execution boundary configuration.
'always': Always create a new root execution (engine:execute, engine:stream)'child': Always create a new child execution (component_tool, fork, spawn)'auto': Create only if not already in an execution (model:generate, model:stream)false: Never create an execution boundary (compile:tick, internal procedures)
Default ​
'auto'executionType? ​
optionalexecutionType:string
Defined in: kernel/src/procedure.ts:518
Explicit execution type (e.g., 'engine', 'model', 'component_tool', 'fork', 'spawn'). If not provided, derived from procedure name. Only used when this procedure becomes an execution boundary.
handleFactory? ​
optionalhandleFactory:boolean|HandleFactory<ExecutionHandle<any,any>,KernelContext>
Defined in: kernel/src/procedure.ts:467
Factory for creating execution handles.
undefined(default): Creates ExecutionHandleImpl, returns ExecutionHandleHandleFactory: Creates custom handle, returns that handle typefalse: Pass-through mode - no handle created, returns handler result directly
Use false for procedures that delegate to other procedures returning handles, avoiding double-wrapping.
Example ​
const run = createProcedure(
{ name: 'agentick:run', handleFactory: false },
(element, input) => app.run(input) // Returns SessionExecutionHandle directly
);metadata? ​
optionalmetadata:Record<string,any>
Defined in: kernel/src/procedure.ts:480
Metadata for telemetry span attributes (e.g., { type: 'tool', id: 'myTool' })
middleware? ​
optionalmiddleware: (Middleware<any[]> |MiddlewarePipeline)[]
Defined in: kernel/src/procedure.ts:448
Middleware pipeline to apply to this procedure
name? ​
optionalname:string
Defined in: kernel/src/procedure.ts:446
Name of the procedure (used in telemetry and logging)
parentProcedure? ​
optionalparentProcedure:string
Defined in: kernel/src/procedure.ts:474
Parent procedure name (for hooks)
schema? ​
optionalschema:unknown
Defined in: kernel/src/procedure.ts:472
Schema for input validation. Supports Zod 3, Zod 4, Standard Schema, or any schema with parse/validate method.
skipTracking? ​
optionalskipTracking:boolean
Defined in: kernel/src/procedure.ts:488
Internal
Skip ExecutionTracker procedure tracking for this procedure. Used for transparent wrappers like withContext() that delegate to another procedure.
sourceId? ​
optionalsourceId:string
Defined in: kernel/src/procedure.ts:478
Internal
Source identifier (e.g., class name)
sourceType? ​
optionalsourceType:"procedure"|"hook"
Defined in: kernel/src/procedure.ts:476
Internal
Whether this is a procedure or hook
streamEventType? ​
optionalstreamEventType:string
Defined in: kernel/src/procedure.ts:495
Event type name for stream chunks emitted during async generator iteration. Defaults to "stream:chunk". Use a custom name (e.g., "sandbox:output") to distinguish different streaming sources.
timeout? ​
optionaltimeout:number
Defined in: kernel/src/procedure.ts:482
Timeout in milliseconds. If exceeded, throws AbortError.timeout()