💡 Note: This repository was created to support the students from the AI classes I teach.
Run n8n locally in the simplest possible way avoiding as much as possible installing unnecesary things on your Operating System.
- Install Git
- Run the instructions on your TERMINAL
- Note on MAC: You might need to install brew first (instructions)
- Install Docker Desktop
- Note on Windows: It requires to restart after installing
From your TERMINAL, run the following commands:
- Download this repositoty
git clone https://github.com/rafaelspecta/n8n.git
The n8n directory will be created
- Enter n8n directory, because every "docker" command must run in that directory
cd n8n
- Run the containers (PostgreSQL and n8n appication)
docker compose up -d
- Acess n8n on your browser with the following URL
http://localhost:5678
When you stop working on it, just stop the containers
docker compose stop
If you face problems, the logs might be helpful. To check them run
docker compose logs -f
The default name of the database, user and password for PostgreSQL can be changed in the .env file in the current directory.
Based on https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres
Fill your information for setting up your account
You can skip this if you want by leving it blank and clicking on "Get Started". Although this is a useful information that helps the n8n team.
You can get the activation key for FREE to have access to paid features just by providing you email.
If you filled your email just hit "Send me a free license key".
You can
- Start from Scratch
- Start from a Template
Just hit "Start from scratch" and you will enter a blank canvas
- Look for the option "Teamplates" on the side menu.
- That will take you to page on n8n's website with a huge list of options to choose from
- On the search bar you can look for a specific keyword, such as "email"
Or you can look for a specific tool, such as "Gmail"
- Choose the template you want to use anc click on it. For example bellow I clicked on "Gmail AI Email Manager"
Once you have chosen the template (see Choosing the Template) now we want to load it in our n8n.
- Now click on "Use for free" and the follwing will appear
- Now click on "Copy template to clipboard (JSON)"
That will copy the content workflow description file that has all the information needed for this workflow.
- Now you have to create local empty file (with the extension ".json") and PASTE this content to it. So create the file, open it and hit "Paste" on the menu, or hit Ctrl+V (Windows) or Cmd+V (Mac)
In this case, to facilitate, I have already created the file "gmail-manager.json" for you under the directory n8n/sample-template/"
- So now lets load this file into our n8n running locally, but going back to our n8n application
http://localhost:5678
- Click on "Start from scratch" to open a new canvas
- Now find on the top menu the 3 dots menu option, and click on it
- Click on "Import from File..."
-
Select the file at
n8n/sample-template/gmail-manager.json -
After selecting the file you will see somthing like this:
Bassically all templates come with Nodes that require credentials, so you will need to configure it.
You can identify the nodes that require configuring by the following symbol on the node
I this example we need to configure:
- Gmail Account Credentials
- Anthropic Credentials
To configure double-click on the symbol and you will ths config panel bellow where you need to click on the drop-down arrow in "Credential do connect with", followed by "Create new credential"
Each tool have its own configuration and you will have to click on "Open docs" to learn how to do it
You will have to follow the same steps for other Nodes that require configuration (in this case Anthropic). For nodes of the same type you can just select the credential you have created in the first one (in this case you need to create Gmail credentials only one and you can reuse it in the other Gmail-related nodes)
In the Gmail Manager example you might want to customize it by switching the Anthropic Chat Model for OpenAI Chat Model.
Click on the + button on the top-right part of the canvas and type OpenAI. You will see the option OpenAI Chat Model
Drag the OpenAI Chat Model into your canvas
Now you can select and erase Anthropic Chat Model and link the new OpenAI Chat Model node to your Agent's Chat Model like this:
💡 Note: Don't forget to configure
OpenAI Chat Modelwith your OpenAI Key
Once there is no more pending configuration you can click on "Execute Workflow"
If the Workflow is not working as expected you can check the logs.
Click on the arrow bellow that you will find in the bottom-right corner of the screen
It will open the following panel that shows each step executed, where it stopped and what was the error
In this case the credentials for Gmail are missing





















