Class Definition
Type Parameters
| Parameter | Description |
|---|---|
InSchema | Input schema type (Zod shape) |
OutSchema | Output schema type |
In | Inferred input type |
Out | Inferred output type |
Properties
| Property | Type | Description |
|---|---|---|
metadata | JobMetadata | Job metadata (name, description, retry, etc.) |
input | In | Parsed and validated input |
output | Out | undefined | Job output (after execution) |
jobName | string | Job name |
jobId | string | Job ID (or name if not specified) |
Abstract Method
execute(input)
The main execution method that must be implemented.Methods
Response Methods
respond(value)
Set output and end execution immediately.Logging Methods
log(message)
Append a timestamped log entry to the job’s log buffer.getLogs()
Get all log entries recorded during execution.Progress Methods
progress(pct, total?, msg?)
Send a progress notification to the client. Returnsfalse if no session is available.
Retry Tracking
attempt
The current retry attempt number (1-based).Inherited Methods
FromExecutionContextBase:
| Method | Description |
|---|---|
get(token) | Resolve a required dependency |
tryGet(token) | Resolve an optional dependency (returns undefined if not found) |
scope | Access the current scope |
logger | Scoped logger instance |
getAuthInfo() | Get authentication context |
fail(error) | Fail execution with an error |
mark(stage) | Mark current execution stage |
fetch(url, options?) | Context-aware HTTP fetch |
Full Example
Related
@Job
Job decorator
ExecutionContextBase
Base class
JobRegistry
Job registry
Jobs Guide
Jobs documentation