Reproducible processing workflows with napari
A re-implementation of napari-workflows with backwards compatibility.
This [napari] plugin was generated with [copier] using the [napari-plugin-template] (2.0.1).
ndev-workflows is the workflow backend for napari image processing pipelines. It's a drop-in replacement for napari-workflows by Robert Haase, with these key improvements:
- Safe YAML loading — Uses
yaml.safe_load()(no arbitrary code execution) - Backwards compatible — Automatically loads and migrates legacy napari-workflows files, and detects missing dependencies
- Same API — Most code works without changes
- Future-ready — Designed for upcoming npe2 workflow contributions (WIP), without relying on npe1, napari-time-slicer, and napari-tools-menu for interactivity
pip install ndev-workflowsIf napari is not already installed, you can install ndev-workflows with napari and Qt via:
pip install "ndev-workflows[all]"from ndev_workflows import Workflow, save_workflow, load_workflow
from skimage.filters import gaussian
# Create workflow
workflow = Workflow()
workflow.set("blurred", gaussian, "input_image", sigma=2.0)
workflow.set("input_image", my_image)
# Execute
result = workflow.get("blurred")
# Save
save_workflow("pipeline.yaml", workflow, name="My Pipeline")
# Load and reuse
loaded = load_workflow("pipeline.yaml")
loaded.set("input_image", new_image)
result = loaded.get("blurred")Saved workflows use a safe, human-readable format:
name: Nucleus Segmentation
description: Gaussian blur and thresholding
modified: '2025-12-22'
inputs:
- raw_image
outputs:
- labels
tasks:
blurred:
function: skimage.filters.gaussian
params:
arg0: raw_image
sigma: 2.0
labels:
function: skimage.measure.label
params:
arg0: blurredKey features:
- No
!python/objecttags (safe to share) - Functions imported by module path
- Params use
arg0,arg1, etc. for positional args and keyword names for kwargs
Legacy format: Old napari-workflows YAML files are automatically detected and migrated when loaded.
If loading fails with WorkflowNotRunnableError, install the missing package:
pip install scikit-image # for skimage functions
pip install napari-segment-blobs-and-things-with-membranes # for that pluginInspect workflows without importing functions:
workflow = load_workflow("untrusted.yaml", lazy=True)
print(workflow.tasks) # Safe - doesn't executegit clone https://github.com/ndev-kit/ndev-workflows.git
cd ndev-workflows
uv venv
.venv\Scripts\activate
uv pip install -e . --group dev
pytestDistributed under the terms of the [BSD-3] license, "ndev-workflows" is free and open source software Fork of napari-workflows by Robert Haase.
File an issue with your environment details, YAML file (if applicable), and error messages.