Declared outputs are collected by the same mapping, in reverse
The output side of the manifest, with one distinction that matters: a node that produced null produced something, and is not the same as a node that produced nothing.
The rule
- Each declared output name MUST resolve to the result the bound node produced on the bound port.
- Presence MUST be decided by whether the key exists.
- A null value counts as produced, and MUST be returned.
- An output whose node produced nothing at all MUST be absent from the result, and a warning is logged.
- An unbound output MUST be absent from the result as well, without a warning, since nothing is meant to produce it yet.
- A malformed output entry MUST be skipped.
What it means
Presence is decided by whether the key exists, not by whether the value is
truthy. A node that produced null on its bound port produced something,
and that null is returned under the declared output name. That is different
from a node whose bound port never appears in what it produced at all — that
case is dropped from the result, with a warning, because there is nothing to
return.
An unbound output is absent too, and without a warning: nothing is meant to produce it yet. A malformed entry — one missing its name, or carrying only half a binding — is skipped without a warning: it never named a real output in the first place, so there is nothing to warn about.
Example
The workflow declares two outputs bound to the same node: answer, on its
text port, and hidden, on a debug port the node did not produce this
run.
{ "llm.1": { "text": null } }{ "answer": null }The debug port never appears in llm.1's results at all, so hidden is
dropped from the outputs, with a warning naming it. A malformed entry, such as one with an empty name, is
skipped the same way, but without the warning the dropped case above gets.
Why
Fixtures
Test cases whose outcome this rule decides. A case compares absent, null and empty members exactly; the fixtures README defines each operation. Where a case and the rule disagree, the rule is right.
An output whose node produced an empty value returns it collect-outputs
{ "given": { "outputs": [ { "name": "answer", "node_id": "n1", "port": "text" }, { "name": "items", "node_id": "n1", "port": "list" } ], "produced": { "n1": { "text": "", "list": [] } } }, "expect": { "result": { "answer": "", "items": [] } } }An output whose node produced nothing is absent collect-outputs
{ "given": { "outputs": [ { "name": "answer", "node_id": "n1", "port": "text" } ], "produced": { "n1": {} } }, "expect": { "result": {} } }An output whose node produced null returns null collect-outputs
{ "given": { "outputs": [ { "name": "answer", "node_id": "n1", "port": "text" } ], "produced": { "n1": { "text": null } } }, "expect": { "result": { "answer": null } } }An unbound output is absent, never null collect-outputs
{ "given": { "outputs": [ { "name": "summary", "schema": { "type": "string", "x-data-type": "string" } }, { "name": "answer", "node_id": "n1", "port": "text" } ], "produced": { "n1": { "text": "hello" } } }, "expect": { "result": { "answer": "hello" } } }