Start Async Pipeline (DAG of predictions)
replicate_pipeline_startRun a directed acyclic graph (DAG) of Replicate predictions as a background job. Chain steps with template references for concurrent execution and automatic dependency resolution.
Instructions
Run a directed acyclic graph (DAG) of Replicate predictions as a background job. Returns a pipeline_id immediately. Poll replicate_pipeline_status for per-step progress and results.
Independent steps run concurrently. Downstream steps auto-start when their dependencies complete. Use "$stepId.field[n]" template strings to pass one step's output as another step's input.
IMPORTANT: model must be a full Replicate identifier ("owner/name" or "owner/name:version"). Curated shortcuts (e.g. "flux-schnell") are not supported — look up the full id via replicate_get_model_schema.
Template reference syntax: "$gen.urls[0]" → first URL output of step "gen" "$gen.urls" → full URLs array "$gen.local_paths[0]" → first downloaded local path "$gen.text_output[0]" → first text output (for LLMs)
Args:
steps (array, 1–20): Pipeline steps. Each: { id, model, input, depends_on? }. depends_on is inferred from $ref patterns in input when omitted.
concurrency (1–5, default 3): Max simultaneous steps.
download (boolean, default true): Download step outputs locally.
timeout_ms_per_step (default 300000): Per-step timeout.
ttl_hours (1–72, default 1): How long to keep results in memory. Lost on server restart.
Returns: { pipeline_id, total, message }
Example — generate + upscale + remove background in parallel: steps=[ { "id": "gen", "model": "black-forest-labs/flux-schnell", "input": { "prompt": "a fox" } }, { "id": "upscale", "model": "nightmareai/real-esrgan", "input": { "image": "$gen.urls[0]", "scale": 4 } }, { "id": "no_bg", "model": "lucataco/remove-bg", "input": { "image": "$gen.urls[0]" } } ] upscale and no_bg both depend on gen, run in parallel after gen completes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | Pipeline steps. 1–20 steps. | |
| download | No | Download step outputs locally. Default: true. | |
| ttl_hours | No | How long to keep pipeline results in memory (1–72h). Default: 1h. State is lost if the server restarts. | |
| concurrency | No | Max simultaneous steps (1–5). Default: 3. | |
| timeout_ms_per_step | No | Per-step prediction timeout ms (5000–1800000). Default: 300000 (5min). |