n8n Local and Variable Fun

So for the last week or two I’ve been working on a side project using n8n as one of the components.

I have Docker for Mac running, and have a local instance of n8n running in that.  I didn’t want a hosted version, and as part of the project wanted to do some stuff with Docker too – so a win there.

However, n8n local isn’t n8n Enterprise.  🙂

For the most part I’ve been able to do whatever I wanted – more on the project in a separate blog post coming soon – but one frustration is n8n’s lack of workflow variables if you aren’t on Enterprise.

Workflow Variables:

You can’t even sneak in an effective global variable in the n8n secrets manager:

Why does this matter?  Well the way n8n works is each step uses the previous steps output as its input.  Makes sense right?

So if I have this sample – a simple set of steps to get a list of file names, get file text, and make some JSON:

I start by loading some variables I care about – things like Google Drive folder IDs for example that I’ll use later.

That becomes the input to the next step.  What happens here is as I proceed, these variables get lost – because they are no longer part of the output of the subsequent steps.  So later once I do what I want with the files I am working on in this and want to move them to a processed folder for example, I no longer have access to the folder IDs I need.

Then it turns into a mess like this where I need to “stamp” the variables I need periodically and have a merge step to bring it all together again.  

In the project I will write about I had a jobSkills pending and processed folder set as well as skillJson pending and processed.  The flow was pretty simple, read from jobSkills pending, do stuff, create a skillsJson file and then at the end when I knew the workflow was complete – move the respective file files to their processed folders.

If I had access to variables I could have stored things like the google folder IDs, forwarded API keys, maybe even a list of file IDs I was working on.  Instead I had to do a workaround like this – 4 times…

Basically I had to track where the variables I cared about were getting lost, go one step prior to “stamp” them in the flow and use an n8n Merge node to keep carrying them forward.

I get the need to monetize something like n8n.  It’s been a fun tool to mess around with, but this feature should probably be in the free version.  It was a frustrating hurdle and if I didn’t want to take the time to work past it – it might have short circuited my evaluation of the tool.

In the end my flow works, and I can see the potential here – a lot more depth than other similar low code tools, but on the free self hosted version – just some rough stuff to deal with.

Scroll to Top