Manage Turbo Pipelines with “turbo”
ctx.turbo lets a task create and manage Turbo pipelines and
jobs from inside your Compose app. Use it to spin up a pipeline in
response to an on-chain event, kick off a one-time backfill and poll it to completion, or pause and
clean up pipelines your app owns.
A Turbo job is a pipeline whose definition has job: true — it runs to completion and then exits,
rather than streaming forever. ctx.turbo.createJob is a shortcut for createPipeline with that flag
set.
How pipelines are named and cleaned up
Pipelines you create throughctx.turbo are namespaced under your Compose app. You pass a plain name
like token-transfers, and the pipeline is registered internally with your app’s prefix. Every method
handles the prefix for you, so you always refer to pipelines by the plain name you gave them, and
listPipelines only returns pipelines that belong to your app.
The upshot is that when your Compose app is deleted, the pipelines it created are deleted with it — you
don’t have to track and tear them down yourself.
The namespaced name (app prefix included) has a length limit. If your app name plus the pipeline
name is too long,
createPipeline throws. Keep pipeline names short and the error message tells you
the maximum.Methods
Config types
Response types
definition is the same pipeline configuration you’d write in
YAML, expressed as an object. Reads (getPipeline, getStatus, listPipelines, getLogs,
getState, validate) retry on transient failures by default; the mutating methods do not. Every call
is recorded as a span on the task run, like ctx.fetch.
Examples
Kick off a one-time backfill (job)
Create a streaming pipeline in response to an event
Poll a job until it finishes
Validate before deploying
List, pause, and delete the pipelines your app owns
Next Steps
Turbo Pipelines
Learn how Turbo pipelines, sources, transforms, and sinks work.
Job mode
Run a pipeline as a one-time job that exits when it’s done.