Skip to content

Releases: Particle-Academy/fancy-flow

v0.10.1 — cross-runtime port parity

Choose a tag to compare

@wishborn wishborn released this 20 Jul 02:16

Cross-runtime port parity

Exported documents now carry each node's resolved inputs / outputs.

A kind may derive its ports from config (switch_case's cases, llm_branch's routes), and that derivation is a JavaScript function. The exported WorkflowSchema node carried only { id, kind, position, label, description, config }, so a runtime in another language could not reproduce those ports.

Before 0.9.0 this was harmless: the TS runtime also read only data.outputs (absent after import) and fell back to a single out, exactly as the PHP twin did. Both were equally wrong and therefore agreed. 0.9.0 made TS resolve ports through the kind — correct on Node, and silently divergent from PHP.

Export now writes the resolved ports onto each schema node and import carries them back, so the document is self-describing and any language's runtime routes identically. Both fields are optional and additive; older documents keep working, and each runtime falls back to its own kind registry (see fancy-flow-php 0.4.2).

Who was actually affected — narrower than first reported

Only kinds that rely on DECLARED ports to fan out. A kind whose executor returns an explicit port — { __port } / { branch } in TS, Port::only(...) in PHP — short-circuits before the declared-ports fallback and was never affected. That covers the common branching case, including switch_case and llm_branch implementations that return their chosen port.

Our first advisory said branch edges would stop firing generally. That overstated it, and we're correcting it here: verified on the old pairing, a node returning an explicit port routes to the correct downstream node with no declared outputs present. Thanks to the moic-suite team for catching the over-broad claim and checking it against a running suite rather than taking our word for it.

If you saved documents between 0.9.0 and 0.10.1, re-export them — those recorded no ports and depend on the registry fallback rather than the document.

A testing note worth stealing

A test that asserts the recorded port on a branching node (outputs['router']['__port']) stays green even when no edge fires and the run stops dead at the branch — the exact failure mode above. Assert that the downstream node executed, and that its sibling did not. Credit to moic-suite, who found this in their own suite.