windmill-labs/windmill · error

No data given

Error message

No data given

What it means

`resolve()` in the Windmill CLI turns a string input into a resolved record (reading stdin, files, or URLs). It refuses to proceed when called with an empty or falsy input string, throwing 'No data given'. This is a guard against silently producing an empty object from missing arguments.

Source

Thrown at cli/src/commands/script/script.ts:1378

      break;
    }
  }

  if (opts.json) {
    console.log(JSON.stringify(total));
  } else {
    new Table()
      .header(["path", "summary", "language", "created by"])
      .padding(2)
      .border(true)
      .body(total.map((x) => [x.path, x.summary, x.language, x.created_by]))
      .render();
  }
}

export async function resolve(input: string): Promise<Record<string, any>> {
  if (!input) {
    throw new Error("No data given");
  }

  if (input == "@-") {
    const chunks: Buffer[] = [];
    for await (const chunk of process.stdin) chunks.push(chunk);
    input = new TextDecoder().decode(Buffer.concat(chunks));
  }
  if (input[0] == "@") {
    input = await readTextFile(input.substring(1));
  }
  try {
    return JSON.parse(input);
  } catch (e) {
    console.error("Impossible to parse input as JSON", input);
    throw e;
  }
}

View on GitHub (pinned to e474e8803c)

Solutions

  1. Pass a non-empty input value (e.g. `--data '{"key":"value"}'`).
  2. If reading from stdin with `@-`, verify the upstream command actually emits bytes (pipe through `tee /dev/stderr` to check).
  3. Check the shell variable feeding the argument is set before invoking the CLI.
  4. If intentionally running with empty input, supply `{}` as the payload instead of an empty string.

Example fix

// before
wmill flow run my_flow --data "$DATA"   # DATA is empty
// after
: "${DATA:={}}"
wmill flow run my_flow --data "$DATA"
Defensive patterns

Strategy: validation

Validate before calling

const input = process.env.DATA ?? '';
if (!input || input.trim() === '') {
  throw new Error('Refusing to run: --data/stdin input is empty');
}
// then pass --data "$DATA"

Prevention

When it happens

Trigger: Calling `wmill` script/app run flows that resolve an input argument when the `--data` flag is empty, an empty string is piped in, or a variable expanding to the input is unset so `resolve('')` is invoked.

Common situations: Forgetting `--data=` on a run command; a shell variable like `$INPUT` empty due to a failed prior command; piping from a file/stdin that produced zero bytes before `@-` handling; CI pipelines where a previous step's output variable was never set.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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