Function Block
A *Function Block- in the Neops Workflow Engine is a reusable, versioned component that encapsulates a specific operation or logic step within a workflow. It is a core building block used to define automation logic in a modular, composable way.
Structure
-
Entity Definition:
- Identified by a combination of
package
,name
, andversion
(semantic versioning). - Categorized by type (
FunctionBlockType
) such as:CONFIGURE
: Device configuration changesFACTS
: Data collectionCHECK
: Validation/compliance checksEXECUTE
: Arbitrary operationsNONE
: Special-case logic
- Identified by a combination of
-
Parameterized Execution:
- Used via
ParametrizedFunctionBlock
, which is a type ofWorkflowStep
. - Includes runtime parameters and metadata like retry config and execution target (
runOn
). - Always refers to a specific version of a function block.
- Used via
-
Version Management:
- Adheres to semantic versioning:
major.minor.patch
- Repository logic supports best-match queries when partial versions are given.
- Adheres to semantic versioning:
-
Registration and Lifecycle:
- Registered via a
FunctionBlockRegistration
entity, maintaining a 1:1 relationship. - Can be soft-deleted (marked deprecated) without removing from the database.
- Registered via a
-
Execution Flow:
- During workflow execution, function blocks are converted into jobs.
- Results are tracked via job result entities, often including device/group updates.
Example Usage in Workflow
{
"type": "functionBlock",
"functionBlockId": "fb.neops.io/ping:1.0.0",
"parameters": {
"host": "192.168.0.1",
"timeout": 5
},
"runOn": "device"
}
This encapsulation allows for consistency, reuse, and traceability across different workflows and execution runs.
Would you like a diagram showing how function blocks integrate into the workflow execution model?