Skip to content

Function Blocks

Function blocks are the core building blocks of neops automation. Each one is a small, typed Python class that encapsulates a single task — reading a device configuration, deploying a template, verifying compliance, or discovering inventory.

The workflow engine composes function blocks into workflows, schedules them across workers, and handles retries, rollbacks, and result persistence. You focus on the automation logic; the platform handles the orchestration.

In This Section

Guide What you'll learn
Anatomy Parameters, results, registration, and the function block lifecycle
Working with Data The WorkflowContext, entity access, facts, checks, and configurations
Creating Entities Adding devices, interfaces, and groups from within a function block
Pure and Idempotent Safety semantics and their implications for workflows
Async and Concurrency Parallel execution, thread offloading, and the blocking detector
Advanced Patterns The acquire phase, rollback, splitting function blocks, error handling
Best Practices Naming, structure, logging, and common pitfalls

New to neops?

Start with the Getting Started guide first. This section assumes you have already written and run a basic function block.