Erlang workflow engine