# nornir-automation/nornir architecture

> Architecture diagram of the GitHub repository nornir-automation/nornir, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nornir-automation/nornir
- Repository: https://github.com/nornir-automation/nornir

## Overview

Nornir is a Python framework for operating collections of devices: users initialize it with configuration and inventory, then submit Python tasks that run against selected hosts and return per-host results. Inventory loading and inheritance, host filtering, task execution, runner dispatch, processors, and device connections are distinct parts of that workflow. The README also emphasizes extensibility through plugins. The graph follows documented behavior and sampled source; unsampled modules are included only where their paths are present in the tree.

Main entry points: [`nornir/core/__init__.py`](https://github.com/nornir-automation/nornir/blob/main/nornir/core/__init__.py) (Nornir Runtime), [`nornir/init_nornir.py`](https://github.com/nornir-automation/nornir/blob/main/nornir/init_nornir.py) (Inventory Loading), [`nornir/core/plugins/register.py`](https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/register.py) (Plugin Registry), [`nornir/plugins/runners/__init__.py`](https://github.com/nornir-automation/nornir/blob/main/nornir/plugins/runners/__init__.py) (Task Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Initialization"]
  node_init["Nornir Initialization<br/>[init_nornir.py]"]
  node_config["Configuration<br/>[configuration.py]"]
  node_state["Global State<br/>[state.py]"]
end

subgraph group_inventory["Inventory"]
  node_inventoryload["Inventory Loading<br/>[init_nornir.py]"]
  node_simpleinv["Simple Inventory<br/>[simple.py]"]
  node_inventory["Inventory Model<br/>[inventory.py]"]
  node_filter["Host Filtering<br/>[filter.py]"]
end

subgraph group_execution["Task Execution"]
  node_nornir["Nornir Runtime<br/>[__init__.py]"]
  node_runner["Task Runner<br/>[__init__.py]"]
  node_task["Task Execution<br/>[task.py]"]
  node_processors["Task Processors<br/>[processor.py]"]
  node_results["Task Results<br/>[task.py]"]
  node_connections["Host Connections<br/>[inventory.py]"]
end

subgraph group_extensions["Plugin Interfaces"]
  node_registry["Plugin Registry<br/>[register.py]"]
  node_inventoryplugin["Inventory Plugin API<br/>[inventory.py]"]
  node_connectionplugin["Connection Plugin API<br/>[connections.py]"]
  node_runnerplugin["Runner Plugin API<br/>[runners.py]"]
end

node_user(("Python User"))
node_taskcode["Python Task"]
node_device(("Managed Devices"))
node_externalplugins["Installed Plugins"]

node_user -->|"initializes"| node_init
node_init -->|"loads settings"| node_config
node_init -->|"creates state"| node_state
node_init -->|"loads inventory"| node_inventoryload
node_inventoryload -->|"reads settings"| node_config
node_inventoryload -->|"resolves plugin"| node_registry
node_inventoryload -->|"uses interface"| node_inventoryplugin
node_simpleinv -->|"builds model"| node_inventory
node_inventoryload -.->|"instantiates"| node_simpleinv
node_user -->|"runs tasks"| node_nornir
node_nornir -->|"selects hosts"| node_inventory
node_nornir -->|"filters hosts"| node_filter
node_nornir -->|"dispatches task"| node_runner
node_nornir -->|"signals lifecycle"| node_processors
node_runner -->|"starts per host"| node_task
node_task -->|"invokes"| node_taskcode
node_task -->|"signals lifecycle"| node_processors
node_task -->|"records results"| node_results
node_runner -->|"aggregates results"| node_results
node_taskcode -->|"uses host access"| node_connections
node_connections -->|"resolves plugin"| node_registry
node_connections -->|"uses interface"| node_connectionplugin
node_connectionplugin -->|"connects to"| node_device
node_inventoryplugin -->|"registered through"| node_registry
node_runnerplugin -->|"registered through"| node_registry
node_externalplugins -.->|"advertises entries"| node_registry
node_runner -->|"implements interface"| node_runnerplugin
node_simpleinv -->|"implements interface"| node_inventoryplugin
node_results -->|"returns results"| node_nornir

click node_init "https://github.com/nornir-automation/nornir/blob/main/nornir/init_nornir.py"
click node_config "https://github.com/nornir-automation/nornir/blob/main/nornir/core/configuration.py"
click node_state "https://github.com/nornir-automation/nornir/blob/main/nornir/core/state.py"
click node_inventoryload "https://github.com/nornir-automation/nornir/blob/main/nornir/init_nornir.py"
click node_simpleinv "https://github.com/nornir-automation/nornir/blob/main/nornir/plugins/inventory/simple.py"
click node_inventory "https://github.com/nornir-automation/nornir/blob/main/nornir/core/inventory.py"
click node_filter "https://github.com/nornir-automation/nornir/blob/main/nornir/core/filter.py"
click node_nornir "https://github.com/nornir-automation/nornir/blob/main/nornir/core/__init__.py"
click node_runner "https://github.com/nornir-automation/nornir/blob/main/nornir/plugins/runners/__init__.py"
click node_task "https://github.com/nornir-automation/nornir/blob/main/nornir/core/task.py"
click node_processors "https://github.com/nornir-automation/nornir/blob/main/nornir/core/processor.py"
click node_results "https://github.com/nornir-automation/nornir/blob/main/nornir/core/task.py"
click node_connections "https://github.com/nornir-automation/nornir/blob/main/nornir/core/inventory.py"
click node_registry "https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/register.py"
click node_inventoryplugin "https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/inventory.py"
click node_connectionplugin "https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/connections.py"
click node_runnerplugin "https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/runners.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_init,node_config,node_state,node_user toneBlue
class node_inventoryload,node_simpleinv,node_inventory,node_filter toneAmber
class node_nornir,node_runner,node_task,node_processors,node_results,node_connections toneMint
class node_registry,node_inventoryplugin,node_connectionplugin,node_runnerplugin,node_taskcode toneRose
class node_device,node_externalplugins toneIndigo
```

## Components

### Initialization

- [Nornir Initialization](https://github.com/nornir-automation/nornir/blob/main/nornir/init_nornir.py): `nornir/init_nornir.py`
- [Configuration](https://github.com/nornir-automation/nornir/blob/main/nornir/core/configuration.py): `nornir/core/configuration.py`
- [Global State](https://github.com/nornir-automation/nornir/blob/main/nornir/core/state.py): `nornir/core/state.py`

### Inventory

- [Inventory Loading](https://github.com/nornir-automation/nornir/blob/main/nornir/init_nornir.py): `nornir/init_nornir.py`
- [Simple Inventory](https://github.com/nornir-automation/nornir/blob/main/nornir/plugins/inventory/simple.py): `nornir/plugins/inventory/simple.py`
- [Inventory Model](https://github.com/nornir-automation/nornir/blob/main/nornir/core/inventory.py): `nornir/core/inventory.py`
- [Host Filtering](https://github.com/nornir-automation/nornir/blob/main/nornir/core/filter.py): `nornir/core/filter.py`

### Task Execution

- [Nornir Runtime](https://github.com/nornir-automation/nornir/blob/main/nornir/core/__init__.py): `nornir/core/__init__.py`
- [Task Runner](https://github.com/nornir-automation/nornir/blob/main/nornir/plugins/runners/__init__.py): `nornir/plugins/runners/__init__.py`
- [Task Execution](https://github.com/nornir-automation/nornir/blob/main/nornir/core/task.py): `nornir/core/task.py`
- [Task Processors](https://github.com/nornir-automation/nornir/blob/main/nornir/core/processor.py): `nornir/core/processor.py`
- [Task Results](https://github.com/nornir-automation/nornir/blob/main/nornir/core/task.py): `nornir/core/task.py`
- [Host Connections](https://github.com/nornir-automation/nornir/blob/main/nornir/core/inventory.py): `nornir/core/inventory.py`

### Plugin Interfaces

- [Plugin Registry](https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/register.py): `nornir/core/plugins/register.py`
- [Inventory Plugin API](https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/inventory.py): `nornir/core/plugins/inventory.py`
- [Connection Plugin API](https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/connections.py): `nornir/core/plugins/connections.py`
- [Runner Plugin API](https://github.com/nornir-automation/nornir/blob/main/nornir/core/plugins/runners.py): `nornir/core/plugins/runners.py`

### Other components

- **Python User**
- **Python Task**
- **Managed Devices**
- **Installed Plugins**

## Connections

- Python User → Nornir Initialization: initializes
- Nornir Initialization → Configuration: loads settings
- Nornir Initialization → Global State: creates state
- Nornir Initialization → Inventory Loading: loads inventory
- Inventory Loading → Configuration: reads settings
- Inventory Loading → Plugin Registry: resolves plugin
- Inventory Loading → Inventory Plugin API: uses interface
- Simple Inventory → Inventory Model: builds model
- Inventory Loading → Simple Inventory: instantiates
- Python User → Nornir Runtime: runs tasks
- Nornir Runtime → Inventory Model: selects hosts
- Nornir Runtime → Host Filtering: filters hosts
- Nornir Runtime → Task Runner: dispatches task
- Nornir Runtime → Task Processors: signals lifecycle
- Task Runner → Task Execution: starts per host
- Task Execution → Python Task: invokes
- Task Execution → Task Processors: signals lifecycle
- Task Execution → Task Results: records results
- Task Runner → Task Results: aggregates results
- Python Task → Host Connections: uses host access
- Host Connections → Plugin Registry: resolves plugin
- Host Connections → Connection Plugin API: uses interface
- Connection Plugin API → Managed Devices: connects to
- Inventory Plugin API → Plugin Registry: registered through
- Runner Plugin API → Plugin Registry: registered through
- Installed Plugins → Plugin Registry: advertises entries
- Task Runner → Runner Plugin API: implements interface
- Simple Inventory → Inventory Plugin API: implements interface
- Task Results → Nornir Runtime: returns results
