Viewflow REST

PRO Only package provides a flow implementation with the REST interface.

  • /flows/ - List of available flows
  • /processes/ - List of processes
  • /tasks/ - List of tasks from all flows

Per flow API:

  • /flows/<flow_label>/ - Flow description
  • /flows/<flow_label>/chart/ - SVG flow visualization
  • /processes/<flow_label>/ - List of flow instances
  • /tasks/<flow_label>/ - List of flow tasks

Each flow node could have own API set,

See also the for the Swagger documentation of each endpoint.

Quick start depends on djangorestframework>=3.6 and django-rest-swagger>=2.1

Start with adding viewflow, and dependencies to the INSTALLED_APPS settings


Flows could be defined in the <app>/ Here is the same HelloFlow as in the Quick start but with REST interface.

from viewflow import rest
from viewflow.base import this, Flow
from import flow, views

from . import models

class HelloRestFlow(Flow):
    process_class = models.HelloRestProcess

    start = flow.Start(
        views.CreateProcessView, fields=['text']

    approve = flow.View(
        views.UpdateProcessView, fields=['approved'],
        task_description="Message approvement required",
        task_result_summary="Messsage was {{ process.approved|yesno:'Approved,Rejected' }}"

    check_approve = flow.If(
        cond=lambda act: act.process.approved

    send = flow.Handler(

    end = flow.End()

    def send_message(self, activation):

In case if you use viewflow.frontend you can register flow in it, and get nice rendered SWAGGER api spec.

from viewflow import rest

class HelloWorldFlow(Flow):

Don’t forged to enable the frontend, see Quick start for details.

Without frontend you need directly include flowset urls in the django’s URL config.

from django.conf.urls import url, include
from import FlowViewSet
from .flows import HelloWorldFlow

hello_urls = FlowViewSet(HelloWorldFlow).urls

urlpatterns = [
    url(r'^workflow/api/helloworld/', include(hello_urls, namespace='helloworld'))