django-viewflow

raw JSON →
2.2.15 verified Mon Apr 27 auth: no python

A reusable library to build business applications fast, providing a BPMN-like workflow engine for Django. Current version is 2.2.15, with a release cadence of minor releases every few months.

pip install django-viewflow
error ImportError: cannot import name 'Flow' from 'viewflow'
cause In v2, Flow is not directly imported from top-level viewflow; it resides in viewflow.flow.
fix
Use 'from viewflow.flow import Flow'
error AttributeError: module 'viewflow' has no attribute 'workflow'
cause The viewflow.workflow module was removed in favor of viewflow.flow.
fix
Use 'from viewflow.flow import ...' instead of 'from viewflow.workflow import ...'
breaking Viewflow v2.x is a complete rewrite from v1.x. The entire API changed; custom code from v1.x will not work.
fix Upgrade to v2.x requires rewriting flow definitions. Refer to migration docs at https://github.com/viewflow/viewflow#migration-from-v1
gotcha Import paths changed in v2: nodes like Start, End, If are now under viewflow.flow, not viewflow.nodes.
fix Use 'from viewflow.flow import Start, End, If' instead of old import.
deprecated The 'viewflow.workflow' module is deprecated; use 'viewflow.flow' instead.
fix Replace 'from viewflow.workflow import ...' with 'from viewflow.flow import ...'

Minimal flow definition with start and end nodes.

from viewflow.flow import Flow, Start, End, If
from viewflow.base import this

class MyFlow(Flow):
    start = Start().Next(this.end)
    end = End()

# In views, you can activate process instances:
from viewflow.models import Process

# Example: act = MyFlow.start.run()  # creates a process instance