I just spent two days learning how to build n8n custom nodes...

I just spent two days learning how to build n8n custom nodes, and it wasn't an easy ride...

After having a quick look at the documentation, you think "Ahh, this is easy, I'm just gonna map a few endpoints to some JSON and I'll have a custom node"

Then you get a big surprise when you can't even set up your development environment to start building the node. You find that the documentation is based on an older version of n8n when it was still using npm, and trying to follow it with pnpm just throws a bunch of errors at you.

You search around and find that everybody is having the same issues, getting the linking step to work correctly, with different possible solutions, none of which you fits your way of working.

So I just skip the whole linking thing and make a small script that I execute after each code change, to build and deploy the node in my n8n installation so I can test it.

Now it's time to actually build the node, just reference a simple endpoint with json and I'm done. Nope..

Declarative syntax (the simpler way of building nodes) doesn't work for receiving binary data correctly, such as images, which is exactly what I need.

So I have to build the node using programmatic syntax, because what I'm building is a node that generates images, which requires some data transformation to receive the image output in n8n correctly.

I look for documentation or tutorials for building custom nodes programatically, but there's none to be found..

So I guess the only option left is to dig into the code, I'll probably find some comments or JSDocs that will guide me along the way. Unfortunately, this is not one of those good days...

The only option left: study the codebase and different nodes until you get your head around it.

So where should I start? Well, I just made a video on how to generate images by calling a certain API with the HTTP Request node, so I guess it must have that functionality implemented somewhere. So let's start there.

After spending A LOT of time reading through code, hacking back and fourth, I finally make it. I've successfully created a custom node that generates text-based images in n8n!

I know this might sound silly, but after spending almost 2 whole days of bashing my head at the wall (figuratively speaking) and finally achieving to build exactly what I planned without compromise, it feels GREAT!

After putting so much time and energy into this, I would love for you to try it out!

It's really easy to set up, just install it from the community nodes section in n8n and that's it! No credentials or other configuration needed.

Here's the npm page for the package:
https://www.npmjs.com/package/n8n-nodes-generate-text-image

I also made a video demonstrating how to use it and install it that you can watch via this link:
https://youtu.be/y95fm4b1gdM?si=Kn2jtALCaKD8XPcK

I would like to build some more community nodes, especially ones that have some real business value. So if you have any ideas, please let me know!