windmill-labs/windmill · error

Step '${stepId}' not found in flow. Available steps: ${avail

Error message

Step '${stepId}' not found in flow. Available steps: ${available}

What it means

`wmill flow preview --step <stepId>` looks up the step inside the local flow value via findStepInFlowValue; when no module matches the given id it throws, listing every valid step id collected from the flow for comparison.

Source

Thrown at cli/src/commands/flow/flow.ts:779

    log.info(colors.bold.underline.green("Flow preview completed"));
    log.info(JSON.stringify(result, null, 2));
  }
}

async function previewStep(
  stepId: string,
  localFlow: FlowFile,
  flowWmPath: string,
  workspace: { workspaceId: string },
  baseArgs: Record<string, unknown>,
  tempScriptRefs: Record<string, string> | undefined,
  silent: boolean,
  tag: string | undefined,
) {
  const module = findStepInFlowValue(localFlow.value, stepId);
  if (!module) {
    const available = collectStepIds(localFlow.value).join(", ") || "(none)";
    throw new Error(`Step '${stepId}' not found in flow. Available steps: ${available}`);
  }

  // The preprocessor module receives args via _ENTRYPOINT_OVERRIDE so the
  // runner picks the preprocessor entrypoint (matches frontend behavior in
  // copilot/chat/flow/core.ts).
  const args =
    stepId === "preprocessor"
      ? { _ENTRYPOINT_OVERRIDE: "preprocessor", ...baseArgs }
      : baseArgs;

  const moduleValue = module.value;
  let jobId: string;
  if (moduleValue?.type === "rawscript") {
    log.info(colors.yellow(`Previewing step '${stepId}' (rawscript, ${moduleValue.language})...`));
    jobId = await wmill.runScriptPreview({
      workspace: workspace.workspaceId,
      requestBody: {
        content: moduleValue.content ?? "",

View on GitHub (pinned to e474e8803c)

Solutions

  1. Use one of the ids printed in 'Available steps' in the error message
  2. Check the module ids in the local flow.yaml and correct the --step argument
  3. Re-pull the flow (`wmill flow pull`) if the local copy is stale

Example fix

// before
wmill flow preview .flow/__flow --step fetch_data
// after
wmill flow preview .flow/__flow --step fetchData  # id shown in 'Available steps'
Defensive patterns

Strategy: validation

Validate before calling

const flow = await fsp.readFile(join(flowPath, 'flow.yaml'), 'utf8').then(parseFlowYaml);
const ids = collectStepIds(flow.value);
if (!ids.includes(stepId)) throw new Error(`step '${stepId}' not in flow; available: ${ids.join(', ')}`);

Prevention

When it happens

Trigger: `wmill flow preview <flowPath> --step <id>` where the id is misspelled, refers to a step that was renamed/removed locally, or uses the wrong id form (nested/subflow ids).

Common situations: Editing flow.yaml by hand and forgetting to update a step reference; running an old command from shell history after refactoring the flow; wrong casing of the step id.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/cdaa9ad6bbff51bd. Report an issue: GitHub.