Build Visual Workflows with n8n and Automate Everything

Hello devs,

As a full-stack developer working mostly with JavaScript, I often build internal tools and data pipelines. I found myself writing a lot of boilerplate Node.js code to glue together APIs and databases — until I discovered n8n.

This blog is…


This content originally appeared on DEV Community and was authored by Dilum Darshana

Hello devs,

As a full-stack developer working mostly with JavaScript, I often build internal tools and data pipelines. I found myself writing a lot of boilerplate Node.js code to glue together APIs and databases — until I discovered n8n.

This blog is my personal reference and a shared guide for anyone looking to get serious about workflow automation

Installing and Running n8n Locally

Running n8n with Docker is the easiest and most consistent way to set it up locally. It keeps your environment isolated, reproducible, and production-ready. No need to worry about system dependencies. But, it is available in Saas as well. https://app.n8n.cloud/login

docker-compose.yml

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    container_name: my-n8n-workflow
    restart: always
    ports:
      - "5678:5678"
    environment:
      # - DOMAIN_NAME=example.com
      # - SUBDOMAIN=n8n
      # - N8N_HOST=n8n.example.com
      # - N8N_PROTOCOL=https
      # - N8N_PORT=5678
      # - WEBHOOK_URL=https://n8n.example.com
      # - NODE_ENV=production
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_SECURE_COOKIE=false
    volumes:
      - ./n8n_data:/home/node/.n8n

.env

GENERIC_TIMEZONE=Asia/Colombo

Note: There can be a user ownership issue in the n8n_data folder. Run the following command from the folder where container running,

$ sudo chown -R 1000:1000 ./n8n_data

Now, do the composer up,

$ docker-compose up -d

If everything goes well, n8n should be runs on http://localhost:5678. Fill the user registration to create an account, then fill the survey (as of now) to go into the dashboard.

n8n dashboard

n8n UI and Core Concepts

Building a Real-World Workflow

To understand how triggers, API calls, data transformation, and external services come together in n8n, let’s build a simple real-world workflow.

Use Case: Send a random joke to your email every 5 minutes using Resend

Workflow: [Cron Node] → [Fetch Joke (HTTP Request)] → [Send Email (Resend HTTP Request)]

Step 1: Create a New Workflow

  • Open the n8n editor.
  • Click “New Workflow” and give it a name, for example: Send Joke to Email

Step 2: Add a Cron Trigger

  • Click “+” Add Node.
  • Search for Schedule Trigger and select the Schedule Trigger Node.
  • Configure it to run every 5 minutes, continuously.

Add a cron trigger

Step 3: Fetch a Joke via HTTP Request

  • Click “+” Add Node.
  • Search for HTTP Request.
  • Configure it with response format as JSON. URL: https://icanhazdadjoke.com/, method: GET

Configure http request

This should return a json something like this:

{
  "joke": "I once lost a banana at court but then I appealed."
}

Step 4: Send the Joke via Email Using Resend

Now send the joke to email using Resend's email API. To do this, need to create a Resend account and API key.

https://resend.com

Configure the Email Node,

Since n8n doesn’t have a native Resend node, use HTTP Request again.

  • Click “+” Add Node.
  • Select HTTP Request.
  • Configure it,

URL: https://api.resend.com/emails
Method: POST
Headers:

  • Authorization: Bearer RESEND_API_KEY
  • Content-Type: application/json

Config HTTP node

  • Send body:
{
  "from": "Jokes <onboarding@resend.dev>",
  "to": "dilum.dar@gmail.com",
  "subject": "Here's Your Joke",
  "text": "{{$json.joke}}"
}

JSON Body

Now, everything ready for test. The whole workflow looks like this,

Whole workflow

Run the workflow manually by clicking “Execute Workflow”. Should receive an email with a joke :)

If it works, click “Activate” to make it run automatically every 5 minutes.

Activate workflow

Final Thoughts
Whether you're automating your daily tasks, integrating multiple services, or building your own AI pipelines—n8n gives you the flexibility of code with the simplicity of a visual editor.

This was just the beginning.

Cheers....


This content originally appeared on DEV Community and was authored by Dilum Darshana


Print Share Comment Cite Upload Translate Updates
APA

Dilum Darshana | Sciencx (2025-07-14T06:00:45+00:00) Build Visual Workflows with n8n and Automate Everything. Retrieved from https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/

MLA
" » Build Visual Workflows with n8n and Automate Everything." Dilum Darshana | Sciencx - Monday July 14, 2025, https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/
HARVARD
Dilum Darshana | Sciencx Monday July 14, 2025 » Build Visual Workflows with n8n and Automate Everything., viewed ,<https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/>
VANCOUVER
Dilum Darshana | Sciencx - » Build Visual Workflows with n8n and Automate Everything. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/
CHICAGO
" » Build Visual Workflows with n8n and Automate Everything." Dilum Darshana | Sciencx - Accessed . https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/
IEEE
" » Build Visual Workflows with n8n and Automate Everything." Dilum Darshana | Sciencx [Online]. Available: https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/. [Accessed: ]
rf:citation
» Build Visual Workflows with n8n and Automate Everything | Dilum Darshana | Sciencx | https://www.scien.cx/2025/07/14/build-visual-workflows-with-n8n-and-automate-everything/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.