<p>I have seen lots of chat examples in Erlang but what about lists, like a work queue?  If I want to build a work queue system, like a project management system, is it possible to re-order messages in a process mailbox or do I have to use message priorities?  Are there examples of workflow systems built in Erlang?</p>

You cannot reorder messages in process message queues in Erlang.
You can, however do selective receives in which you can receive the message you deem most important first. It's not entirely the same but works for most purposes.
Here's an example:
```
```
receive
    {important, Msg} ->
        handle(Msg)
after 0 ->
    ok
end,
receive
    OtherMsg ->
        handle(Msg)
end
```
```
It differs from:
```
```
receive
    {important, Msg} ->
        handle(Msg);
    OtherMsg ->
        handle(Msg)
end
```
```
In that it will always scan the whole message queue for
```
{important, Msg}
```
before continuing handling the rest of the messages. It means that those kinds of messages will always be handled before any others, if they exist. This of course comes at some performance cost (it takes more time scanning the whole queue twice).