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:
- Verify that
$.steps.enrichCompany.output.domain references exist in the declared schema
- Flag references to undeclared fields
- 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.
Problem
Step outputs are untyped. References like
$.steps.loadConfig.output.settings.apiUrlare not validated until runtime. Common failure modes:undefinedonError: continuereturnsnull→ downstream code step crashes on property access$.steps.X.output.foo.barr) are invisible until executionFlow 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 newone flow check) could then:$.steps.enrichCompany.output.domainreferences exist in the declared schemaonError: continueis referenced without a null guardWhy 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.