Flows Overview

Visual workflows that chain apps together.

Flows let you build multi-step processes without code. Connect apps, map data between them, and create powerful pipelines.


Why Flows?

Some tasks need multiple steps:

  • Image Pipeline: Generate → Upscale → Remove Background → Resize
  • Content Creation: Research → Write → Edit → Format
  • Data Processing: Extract → Transform → Analyze → Report

Instead of running each app manually, build a flow once and run it with one click.


Creating a Flow

From the Workspace

  1. Go to Flows
  2. Click New Flow
  3. The visual editor opens

The Editor

code
1┌───────────────┬──────────────────────────────────────────────────┐2│               │                                                   │3│   Nodes       │                   Canvas                          │4│               │                                                   │5│   ┌─────────┐ │    ┌───────┐     ┌───────┐     ┌───────┐        │6│   │ + Input │ │    │ Input │ ──▶ │ App A │ ──▶ │Output │        │7│   └─────────┘ │    └───────┘     └───────┘     └───────┘        │8│               │                                                   │9│   ┌─────────┐ │                                                   │10│   │ + App   │ │                                                   │11│   └─────────┘ │                                                   │12│               │                                                   │13│   ┌─────────┐ │                                                   │14│   │ + Output│ │                                                   │15│   └─────────┘ │                                                   │16│               │                                                   │17└───────────────┴──────────────────────────────────────────────────┘

Building Step by Step

  1. Add an Input node — Define what the flow accepts
  2. Add App nodes — Drag apps from the sidebar
  3. Connect nodes — Click and drag between ports
  4. Map data — Configure how outputs flow to inputs
  5. Add an Output node — Define what the flow returns

Connecting Apps

Visual Connections

Drag from an output port to an input port:

code
1┌──────────────┐          ┌──────────────┐2│  Image Gen   │          │   Upscale    │3│              │          │              │4│      image ──┼──────────┼──▶ image     │5└──────────────┘          └──────────────┘

Data Mapping

Click a node to configure how data flows:

yaml
1# Upscale node receives:2image: "{{image_gen.output.image}}"   # From previous app3scale: 2                               # Static value

Mapping Syntax

PatternExampleDescription
Previous output{{app_name.output.field}}Data from another node
Flow input{{input.field}}Data from flow input
Static value"hello" or 42Fixed value
Nested{{app.output.data.nested}}Access nested fields

Example: Image Enhancement Flow

The Flow

code
1Upload Image ──▶ Upscale (2x) ──▶ Enhance Colors ──▶ Download

Configuration

Input Node:

  • image (file) — The image to enhance

Upscale Node:

  • App: esrgan
  • Input: image ← {{input.image}}
  • Input: scale ← 2

Enhance Node:

  • App: color-enhance
  • Input: image ← {{upscale.output.image}}
  • Input: saturation ← 1.2

Output Node:

  • result ← {{enhance.output.image}}

Running

  1. Click Run
  2. Upload an image
  3. Watch each step execute
  4. Download the enhanced result

Run via API

Trigger a saved flow from code without deploying it as an app.

API and CLI runs use the flow's published version when one exists, and the current draft otherwise. flow_version_id on the run shows which version ran.

CLI — belt flow run <ref> with optional JSON input and -f to stream progress. <ref> is namespace/name or a flow ID. Input resolves from --input, a positional argument, or piped stdin (in that order):

bash
1belt flow run myteam/voice-pipeline --input '{"text":"hello"}' -f2belt flow run abc123 '{"text":"hello"}' -f              # short ID; positional input3echo '{"text":"hello"}' | belt flow run myteam/voice-pipeline -f   # stdin4belt flow runs5belt flow run-get <run-id> -f

→ CLI setup — JSON input

→ CLI setup — Flows

REST — POST /flowruns with the flow ID and inputs (requires flows:execute scope):

bash
1curl -X POST https://api.inference.sh/flowruns \2  -H "Authorization: Bearer inf_your_key" \3  -H "Content-Type: application/json" \4  -d '{"flow":"flow_abc123","input":{"image":"file_abc"}}'

The response includes a task_id — use the Tasks API for status, logs, and cost. Stream per-step updates with GET /flowruns/{id}/stream or GET /flowruns/{id}/tasks/stream.

JavaScript SDK:

typescript
1const run = await client.flowRuns.create('flow_abc123', { image: 'file_abc' });

→ Flow Runs API — list, cancel, clone, and SSE streams

If you deploy the flow as an app, callers use POST /run with the app ref instead — see Deploying Flows as Apps and Running Apps.


Flows as Agent Tools

Flows become powerful agent tools. Add a flow to an agent just like an app:

code
1You: Enhance this photo and make it ready for Instagram23Agent: I'll use the image-enhancement flow to process your photo.4       [Running image-enhancement flow...]5       6       Done! Here's your enhanced image, optimized for Instagram.

The agent sees the flow as a single tool, but it executes all the steps.


Deploying Flows as Apps

Turn your flow into a versioned app:

  1. Open your flow
  2. Click Deploy as App
  3. Configure:
    • Name
    • Description
    • Category
  4. Click Deploy

Now your flow:

  • Has its own API endpoint
  • Can be versioned
  • Appears in the Grid
  • Can be used by anyone (if public)

Flow Execution

When a flow runs:

code
1┌─────────────────────────────────────────────────────────────┐2│  Flow: image-enhancement                                     │3├─────────────────────────────────────────────────────────────┤4│                                                              │5│  ● Input          ✓ Complete                                │6│    └─ image uploaded                                        │7│                                                              │8│  ● Upscale        ✓ Complete (12s)                          │9│    └─ 512x512 → 1024x1024                                   │10│                                                              │11│  ● Enhance        ◐ Running...                              │12│    └─ Applying color enhancement                            │13│                                                              │14│  ○ Output         ○ Pending                                 │15│                                                              │16└─────────────────────────────────────────────────────────────┘

Each step shows:

  • Status (pending, running, complete, failed)
  • Duration
  • Logs and progress

In the v2 flow editor, utility nodes (gate, selector, merge, constant) create no task. The editor reads a node's status from its task in node_tasks when it has one, and from node_statuses on the flow run otherwise (see Flow Runs API: Per-node progress).

NodeRun-time feedback
Utility nodesBorder follows status: purple while ready or running, green when completed, red when failed or cancelled, grey when blocked
GateStatus pill reads passed when the condition was true and blocked when it was false
Constant, MergePreview of node_outputs[nodeId].value (for example → 42). The merge preview is cut at 80 characters

The output panel shows the flow's output when it arrives, and a loader while the run is in progress without output. When the run ends without output:

Flow run statusOutput panel
Completedno output yet (for example, the output mappings point at a blocked branch)
Failedflow error with the run's error message
Cancelledflow cancelled

Tips

Start Simple

Begin with 2-3 apps, then expand:

code
1❌ Don't: Build a 10-step flow immediately2✓ Do: Start with 2 apps, test, add more

Name Nodes Clearly

code
1❌ Don't: step1 → step2 → step32✓ Do: generate_image → upscale → remove_bg

Test Each Connection

Run the flow after adding each new node to catch issues early.


What's Next?

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.