Skip to content

Feature request: optional output schema declarations for flow steps #95

@ameet

Description

@ameet

Problem

Step outputs are untyped. References like $.steps.loadConfig.output.settings.apiUrl are not validated until runtime. Common failure modes:

  • A step renames an output field → downstream steps silently get undefined
  • A step with onError: continue returns null → downstream code step crashes on property access
  • Typos in deeply nested paths ($.steps.X.output.foo.barr) are invisible until execution

Flow authors compensate with extensive regression tests and null-guard conventions like ($.steps.X || {}).output, but these are workarounds for a missing type layer.

Proposal

Optional schema declarations per step:

{
  "id": "enrichCompany",
  "type": "code",
  "outputSchema": {
    "type": "object",
    "properties": {
      "domain": { "type": "string" },
      "founded": { "type": "number" },
      "funding": { "type": "number" }
    },
    "required": ["domain"]
  },
  "code": { "source": "..." }
}

one validate (or a new one flow check) could then:

  1. Verify that $.steps.enrichCompany.output.domain references exist in the declared schema
  2. Flag references to undeclared fields
  3. Warn when a step with onError: continue is referenced without a null guard

Why this matters

As flow count grows, untyped step references become the dominant source of runtime bugs. Even optional schemas (only validated when present) would let authors opt into safety incrementally. This is especially valuable for shared/reusable flows where the author and consumer may be different people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions