Flow based programming in elixir

@tty, I basically want to create REST API’s using the graphs.

Take a look at the flow library. It might provide the tools you are looking for :slight_smile:.

flow isn’t related to the FBP paradigm

I still don’t quite get it. Are you intending each graph node as a state ? The edges as transitions to that state ?

I want to create something like this

Each node being a function

1 Like

Yes that looks very possible. If each node is a function you have the choice of having an Elixir process handle one function or you can mimic all of these within a FSM. Unfortunately Elixir doesn’t have a corresponding Erlang gen_fsm / gen_statem and will have to use the Erlang behaviours.

I think state machines aren’t the answer to this. As we might me dealing with a function which requires more than one input argument, and they are waiting for the output from a different node, which can be of asynchronous nature.

Ok. Go with GenServer to begin with and model a simple system. It looks very doable.

There is an Elixir wrapper for gen_statem here…


1 Like

Here’s a FBP library:


Take a look at this talk about the topic


What you are looking for is https://github.com/antonmi/flowex which mixes FBP and ROP, I’m personalize working on my own library called conveyer based on the following libraries:


I was exploring ‘ElixirFBP’ and is the closest to what I am looking for, thanks for finding the alternatives.

1 Like

Here’s another relatively new library implementing FBP and is based on GenStage: https://github.com/suitepad-gmbh/pipette

I wrote about Elixir and FBP in a blog at the time that GenStage and Flow were announced.

Hi, I’ve created a proof-of-concept implementation.

Please have a look and let me know your views.
Any suggestions or contributions are welcome.

This is inspired by @pcmarks implementation.

1 Like

Hi Sarat,

I apologize for not getting back to you sooner - been very busy. I will take a look at your work in a few days.



1 Like

@sarat1669 In case you’re still looking. I’ve been working on something similar: Exred

1 Like

@zsolt001 I’ve seen your project recently. Thanks for the post.

Finally got a chance to work on v0.2
Will be actively working on it to make it production ready
Moved the repo to a new place and changed the name of the package

The new changes are inspired by project flogo

Source; GitHub - factor18/flo: Flow based programming for elixir
Hex: flo | Hex

PTAL, this is still WIP but I think a step in the right direction
It would be great if you can review the codebase. PS: I am still a beginner.