Skip to main content
Glama

Start Async Pipeline (DAG of predictions)

replicate_pipeline_start

Run 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

TableJSON Schema
NameRequiredDescriptionDefault
stepsYesPipeline steps. 1–20 steps.
downloadNoDownload step outputs locally. Default: true.
ttl_hoursNoHow long to keep pipeline results in memory (1–72h). Default: 1h. State is lost if the server restarts.
concurrencyNoMax simultaneous steps (1–5). Default: 3.
timeout_ms_per_stepNoPer-step prediction timeout ms (5000–1800000). Default: 300000 (5min).
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses async nature, polling needed, parallel execution, template syntax for dependencies, per-step timeout, TTL with state loss on restart, and download option. Adds substantial context beyond annotations indicating a mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with summary, important note, template reference, args, return, and example. Slightly lengthy but front-loaded and each sentence serves a purpose. Minor redundancy could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all parameters, dependencies, timeouts, TTL, download, and return value. Includes polling guidance and example. No output schema but explains what to expect. Complete for a complex pipeline tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds significant value: explains template syntax for step dependencies, automatic dependency inference, and provides a detailed example. Baseline 3 exceeded due to extra context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it runs a DAG of predictions as a background job, returning a pipeline_id immediately. It distinguishes from siblings like replicate_run_model by emphasizing concurrent step execution and dependency handling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises that model must be a full Replicate identifier and not shortcuts, directing to replicate_get_model_schema for lookup. Provides an example but does not explicitly contrast with sibling tools like replicate_batch_start.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sena-labs/replicate-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server