Steps Overview

A Flow consists of multiple steps, each doing a specific task — generating objects with an LLM, training a model, creating images, or transforming and combining data. Steps run sequentially, in the order they appear in your Flow’s steps array.

Step execution

When a Flow runs:

  1. Initialize — the user’s input is validated and stored.
  2. Step-by-step execution — each step runs in sequence: Step 0 → Step 1 → Step 2 → …
  3. Results — if a step succeeds, its output is stored under $.results.[stepId].
  4. Referencing outputs — later steps can read prior steps’ results via JSON Path.

You cannot reference results of a future step. Step 1 can’t read data from Step 3, because Step 3 hasn’t run yet. If you try, you’ll get an error.

If any step fails, the Flow run also fails. A partial result is still stored, indicating where it broke.

Step types

Linking steps via JSON Path

Each step writes its output to $.results.[stepId]. Subsequent steps can read from it:

{
  id: 'imageGen',
  type: 'ImageGenerator',
  parameters: {
    trainingId: '$.results.modelTrainer.id',
    images: [
      {
        prompt: 'A painting of a cat in the style of $$',
      },
    ],
  },
}

Flow Language in steps

You can use the Flow Language to transform or select fields in any step’s parameters or result fields:

  • "$.input.someField" — references user input
  • "$.results.someStep.nestedValue" — references a previous step’s output
  • @Map, @Extend, @Index, @Format, @Replace — operators for looping, merging, and string manipulation
{
  id: 'transformer1',
  type: 'ObjectTransformer',
  result: {
    expandedData: [
      [
        '@Map($.results.objectGenStep.items, i)',
        {
          '@Extend': '$$',
          index: '@Index(i)',
        },
      ],
    ],
  },
}

This maps each item from objectGenStep.items, merges it into the new object, and adds an index field.

Example

steps: [
  {
    id: 'objectGen',
    type: 'ObjectGenerator',
    parameters: {
      description: 'Generate product descriptions.',
      schema: { type: 'object', properties: { products: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, tagline: { type: 'string' } } } } } },
      input: '$.input.category',
    },
  },
  {
    id: 'myModel',
    type: 'ModelGenerator',
    parameters: {
      datasetId: '$.input.photos',
      settings: { baseModel: 'stable-diffusion-v1-5/stable-diffusion-v1-5', epochs: 40 },
    },
  },
  {
    id: 'imageGen',
    type: 'ImageGenerator',
    parameters: {
      trainingId: '$.results.myModel.id',
      baseModel: 'stable-diffusion-v1-5/stable-diffusion-v1-5',
      images: [
        ['@Map($.results.objectGen.products)', { prompt: '$$.tagline', steps: 25 }],
      ],
    },
  },
  {
    id: 'zipEverything',
    type: 'Zipper',
    parameters: {
      sources: ['imageGen', 'objectGen'],
      filename: 'all_results.zip',
    },
  },
],

Last updated on March 19, 2026