oliverzy / process-engine.js

Node.js Business Process/Workflow Engine
128 stars 32 forks source link

Process automation for Node.js

Best For

Features

Get Started

npm install process-engine

var ProcessEngine = require('process-engine');
// Create a process engine object
var processEngine = ProcessEngine.create();
var simpleDefinition = {
  name: 'simple process',
  tasks: {
    start: {type: 'start'},
    'service1': {type: 'service', action: function (variables, complete) {
        console.log('do work');
        complete();
      }
    },
    end: {type: 'end'}
  },

  flows: [
    {from: 'start', to: 'service1'},
    {from: 'service1', to: 'end'}
  ]
};

// Create process instance from the above process definition
var processDefinition = processEngine.importProcessDefinition(simpleDefinition);
var processInstance = processEngine.createProcessInstance(processDefinition);
// Start the execution of the process instance
processInstance.start();

Guide

Process definition describes the workflow using tasks and flows. The built-in task types:

The flow is something to connect the tasks and can take a condition function if the from task is decision task.

human task service is used to manipulate the task list.

See examples/tests for all usage that process engine supports

API

UI

image

process-engine.js contains a Node.js web application to manage the process instances and human task list.

Development

Roadmap