@output.ai/core package provides the workflow abstraction layer and worker runtime that connects to Temporal.
Installation
Worker Startup
When you runoutput dev, the CLI starts Docker Compose which launches a worker container. The worker executes the output-worker binary from this package, which:
- Scans your project for workflow files (
workflow.js), step files (steps.js,shared_steps.js), and evaluator files (evaluators.js) - Creates a catalog of all discovered workflows and their activities with metadata (name, description, input/output schemas)
- Connects to Temporal at the configured address (default:
localhost:7233) - Registers a catalog workflow that enables the API server to discover available workflows
- Starts the Temporal worker to process workflow executions
File Discovery
The worker scans yoursrc/workflows/ directory for these file patterns:
| File | Purpose |
|---|---|
workflow.js | Workflow definition (orchestration logic) |
steps.js | Step implementations (I/O operations) |
evaluators.js | Evaluator implementations (return evaluation results) |
shared_steps.js | Reusable steps across workflows |
How Temporal Connects
The Output Core SDK abstracts Temporal’s native concepts:| Output SDK | Temporal Equivalent |
|---|---|
workflow() | Workflow Definition |
step() | Activity |
evaluator() | Activity (returns EvaluationResult) |
- Proxies the call through Temporal’s activity system
- Applies retry policies (default: 3 attempts, exponential backoff)
- Validates input/output against your Zod schemas
- Traces the execution for observability
Key Exports
workflow
Define an orchestrator that coordinates steps:step
Define a reusable unit that handles I/O:createWebhook
Pause a workflow until external input is received:Environment Variables
The worker reads these environment variables:| Variable | Default | Description |
|---|---|---|
CATALOG_ID | — | Required. Identifies this worker’s catalog (used as task queue name) |
TEMPORAL_ADDRESS | localhost:7233 | Temporal server gRPC address |
TEMPORAL_NAMESPACE | default | Temporal namespace |
TEMPORAL_API_KEY | — | API key for Temporal Cloud (enables TLS) |