Skip to content

rafaelspecta/n8n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💡 Note: This repository was created to support the students from the AI classes I teach.

Objective

Run n8n locally in the simplest possible way avoiding as much as possible installing unnecesary things on your Operating System.

Table of Contents

Prerequisites

  1. Install Git
  • Run the instructions on your TERMINAL
  • Note on MAC: You might need to install brew first (instructions)
  1. Install Docker Desktop
  • Note on Windows: It requires to restart after installing

Running (Step-by-step)

Start the application

From your TERMINAL, run the following commands:

  1. Download this repositoty
git clone https://github.com/rafaelspecta/n8n.git

The n8n directory will be created

  1. Enter n8n directory, because every "docker" command must run in that directory
cd n8n
  1. Run the containers (PostgreSQL and n8n appication)
docker compose up -d
  1. Acess n8n on your browser with the following URL
http://localhost:5678

Stop the application

When you stop working on it, just stop the containers

docker compose stop

Troubleshooting

If you face problems, the logs might be helpful. To check them run

docker compose logs -f

Extra

The default name of the database, user and password for PostgreSQL can be changed in the .env file in the current directory.

Reference

Based on https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres

n8n: Initial Setup

Setup Account

Fill your information for setting up your account

Questionaire

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.

Activation Key (Advanced Features)

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".

n8n: First Workflow

You can

  • Start from Scratch
  • Start from a Template

Start from Scratch

Just hit "Start from scratch" and you will enter a blank canvas

Start from a Template

Choosing the Template

  1. Look for the option "Teamplates" on the side menu.

  1. That will take you to page on n8n's website with a huge list of options to choose from

  1. 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"

  1. Choose the template you want to use anc click on it. For example bellow I clicked on "Gmail AI Email Manager"

Loading the Template

Once you have chosen the template (see Choosing the Template) now we want to load it in our n8n.

  1. Now click on "Use for free" and the follwing will appear

  1. 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.

  1. 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/"

  1. So now lets load this file into our n8n running locally, but going back to our n8n application
http://localhost:5678
  1. Click on "Start from scratch" to open a new canvas

  1. Now find on the top menu the 3 dots menu option, and click on it

  1. Click on "Import from File..."

  1. Select the file at n8n/sample-template/gmail-manager.json

  2. After selecting the file you will see somthing like this:

Configuring the Workflow

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)

Customizing the Workflow

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 Model with your OpenAI Key

Run the Workflow

Once there is no more pending configuration you can click on "Execute Workflow"

n8n: Troubleshooting

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages