My 18 Most Useful n8n Tips After 100+ Workflows
By Ed Hill | AI Automation
Summary
## Key takeaways - **Consolidate LLM access with OpenRouter**: OpenRouter provides access to over 500 LLM models from more than 60 providers with a single API key, often at a better price than native providers and with integrated usage tracking for cost and speed. [00:08], [00:40] - **Save time by pinning node data**: Pinning data in n8n allows you to save and reuse inputs/outputs for nodes, skipping re-execution during testing and making workflow sharing easier. You can even edit pinned input data. [00:59], [02:09] - **Streamline debugging with execution history**: Load execution data from the workflow's history to easily copy and reuse past inputs for testing and debugging, avoiding the need to manually re-enter data. [03:27], [04:13] - **Speed up workflows by disabling sub-workflow waits**: Convert slow, sequential tasks into sub-workflows and deactivate 'Wait for Sub-workflow Completion' to significantly speed up execution when immediate results aren't critical. [04:21], [04:55] - **Prefer Switch Node over If Node**: The Switch node is more readable and easier to extend than the If node, capable of handling complex logic and errors without nested structures, making the If node obsolete. [08:53], [09:28] - **Secure API keys with Authentication Management**: Use n8n's Authentication Management to store API keys securely as credentials instead of embedding them directly in HTTP nodes, preventing accidental sharing and simplifying key updates. [10:04], [11:18]
Topics Covered
- Centralize LLM Access and Cost Management with OpenRouter
- Optimize workflow testing by pinning node data
- Accelerate workflows using asynchronous sub-workflow execution
- Always use the Switch node over the If node
- Secure and centralize API key management
Full Transcript
After building over a hundred N8n workflows, I found 18 tricks that make
your AI automation run faster, cost less, and feel effortless to manage. Tip number
one is using OpenRouter. It's a service that gives you, with one API key, access
to all available LLM models. They support over 60 providers and over 500 models.
This enables you to test many models quickly. And the best part is, the price
is usually better or the same as from the native provider. Plus, it's directly
integrated in N8n, so you can easily select it from the menu here on the right,
OpenRouter. And this gives you access to all available models directly here in N8n.
And it's also perfect to track the usage, because for each API call, you see which
model you use, how many tokens were used, and how much it costs you, and even the
speed. It's much better than OpenAI, where you only have an overview how much you
spent for a day. Besides that, it also offers you free models that you don't get
otherwise, and you don't even have to self host them yourself. And it's future proof
for your stack as new models drop. I highly recommend you check this one out.
Tip number two is to pin data and edit this pinned data. Imagine you have
workflow like this one, and you click here, Execute Workflow. What usually
happens, the form element pops up and you fill out the form, and then you click
Submit. Now the rest of the workflow is executed. If you would now close this
workflow or reload the page,
and now you're clicking on Execute Workflow, then again this form pops up.
Then you have again to fill out this form and click again Submit, and now again the
whole workflow is executed. What could be a little annoying. To solve this issue,
you can click here, Pin Data, and click Save. If you now reload this workflow,
then you see here a little pin icon. When we now double click on this note, then we
see that the inputs that we gave are still saved here. If I click now Execute
Workflow, this note is skipped and it continues here. The same you can do with
each note here. For example, if I click here now, Pin Note, click here Save, and
then reload this whole workflow, and then click again Execute Workflow, this both
notes are skipped before it continues. This comes especially handy when you're
testing expensive API calls like the VIO 3, for example. Then instead of rerunning
them all the time when you're testing a certain workflow, you can simply pin the
data. This way, the input and the output of this note is saved, and used statically
in the next execution. What also nice is, when you click here Save, and download
this workflow, you then click Create Workflow, and import now again the same
workflow, then you see the data is still pinned, what makes sharing workflows
especially handy. And when you double-click on a pinned note and click
here on this edit icon, then you can even edit this input. For example, let's change
the description to, "Man sitting in a supercar," and click here Save. This way,
this input gets changed. But be careful, since this note is also pinned, this input
isn't used. So if you want to use this new input, you have to unpin first this
note and rerun it. Tip number three, name your notes. For example, when you click on
this note here, you can click here and give it any name. This way it's much
easier to reference any note. For example, in this note, I can quickly find the
Telegram trigger, and know where to find the chat ID and reference it here.
Additionally, N8n is using this note name to reference it in this variable. Besides
that, it makes it much easier to hand off to other teammates or community members.
It also enables you to quickly understand what's going on. For example, without
naming this note "Create video", I would not know what's happening here without
opening. So I highly recommend to name your notes. Tip number four, load
execution data from history. Let's say we have a simple workflow like this one. When
I test this workflow, I can type in here my name and my email and click Submit.
Then my email gets verified and I get redirected if the email is valid, or I see
an error message if it's not valid. Once I'm satisfied with this workflow, I click
here, Activate. Now when I click on this note and click Production URL, anybody
with this URL can open this page. When I type here now on the name Test 123 and
email, and click Submit, I get an error.
But when we go back here to this workflow, I have no chance to see what's going on.
But I can click here now on Executions and see exactly what happened. When I
double-click here, I see here the inputs I just made. But let's say I want now to
adjust this workflow based on these inputs. For that, I can click here, Copy
to Editor, and now I got exactly these inputs. When I double-click now here, you
see here these inputs pinned, and you could simply click here, Execute Workflow,
and test it out. Tip number five, speed up executions with sub-workflows. For
this, let's take this example here. When I click here, Execute Workflow, in this
Google Sheets, the numbers 1 to 500 are inserted. But like you can see, it's
really slow, because each time a request is sent to Google Sheets, we have to wait
for the answer. If it's not necessary to wait for the answer, like in this case, we
can do a simple trick. First, let's stop this workflow, and do the right-click
here, and select Convert Note to Sub-workflow. Then click here Confirm,
then double-click on this workflow, then click Add Option, and deactivate Wait for
Sub-workflow Completion. Then go back to Canvas, click Save. I clean this up real
quick, and click again Execute Workflow. And like you can see, it's much, much
faster, because it does not wait for the executions to finish. Tip number six,
using Telegram. "Hello, how are you doing?" And like you can see, it directly
works. The main reason to use Telegram is because it's super easy to set up. We just
type in here slash and then select New Bot, give it a name like Hello World 123
Bot,
and then I already receive this API key that I can simply copy
and add here under Create New Credentials, and click Save.
Then I can close this window and go back to Canvas. When I click here now, Execute
Workflow, and open this chat here and click Start, it directly works. Tip number
seven, human in the loop. If you have a multi-step workflow like this one where an
image is first generated, and then based on this image, a video is generated, you
usually want first to approve the image before you generate the video. For that,
you can click here, the plus icon, and select here, Human in the Loop.Here, you
can select multiple services like Slack, Telegram, WhatsApp, or even email. Then
you simply fill out this, and now when an image is generated, you have to first
approve it through email before the video is generated. Tip number eight, select the
tidy up. You probably know this tidy up feature. When you click on it, the
workflow gets tidied up, but for long workflows, it will just get long. But what
you can do instead is select a few nodes, like this one, and then only tidy up
these nodes. Tip number nine, data search for input and output. Let's take, for
example, this node for a voice AI agent. For this node, we receive a lot of output,
but let's say I am looking for something specific like the description. For that, I
can click the search icon and type in description, and now I will see all
variables with description inside. By the way, the same also works for input. This
way, it's much easier to find fields in a JSON. Tip number 10, import cURL. In NLN,
you often use the HTTP request node. This one has a nice feature called import cURL.
When you click on it, you can paste here a cURL command that will fill out the
whole HTTP node. Let me show you an example. We will, for example, open in
KaiAPI the viu3 service. We can click here on API, and here on the right side, we
find something called cURL. We copy this
and paste it back in our cURL command and click import. This whole HTTP request node
gets filled out, and we can simply adjust it to our needs, and we only need to
replace the token here, and then it will directly work for us. This way, it's much
easier to set up an HTTP request node, and usually most API providers provide a cURL
command. Tip number 11, simplify data with added fields node. Let's go back to
our example where we received a lot of input data here. When we want to use this
input data, for example, in the next node here, we have to find the right variable,
what could be a little complicated, and it's really messy here.
What we can do instead is we go back to canvas
and add a node in between.
Click the plus sign here and type in edit,
and select edit fields. Then you click here to add a field and type in, for
example, chat ID. And now you look here round and look for the chat ID. Once you
find the chat ID, you simply drag and drop it here, and then you click execute step.
When you go now to the next node, you have here the option to select any
variables from the added fields. This way, you can easily strip away the noisy
payloads to the essentials. Tip number 12, open a sub-workflow. When you have an
automation with sub-workflows like here, for example, then you usually need to
double-click on it, and then you click here to open up the sub-workflow. But what
you can do instead is you click the command button and double-click on the
sub-workflow, and then it opens up in a new tab. By the way, this is the command
key here on the keyboard. Tip number five, use the switch node instead of the if
node, even for cases where the if node makes more sense. Let me show you an
example. This here is exactly the same workflow, but here, I use the switch node,
and here, I use the if node. Like you can see, in the switch node, you can easily
name the outputs. You can also easily change them by clicking here and changing
them here, the output names. Then you also can easily add more routes, for example,
by clicking here, add route. This alone makes the switch node much more readable
compared to the if node. Besides that, the switch node can do everything what the if
node can also do, and it can also handle much more complex logic, like for example,
when you have an error. If you want to achieve the same with the if node, you
need a nested logic. So it's much easier to extend the switch node, so in my
opinion, it makes no sense to use the if node at all. Tip number 14, setting up a
settings node with added fields. So for example, this node, account ID, I saved
the API key, the Instagram ID, YouTube ID, TikTok ID and so on, so that I don't have
to fill it out here. This way, once I set up this node here,
the whole workflow is set up. It gives you a centralized settings node where it can
set up the limits, IDs, and formats. Once you update it here, it gets updated in the
whole workflow, and it even enables you to do AB testing by flipping the values.
Tip number 15, using the authentication management. So in a workflow like this
one, in the HTTP nodes, I usually provide the authentication key over the headers
parameters. But this way, when you download your workflow and share it with
anybody, they also have access to your API key. To avoid this, you can also use the
authentication management that you can find in each node. For that, you copy the
value here and select here generic credential type. Here, you simply select
bearer of, like you can see here, and provide any API key. For example, this one
here, and I'd call it KaiAPI,
and click save.
This way, I can remove the API key here
and continue using this node, and I even can provide to the next node the same
credentials by clicking here, generate credential type, and selecting here bearer
of,
and selecting then KaiAPI key. Then I can remove here the API keys in the header.
This also pretty handy when you change the API key. For example, if I change the API
key here,
then it will change for all nodes that use the same authentication key. This makes
your workflow much safer and easier to use. Tip number 16, always limit API spend
limit. For example, in OpenRouter, when you create an API key, you can give it a
name, but you also can give it, optionally, a credit limit. That means
after this API key consume the credits, it won't work any longer. For example, when
I put here a ten, then after ten dollars are spent, this won't work anymore. This
will protect you against runway loop, and it also gives you the freedom to
experiment without any fear. And when you use it for clients, then you have a
predictable budget, and almost all providers give you this option. For
example, in KaiAPI, when I click here, save spend limits, I can give it an hourly
credit limit and a daily credit limit. Tip number 17, you can use AI automation
for more than just LLMs. In NLN, you can use it also to analyze audio, transcribe a
recording, analyze a document, analyze an image, or even analyze a whole video.
That way, you can process more than just text. This way, you can build much richer
products than just with chat. Tip number 18, use Rack. Using Rack enables you to
feed your LLMs with fresh, private data. This way, it can also cite sources, so you
can trust the information and be compliant. It's also super easy to set up
by drag and dropping your PDF files. This way, you can lower the hallucination and
give the LLM access to private data. And if you're serious about learning AI and AI
automation, I highly recommend you to join my community, where we take you from
an absolute beginner to a pro. Here, we show you different use cases, like an AI
voice agent or how to create an UGC machine that creates UGC content on
autopilot, or clipping automations that makes any long-form video into shorts, and
many more. I hope you liked this video and see you in the next one.
Loading video analysis...