@shipplane/orchestrator
@shipplane/orchestrator dispatches tasks from an @shipplane/core workflow to workers. Core manages workflow state and scheduling while the orchestrator handles task execution.
The current alpha exports gateways for in-memory workers and worker threads. HTTP and SSH adapters are planned but not yet available.
Install
Usage
Public API
Main export (@shipplane/orchestrator):
createOrchestrator({ store, workerGateway, recovery? })startRun({ workflow })waitForRun(runId)cancelRun(runId)cancelTask(runId, taskId)
createDispatchingTaskRegistry({ workflow, gateway })createInMemoryWorkerDirectory({ heartbeatTimeoutMs?, now? })createLeastActiveWorkerRouter(directory)createRoutingWorkerGateway({ directory, router, endpoints })WorkerGateway,WorkerJob,WorkerResultMessage
Subpath exports
@shipplane/orchestrator/storecreateInMemoryOrchestratorStore({ deepClone?, maxEvents?, maxSnapshots?, onEvent? })OrchestratorStore
@shipplane/orchestrator/workercreateWorkerRuntime({ workerId, handlers })runtime.run(job, context)runtime.cancel(jobId)runtime.stop()
@shipplane/orchestrator/worker/in-memorycreateInMemoryWorkerGateway()gateway.registerWorker({ workerId, handlers })
@shipplane/orchestrator/worker/threadcreateWorkerThreadGateway(worker)createPooledWorkerThreadGateway({ directory, router, workers })createWorkerThreadWorker({ workerId, handlers, port })
Next steps
- Build a custom adapter for your worker backend.
- Route tasks across workers by capability and health.
- Handle events and recover runs.