@shipplane/core
Workflow state machine for DAG task execution. Core owns workflow validation, scheduling, retries, timeouts, cancellation, logs, events, and snapshots.
Core does not know about workers, threads, HTTP, SSH, or persistence — see @shipplane/orchestrator for dispatching tasks to workers.
Install
Usage
Public API
workflow(id)— creates an immutable workflow builder.workflow.fromJSON(definition)— hydrates a workflow builder from JSON.validateWorkflowDefinition(definition)— validates task ids, dependencies, cycles, config, and JSON-shaped data.createTaskRegistry()— creates an immutable task implementation registry.createRunner({ workflow, registry, onEvent })— creates a workflow runner.createRunner({ snapshot, registry, recovery, onEvent })— resumes a runner from a snapshot.
Runner methods
start()resume()retryInterrupted()cancel()cancelTask(taskId)snapshot()on("event", handler)getLogs(taskId)getLastLog(taskId)
Task context
Task handlers receive:
runId,taskId,attemptparamsoutputsfrom direct dependenciessignalfor cancellation and timeoutlog(message, meta?)call(fn, input)for abort-aware helper calls
Task output must be string | void.