I want to know if we can implement flow based programming using a graph. Where each node is a process by itself, and the graph can be dynamic in nature. I’m not sure how I can achieve this in elixir. Please let me know your thoughts.

# Flow based programming in elixir

**Jump3r**#2

If you use Supervision tree you have - you guessed it, tree. Maybe that’s a partial solution?

**tty**#7

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

**tty**#9

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.

**sarat1669**#10

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.

**amacgregor**#15

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:

**sarat1669**#16

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

**marcelotto**#17

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

**pcmarks**#18

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

**sarat1669**#20

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.

**pcmarks**#21

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.

Best,

Peter