pickaxe.start
API reference for pickaxe.start.
The pickaxe.start
method starts the Pickaxe worker to process agents, tools, and toolboxes. It automatically discovers and registers your workflows or accepts explicit registration.
Quick Reference
- Auto-discovery: Automatically finds agents, tools, and toolboxes created with
pickaxe.agent()
,pickaxe.tool()
, andpickaxe.toolbox()
- Explicit registration: Register specific workflows using the
register
parameter - Worker configuration: Configure worker slots, labels, and other runtime options
Usage Example
Parameters
The start()
method accepts a single optional options
parameter with the following properties:
Parameter | Type | Required | Description |
---|---|---|---|
name | string | No | Worker name for identification. Default: “pickaxe-worker” |
register | BaseOrRegisterable[] | No | Workflows to register. If omitted, uses auto-discovery |
slots | number | No | Maximum number of concurrent workflow runs. Default: 100 |
durableSlots | number | No | Maximum number of concurrent durable workflow runs. Default: 1,000 |
labels | WorkerLabels | No | Key-value pairs for worker affinity and routing |
handleKill | boolean | No | Whether to handle process kill signals gracefully |
workflows | BaseWorkflowDeclaration[] | No | Direct workflow array (typically handled via register ) |
BaseOrRegisterable Type
The register
parameter accepts workflows and registerable objects:
Type | Description |
---|---|
BaseWorkflowDeclaration | Individual workflow (agent, tool, or Hatchet workflow) |
Registerable | Object with a register property that returns workflow arrays |
Supported workflow types:
- Agents created with
pickaxe.agent()
- Tools created with
pickaxe.tool()
- Toolboxes created with
pickaxe.toolbox()
- Hatchet workflows created with the Hatchet SDK
WorkerLabels Type
Worker labels for affinity-based assignment and routing:
Property | Type | Description |
---|---|---|
[key] | string | number | Label key-value pairs for worker classification |
Common label examples:
Returns
Type: Promise<undefined | void[]>
Returns a promise that resolves when the worker starts successfully. The exact return value depends on the underlying Hatchet worker implementation.
Auto-Discovery
When register
is omitted, Pickaxe automatically discovers workflows from an internal registry that gets populated when you create:
- Agents: Added when calling
pickaxe.agent()
- Tools: Added when calling
pickaxe.tool()
- Toolboxes: Added when calling
pickaxe.toolbox()
Worker Configuration
Concurrency Control
Parameter | Default | Purpose |
---|---|---|
slots | 100 | Regular workflow concurrency limit |
durableSlots | 1,000 | Durable workflow concurrency limit |
Worker Identification
name
: Identifies the worker in Hatchet dashboard and logslabels
: Used for workflow routing and worker affinity
Examples
Basic Auto-Discovery
Explicit Registration
Related
pickaxe.agent
- Create agents that get auto-discoveredpickaxe.tool
- Create tools that get auto-discoveredpickaxe.toolbox
- Create toolboxes that get auto-discovered- Hatchet Documentation - Learn more about the underlying workflow engine and worker configuration