Function block resolving
When a functionBlockId
provided in a workflow step contains only a partial version (e.g., just the major version), the Neops Workflow Engine resolves it by selecting the newest available function block that matches the given constraints, following strict semantic versioning rules.
Version Resolution Behavior
The engine uses a hierarchical matching process to resolve the best matching version:
Input Version | Resolution Strategy |
---|---|
1.2.3 |
Exact match – must match all parts exactly. |
1.2 |
Patch match – finds the highest 1.2.* patch version. |
1 |
Minor+Patch match – finds the highest 1.*.* version under major 1 . |
None | Error – At least the major version needs to be specified, as an increase in major version implies a breaking change (see Semantic versioning). |
Implementation Logic
The resolution uses descending order sorting on version components:
const versionOrdering: OrderDefinition<FunctionBlock> = {
majorVersion: 'desc',
minorVersion: 'desc',
patchVersion: 'desc'
};
This ensures the most recent compatible version is selected, based on the level of detail specified in the functionBlockId
.
Example
If the following versions exist for network/ping
:
1.0.0
1.1.0
2.0.0
Then:
network/ping:1
→ resolves to1.1.0
network/ping:1.0
→ resolves to1.0.0
network/ping
(no version) → resolves to2.0.0
This mechanism allows workflows to remain flexible and benefit from version updates without requiring constant changes to definitions—while still supporting version pinning for stability when needed.
Would you like me to add a summary table or a flowchart to visually represent the resolution steps?