Skip to content

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, and version (semantic versioning).
    • Categorized by type (FunctionBlockType) such as:
      • CONFIGURE: Device configuration changes
      • FACTS: Data collection
      • CHECK: Validation/compliance checks
      • EXECUTE: Arbitrary operations
      • NONE: Special-case logic
  • Parameterized Execution:

    • Used via ParametrizedFunctionBlock, which is a type of WorkflowStep.
    • Includes runtime parameters and metadata like retry config and execution target (runOn).
    • Always refers to a specific version of a function block.
  • Version Management:

    • Adheres to semantic versioning: major.minor.patch
    • Repository logic supports best-match queries when partial versions are given.
  • Registration and Lifecycle:

    • Registered via a FunctionBlockRegistration entity, maintaining a 1:1 relationship.
    • Can be soft-deleted (marked deprecated) without removing from the database.
  • 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?