Skip to content
This repository was archived by the owner on May 9, 2026. It is now read-only.

Latest commit

 

History

History
98 lines (61 loc) · 6.15 KB

File metadata and controls

98 lines (61 loc) · 6.15 KB

Getting Started with n8n

This document details the setup for n8n for local development.

Prerequisites

  • Docker Desktop must be installed and running on your machine.

.env File

[Optional]: You can copy over the .env.dev file from the root of the project to /n8n and rename it to .env. This will allow you to run the n8n unit tests.

1. Running n8n for Development

For a full-stack development environment, please use the start.sh script in the project's root directory. It will automatically build and run the n8n service (aero_n8n_dev) for you.

Once the script is running, you can access your local n8n instance at: http://localhost:5678

2. Environment File Setup

The start.sh script sources environment variables from .env.dev files.

  • Root .env.dev: Ensure you have created the .env.dev file in the project root as specified in the main README.md.

3. Creating an account and claiming your license key

On the first creation of an n8n instance, upon arriving at http://localhost:5678, it will prompt you to login/create a new account. You will not be able to use n8n until a license key is claimed. Here are the following steps:

  1. Create a new account (this is your actual n8n account, and not just a local account).
  2. Once created, a confirmation email will be sent along with an access key. Simply redeem the access key via the button in the email and your account and workspace should now be validated, and n8n can now be fully used.

Setup of Individual n8n Workflows

Setting up n8n "Claim Generation"

This part of the document details all the steps necessary to setup the claim generation workflow on n8n. For the time being, gmail is used to send claims. It is highly recommended to create a secondary gmail account for this part, as the n8n workflow will have full access to your gmail and be able to utilize CRUD operations.

Prerequisites

  • Google Gemini API Key. (Add this to the ./.env.dev file).
  • A Google Cloud project being setup. Down below details how to set it up for n8n.

Importing the claim generation workflow

To import the workflow, on the main page, simply create  a new workflow and at the top right, click on the dots and import from File. Click on the Claim-Generation file to import successfully.

The "Message a model" and "Send a message" node will indicate an error, as they do not have credentials setup. Furthermore, the "Send a message" node will need an email that is going to be the receiver.

You will need to open the Gemini node and the Gmail node to input the appropriate credentials, API key and OAuth respectively.

Setting up the Google Cloud project for n8n

The steps here detail on how to setup a Google Cloud project for n8n. Alternatively, the video guide below can be consulted.

Video Guide, by n8n: https://youtu.be/FBGtpWMTppw?si=iN7ZpYY8arTsX8dr

  1. Navigate to Google Cloud and click "Console"

  2. Click on the Project dropdown on the top left and create a new project, name it SOEN490-n8n

  3. Click on the menu in the top left > API & Services > Enable API & Services

  4. Search for Gmail and enable.

  5. Navigate to OAuth consent screen

  6. Click Get Started, give it an appropriate name and an email.

  7. Set audience to External and setup a support account, continue.

  8. Under "Overview" create the OAuth client ID

  9. Back in the n8n workflow, under the "gmail" node, create a new credential, a link should appear.

  10. Paste the link under Authorized redirect URLs, acquire the Client ID.

  11. Click on the Client on the left and get the Client secret.

  12. IMPORTANT: Because the app is in test mode, n8n will block it if you try to connect your account now.

  13. Go to audience section, and publish the app, this will now work.

The workflow can now, upon receiving a filled out form, create generate a claim and send it via email.

Setting up n8n "Airline Claim Response Evaluator and Generator"

If OpenAI nodes are not functional or not appearing properly, update your n8n installation to the latest version as the openAI nodes are version 2 which only came out a few days ago.

Setting up n8n "Ad Generation" Workflow

Prerequisites

  • Google Gemini API Key. (Add this to the ./.env.dev file).
  • Developer account for the corresponding social media platform. For this workflow, X was used. See here to setup for X.
  • Credits for the corresponding social media platform. It is likely, as is the case with X, that credits will be required on the account.
  • (Optional) OpenAI API key. This was used to score ad templates generated by Gemini.

Setting up this workflow follows the same procedures as with previous workflows, with the exception of the "Create Tweet" n8n node. Below describes how to set it up using OAuth2. Alternatively, the n8n documentation describes how to set it up, as well as providing related resources.

  1. Open the X developer page (see here)
  2. Navigate to Apps and click "Create App". Give the application a name and select "Development" for the environment. Save any and all information that is provided for future potential use.
  3. Navigate back to the dashboard, and, under "Quick Actions" in the bottom right, click on Apps. This refreshes the developer instance. (Refreshing the Apps page instead from step 2) seems to fail to display the newly created application, hence navigating back to the dashboard.)
  4. Click on your app, and click on "Set up" under User authentication settings.
  5. Give the app Read and write permissions, and select "Web App, Automated App or Bot"
  6. In n8n, open the "Create Tweet" node, click on Credentials, and copy the Callback URI provided by n8n and put it under the App's respective field.
  7. Put a website URL, you can use a dummy website link.
  8. Click on Save Changes, and copy and save the Client ID and Client Secret tokens, and put them in the respective fields in the n8n "Create Tweet" node.
  9. Save and the workflow is now ready to generate a tweet. (Note that this requires credits.)