Any tips on building a workflow engine similar to n8n?

I have spent the last four months making an execution engine for my agent coder (and basically all other agentic use) and if I was to build something like n8n I would start where my agent building took me:

Lua all the things!

lua is an extremely good llm target so you can build a ton of execution points in elixir and expose them as an api to the lua tool. Build a ui that maps to lua and you cross the ui/code divide as well.

(Credit where credit is due, this is almost word for word what @davydog187 said at codebeam a year ago and boy was he right)

Every single ai feature I make these days is well considered elixir code that is given a lua intetface for the llm to use. Or you could give it a ui interface that maps to lua..

(You would get chat interface n8n building for free fwiw).

I am not convinced visual builders are the future, but I am not sure chat based builders are it either :man_shrugging:t2:

2 Likes

Thanks for the shoutout @olivermt!

This is the talk if you’re interested. We actually built a visual editor that targets Lua as its compilation target, and then we execute that Lua. As Oliver mentioned, this provides a nice way to sandbox the user generated “code” while providing clean interfaces, loops, etc. This removes a lot of ad-hoc mechanisms that would be required otherwise, and provides a nice level of abstraction to remove implementaiton details, that all sits under the Lua APIs (which are implemented mostly in Elixir!)

2 Likes