Flow introduction
This documentation will guide you through Flows, a system that allows you to chain multiple computation steps (like generating text, training models, zipping data, etc.) into a single pipeline. Flows can be publicly accessible (where other users can run them) or private to your own organization.
What is a Flow?
A Flow is a configurable sequence of steps, each step performing a specific action:
- ObjectGenerator: Generates JSON objects (e.g. via LLMs) based on a description and schema
- ModelGenerator: Spins up a training job (e.g. fine-tuning a model on custom data)
- ImageGenerator: Creates images from prompts or from newly trained models
- ObjectTransformer: Transforms JSON data with powerful JSON Path operators
- Zipper: Bundles various outputs (JSON, images, etc.) into a downloadable archive
Users define these steps along with the user-facing inputs and the desired outputs. Every Flow has:
- Schema-based input: Typically in JSON Schema.
- UI Configuration: For example, how the form to collect inputs should look and how final results should be displayed.
- Step Definitions: A list of step objects describing what to do, in what order.
Fields Overview
| Field | Type | Description |
|---|---|---|
title | string | A human-readable title for your Flow. Displayed on the Flow page and in dashboards. |
description | string | Short text explaining what your Flow does. Also shown on the Flow page. |
public | boolean | Indicates if the Flow is publicly accessible (true) or private (false). Public flows can be run by anyone with the link, and can have a price set. |
runPrice | number (4-200) | Price charged per run if the Flow is public. This is a simple integer or float (e.g., 12) representing the cost in runPriceCurrency. |
runPriceCurrency | string | The ISO currency code (e.g. "USD", "EUR", "BRL") for the runPrice. If omitted, defaults might apply. |
payoutMethod | string ("Wallet" / "Connect") | How you want to receive money from paid Flow runs: "Wallet": The platform’s internal balance. "Connect": Payout via a Connected Account. |
input | object (JSON Schema) | Describes the user input form. See Flow Input & Form for details on how to define and validate user data (text fields, file uploads, etc.). |
steps | array of step objects | The sequence of computation steps. Each step has an id, type, and parameters. See Step Types for a breakdown of ObjectGenerator, ModelGenerator, ImageGenerator, ObjectTransformer, and Zipper. |
store | object | Optional store configuration where you can define an object that will be available to all steps. |
ui | object | Optional UI overrides/config where you can define how the flow page is presented to your users. See UI Overview. Besides presentational configurations, you can define results.widgets to specify how final results appear. See Flow Results & Widgets. |
slug | string | A unique identifier for referencing this Flow in URLs. If not provided, one will be auto-generated or you can manage it in the platform’s UI. It is a unique field, so you can only use slugs that aren’t already taken |
Example Flow
Below is a simplified snippet of a Flow that:
- Takes user text input describing a recipe style.
- Takes an uploaded dataset of user photos.
- Generates textual recipes, trains a model on the photos, and then generates images of that user with the new recipes.
{
"title": "You with different recipes!",
"description": "Train a model using photos of yourself and generate images with different recipes!",
"public": true,
"runPrice": 12,
"runPriceCurrency": "usd",
"input": {
"type": "object",
"required": ["userDatasetId"],
"properties": {
"recipeType": {
"type": "string",
"title": "Recipe type",
"placeholder": "Homemade japanese dishes"
},
"userDatasetId": {
"type": "string",
"title": "Your photos",
"dataset": true
}
}
},
"steps": [
{
"id": "recipesGenerator",
"type": "ObjectGenerator",
"parameters": {
"description": "You are a very experienced chef...",
"schema": {
/* JSON schema describing the recipe object */
},
"input": "$.input.recipeType"
}
},
{
"id": "recipeModelTrainer",
"type": "ModelGenerator",
"parameters": {
"settings": {
/* training hyperparams, etc. */
},
"datasetId": "$.input.userDatasetId"
}
},
{
"id": "ingredientsImageGenerator",
"type": "ImageGenerator",
"parameters": {
/* instructions for generating images of ingredients */
}
},
{
"id": "recipeImageGenerator",
"type": "ImageGenerator",
"parameters": {
/* instructions for final images with user + recipe */
}
},
{
"id": "zipOutput",
"type": "Zipper",
"parameters": {
"sources": [
"ingredientsImageGenerator",
"recipeImageGenerator",
"recipesGenerator"
]
}
}
]
}When this Flow runs, it will:
- Ask the user for a recipe type and a user dataset of photos.
- Generate a list of recipes with step-by-step instructions.
- Train a custom model on the user’s photos.
- Generate images (both ingredients and final dish images with the user).
- Zip everything for easy download.
Key Concepts
Public vs. Private Flows
- Private Flows: Only you (and your organization) can access and run these. They typically deduct credits from your own balance.
- Public Flows: Anyone who visits the URL can run them. These may cost a certain price you define per run. The user pays and you receive the payout through your connected account or your platform wallet.
Inputs
- Defined as a superset of JSON Schema (with a few custom fields for datasets, placeholders, etc.).
- You can nest properties or even reference data in the Flow itself using JSON Path.
Steps
- Each step has:
- An id (unique identifier).
- A type (ObjectGenerator, ModelGenerator, ImageGenerator, ObjectTransformer, Zipper).
- Parameters specific to that step (e.g., model config, schema definitions, prompts, etc.).
Store
- The store is a global object defined in the Flow configuration that is available to all steps during a run.
- It is a JSON object that can be used to store data that is needed by multiple steps.
- It can be useful for static data like a list of prompts to be iterated later on by another step like
ImageGenerator.
Results
- Steps can read from each other’s results using JSON Path, like
$.results.previousStepId. - The user sees a final set of “widgets” after the run completes (images, JSON objects, downloadable zip, etc.).
Costs & Billing
- Each step has an associated cost that deducts from the organization’s balance.
- When a Flow is public and has a price, external users pay via Stripe. The flow’s creator eventually receives the payout.
Last updated on