This page is no longer maintained — Please continue to the home page at

A scala Workflow DSL

No replies
Razvan Cojocaru 3
Joined: 2010-07-28,
User offline. Last seen 42 years 45 weeks ago.

Hey – I’ve been working on this on and off for a while now and don’t seem to
find the time to finish it to my liking, so here’s the WIP…

read the nice version of this post on my blog: or below.
The project is over at

This is not really meant to be a full-blown BPEL or BPMN environment, but a
tiny, extensible but sweet and easily embeddable workflow framework, that
one can use to automate things inside the house, study the behavior of
certain grains of sand or write more readable and interactive complex

There's more details in the vision page, but these
are the basic principles behind this project:

1. A workflow is just a graph of activities through which an engine carves
one or more concurrent paths
2. The workflow has many views: text DSL, scala DSL, graphical etc
3. There's only a small set of base/core activities.
4. Complex activities are built as patterns from lower-level activities
5. There's a gremlin distribution API, uniformly implemented by all engines
and components in a cloud
6. Branches (sections of the graph) of a bigger workflow could run on
multiple devices/agents
7. Distributed branches, wherever they run, can be related back and managed
as a unit
8. Since these are all plain graphs, certain graph transformations should be
able to turn a state machine into a workflow or a PI into a BPEL or whatever
you want into something you'd like...

So far, 1-4 are prototyped and 5-8 are "in progress": a basic concurrent
engine and DSL are in place... I dind't get to the distributed part yet.


The magic of a scala DSL makes this simple CSP style workflow possible:

v(c) (c ? P | c ! Q)

Doesn't look like scala code? Well... it is and it's proof of why scala is
scalable! Of course, this comes with one of those "don't do this at home"

More complex examples include a scala version:

wif (_ == 1) {
inc + log ($0)
} welse {
inc + inc + log ($0)

or a text version:

par {
seq {
seq {

If you'd like to stay up-to-date, follow me on -
among boring tweets of mine or interesting re-tweets of others, you may find
some updates on my projects.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland