Showing posts with label workflow automation. Show all posts
Showing posts with label workflow automation. Show all posts

Sunday, 10 May 2026

n8n Microsoft Teams Tutorial: Automate Messages, Alerts, and AI Workflows

n8n + Microsoft Teams Tutorial

How to Use n8n with Microsoft Teams for Workflow Automation

Learn how to send Teams messages, trigger workflows from Teams events, and automate business alerts using n8n.

If your team uses Microsoft Teams, connecting it with n8n can help automate alerts, reports, approvals, support updates, and internal workflows.

๐Ÿ’ก Example: website form → n8n webhook → save lead → send Microsoft Teams notification automatically.

What You’ll Learn

  • How Microsoft Teams works with n8n
  • How to connect Teams credentials
  • How to send Teams messages
  • How to use Microsoft Teams Trigger
  • Real-world Teams automation examples

Why Use n8n with Microsoft Teams?

Microsoft Teams is used for communication, while n8n connects Teams to other tools like forms, CRMs, databases, AI agents, spreadsheets, and APIs.

  • Send automated team alerts
  • Create approval workflows
  • Notify teams when payments or leads arrive
  • Send AI-generated reports
  • Trigger automations from Teams events
  • Connect Teams with Gmail, Outlook, Google Sheets, CRM, and databases

Step 1: Connect Microsoft Teams to n8n

n8n has a built-in Microsoft Teams node for automating Teams actions. It supports a wide range of Teams features, including creating and deleting channels, messages, and tasks. n8n also has a Microsoft Teams Trigger node that can respond to Teams events.

  1. Open n8n
  2. Go to Credentials
  3. Create Microsoft Teams credentials
  4. Sign in with your Microsoft account
  5. Authorize the required permissions
  6. Save and test the credential
⚠️ Note: some Microsoft 365 organization accounts may require admin approval before n8n can access Teams.

Step 2: Send a Microsoft Teams Message

A common workflow is sending a message to a Teams channel when something important happens.

Webhook
   ↓
Set / Edit Fields
   ↓
Microsoft Teams: Send Message

Example message:

๐Ÿš€ New lead received!

Name: {{ $json.name }}
Email: {{ $json.email }}
Message: {{ $json.message }}

This is useful for sales teams, support teams, school admins, LGU monitoring, and operations alerts.

Step 3: Use Microsoft Teams Trigger

The Microsoft Teams Trigger node can start a workflow when events happen in Teams. n8n lists supported events such as new channel, new channel message, new chat, new chat message, and new team member.

Microsoft Teams Trigger
   ↓
AI Agent / IF Node
   ↓
Google Sheets / CRM / Email

Example: when someone posts a message in a Teams channel, n8n can analyze it with AI, log it to a database, or create a task.

Step 4: Build an Approval Workflow

You can use Teams as the notification layer for approvals.

Form Submission
   ↓
IF Amount > 5000
   ↓
Microsoft Teams Alert
   ↓
Manager Review
   ↓
Update Database

This works well for purchase requests, project approvals, leave requests, quotation approvals, and internal business workflows.

Step 5: Combine Teams with AI

You can connect Teams with AI models using n8n. For example, an AI Agent can summarize messages, classify requests, generate reports, or create replies.

Teams Message
   ↓
AI Agent
   ↓
Summarize / Classify
   ↓
Send Teams Reply
   ↓
Save to Google Sheets

This is useful for helpdesk automation, project monitoring, customer support, and smart internal assistants.

Example Workflow: New Lead Alert to Teams

Website Form
   ↓
n8n Webhook
   ↓
Set / Format Data
   ↓
Google Sheets
   ↓
Microsoft Teams Message

Every time a lead submits a form, n8n saves the lead and sends a message to your Teams channel.

Example Workflow: AI Daily Report

Schedule Trigger
   ↓
Database / Google Sheets
   ↓
AI Summary
   ↓
Microsoft Teams Message

This workflow can generate a daily summary of sales, attendance, tasks, or monitoring data and send it to Microsoft Teams automatically.

Real Use Cases

Lead alerts
Helpdesk notifications
Approval workflows
AI daily reports
IoT and CCTV alerts
CRM updates

Common Errors and Fixes

1. Authentication failed
Reconnect your Microsoft credential and confirm the correct account is used.

2. Admin approval required
Some Microsoft 365 tenants require an administrator to approve the app permissions.

3. Channel not found
Check that your account has access to the selected Team and channel.

4. Trigger not firing
Confirm that the workflow is active and the trigger event is correctly selected.

5. Message formatting issue
Keep your first messages simple, then add formatting after testing.

Best Practices

  • Start with a simple “send message” workflow first
  • Use dedicated Teams channels for alerts
  • Keep alert messages short and readable
  • Use IF nodes to avoid unnecessary notifications
  • Log important events in Google Sheets or a database
  • Add AI summaries for long reports or busy channels

Watch My AI Automation Builds on YouTube

I share real n8n workflows, AI agents, IoT systems, and business automations on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can n8n send messages to Microsoft Teams?
Yes. n8n has a built-in Microsoft Teams node for automating Teams actions, including messages.

Can Microsoft Teams trigger n8n workflows?
Yes. n8n has a Microsoft Teams Trigger node that can respond to Teams events like new messages, chats, channels, and members.

Can I use AI with Microsoft Teams and n8n?
Yes. You can connect AI models or AI Agent workflows to summarize, classify, and respond to Teams-related events.


SEO Title

n8n Microsoft Teams Tutorial: Automate Messages, Alerts, and AI Workflows

Meta Description

Learn how to use n8n with Microsoft Teams to send messages, trigger workflows, create alerts, build approval systems, and automate AI reports.

Suggested Labels

n8n, Microsoft Teams, Workflow Automation, AI Automation, Teams Alerts, Business Automation, Blogspot Tutorial

Friday, 8 May 2026

n8n Notion Tutorial: Automate Pages, Databases, and Workflows

n8n + Notion Tutorial

How to Use n8n with Notion for Workspace Automation

Learn how to connect n8n to Notion, create pages, update database records, trigger workflows, and automate your workspace.

If you use Notion for notes, tasks, content planning, CRM, or project tracking, connecting it with n8n can save a lot of manual work. You can automatically create pages, update database items, trigger follow-ups, and connect Notion with AI, Gmail, Telegram, Google Sheets, and more.

๐Ÿ’ก Example: website form → n8n webhook → create Notion lead record → send Telegram alert → AI writes follow-up email.

What You’ll Learn

  • How to connect Notion to n8n
  • How to create Notion pages automatically
  • How to update Notion database records
  • How to use Notion Trigger in n8n
  • How to build real automation workflows with Notion

Why Use n8n with Notion?

Notion is great for organizing information, while n8n is great for automation. Together, they can turn your Notion workspace into a connected business system.

  • Save leads into a Notion CRM
  • Create task pages automatically
  • Build a content calendar
  • Update project status from other apps
  • Send alerts when new records are added
  • Use AI to summarize or generate Notion content

Step 1: Prepare Your Notion Database

First, create a Notion database depending on your workflow. For example, if you want a lead tracker, create fields like:

  • Name
  • Email
  • Phone
  • Message
  • Status
  • Source
  • Date Created
⚠️ Tip: keep your field names simple because you will map these fields inside n8n.

Step 2: Connect Notion to n8n

n8n has a built-in Notion node that supports operations such as searching databases, creating pages, and getting users. n8n also has a Notion Trigger node for database page events like page added or page updated.

  1. Open Credentials in n8n
  2. Create a new Notion credential
  3. Authorize your Notion workspace
  4. Make sure the selected Notion database is shared with the integration
  5. Save and test the credential

If your database does not appear in n8n, check if the Notion integration has access to that page or database.

Step 3: Create a Notion Page from n8n

Add a Notion node and choose an operation that creates a page or database page. Then map your incoming data to Notion properties.

Example field mapping:

Name: {{ $json.name }}
Email: {{ $json.email }}
Phone: {{ $json.phone }}
Message: {{ $json.message }}
Status: New
Source: Website Form

This is useful for contact forms, chatbot leads, client requests, appointment inquiries, and internal task creation.

Step 4: Search or Get Notion Database Items

You can also use n8n to search a Notion database and retrieve existing records. This is useful when you want to check if a lead already exists, update a task, or look up project information.

Search Notion Database
   ↓
IF record exists
   ├── Update existing page
   └── Create new page

Step 5: Update a Notion Database Page

When you already have a Notion page or database record, n8n can update its properties.

Example update:

Status: Contacted
Notes: Follow-up email sent
Last Updated: {{ $now }}

This is helpful after sending an email, completing a task, receiving payment, or updating a project stage.

Step 6: Use Notion Trigger

The Notion Trigger node can start workflows when a page is added to a database or updated in a database. This is useful for status-based automation and project workflows.

Notion Trigger
   ↓
IF Status = Approved
   ↓
Send Gmail / Telegram / Slack Notification

Example: when a Notion task status changes to “Approved,” n8n can notify your team or create a next-step task automatically.

Example Workflow: Notion Lead CRM Automation

Webhook
   ↓
Set / Edit Fields
   ↓
Notion Create Database Page
   ↓
Telegram Notification
   ↓
Gmail Follow-up

In this workflow, a new lead is received from a form, saved into Notion, sent to your team via Telegram, and followed up by email.

Example Workflow: AI Content Planner

Notion Trigger
   ↓
AI Agent / OpenAI
   ↓
Generate Blog Outline
   ↓
Update Notion Page
   ↓
Notify Creator

This is useful if you use Notion as your content calendar. When you add a new topic, n8n can generate an outline, title ideas, captions, and hashtags using AI.

Real Use Cases

Notion CRM system
Content calendar automation
Project task management
AI meeting summary storage
Client onboarding tracker
Approval workflow automation

Common Errors and Fixes

1. Database not showing in n8n
Make sure your Notion database is shared with the integration.

2. Authentication failed
Reconnect your Notion credential in n8n and confirm the correct workspace is selected.

3. Field mapping failed
Check if your Notion property names match the fields you are mapping in n8n.

4. Update operation failed
Make sure you are using the correct Notion page ID or database page ID.

5. Trigger not firing
Confirm the database is accessible and the workflow is active.

Best Practices

  • Use simple Notion property names
  • Create a dedicated database for automation
  • Always test with one record first
  • Use status fields like New, Contacted, Approved, or Done
  • Keep your workflow small before adding AI or multiple apps
  • Log errors during testing before going live

Watch My AI Automation Builds on YouTube

I share real n8n workflows, AI agents, database automations, and business systems on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can n8n connect to Notion?
Yes. n8n has a built-in Notion node and Notion Trigger node.

Can I use Notion as a CRM with n8n?
Yes. You can save leads, update statuses, send follow-ups, and trigger notifications automatically.

Can n8n trigger workflows from Notion changes?
Yes. The Notion Trigger node supports database page added and database page updated events.


SEO Title

n8n Notion Tutorial: Automate Pages, Databases, and Workflows

Meta Description

Learn how to use n8n with Notion to create pages, update database records, trigger workflows, and build CRM, content, and task automations.

Suggested Labels

n8n, Notion, Workflow Automation, AI Automation, Notion API, CRM Automation, Productivity, Blogspot Tutorial

Wednesday, 29 April 2026

n8n OpenRouter Tutorial: Build Multi-Model AI Automation Workflows

n8n + OpenRouter Tutorial

How to Use n8n with OpenRouter for Multi-Model AI Automation

Learn how to connect n8n to OpenRouter and use multiple AI models in one automation workflow.

If you want to build flexible AI automations, combining n8n with OpenRouter is a powerful setup. OpenRouter gives you access to many AI models through one unified API, while n8n lets you automate how those models are used.

๐Ÿ’ก Example: user submits a question → n8n sends it to OpenRouter → AI generates a response → result is sent to Telegram, Gmail, CRM, or your website chatbot.

What You’ll Learn

  • What OpenRouter is
  • How to connect OpenRouter to n8n
  • How to call AI models using HTTP Request
  • How to use dynamic prompts from previous nodes
  • How to build real AI automation workflows

What Is OpenRouter?

OpenRouter is a unified AI model gateway. Instead of integrating many separate AI providers one by one, you can call different models through one OpenRouter API.

This is useful when you want to test different models for chatbots, AI agents, blog automation, summarization, customer support, and internal tools.

Simple explanation: OpenRouter is like a router for AI models. n8n sends the request, OpenRouter sends it to the selected AI model.

Step 1: Get Your OpenRouter API Key

  1. Create or log in to your OpenRouter account
  2. Go to API Keys
  3. Create a new API key
  4. Copy and save it securely
⚠️ Security tip: never expose your OpenRouter API key in frontend code or public pages.

Step 2: Add HTTP Request Node in n8n

OpenRouter can be connected using the n8n HTTP Request node.

HTTP Request settings:

  • Method: POST
  • URL: https://openrouter.ai/api/v1/chat/completions
  • Authentication: None or Generic Header Auth
  • Send Body: JSON

Headers:

Content-Type: application/json
Authorization: Bearer YOUR_OPENROUTER_API_KEY

Step 3: Send Your First AI Request

Example JSON body:

{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful AI automation assistant."
    },
    {
      "role": "user",
      "content": "Explain n8n in simple terms."
    }
  ]
}

After executing the node, OpenRouter will return an AI-generated response from the selected model.

Step 4: Use Dynamic Data from Previous Nodes

In real workflows, your prompt usually comes from a webhook, form, chat widget, Google Sheet, or database.

Example dynamic message:

{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful customer support assistant."
    },
    {
      "role": "user",
      "content": "{{ $json.message }}"
    }
  ]
}

This lets n8n send user input directly to OpenRouter and use the response in the next node.

Step 5: Extract the AI Response

The AI response is usually returned inside the output JSON. In many chat completion responses, the generated text can be found in:

{{ $json.choices[0].message.content }}

You can pass this value to Telegram, Gmail, Google Sheets, WordPress, CRM, or a website chatbot.

Example n8n + OpenRouter Workflow

Webhook / Chat Trigger
   ↓
Set
   ↓
HTTP Request (OpenRouter)
   ↓
Set / Extract AI Response
   ↓
Telegram / Gmail / Google Sheets / WordPress

This workflow receives input, sends it to an AI model through OpenRouter, extracts the AI answer, and sends it to another app.

Real Use Cases

AI chatbot replies
Blog post generation
Email auto-response
AI agent workflows
Document summarization
Customer support automation

Example: AI Support Bot with OpenRouter

You can use OpenRouter as the AI brain of a support bot. A simple workflow can look like this:

Website Chat Form
   ↓
n8n Webhook
   ↓
OpenRouter AI
   ↓
Business Logic / IF Node
   ↓
Reply to User
   ↓
Log to Google Sheets

This is useful for schools, LGUs, service businesses, online stores, and internal helpdesks.

Common Errors and Fixes

1. Unauthorized error
Check your Authorization header and make sure it uses Bearer YOUR_API_KEY.

2. Model not found
Confirm the model ID from the OpenRouter models page before using it.

3. Empty response
Check your messages array and make sure user content is not blank.

4. Wrong output expression
Inspect the HTTP Request output and adjust the expression path if needed.

5. High cost or slow response
Try a smaller model for simple tasks and reserve larger models for complex reasoning.

Best Practices

  • Start with a low-cost model for testing
  • Use clear system prompts
  • Log prompts and responses during development
  • Keep API keys inside n8n credentials or secure variables
  • Use IF nodes to handle errors or empty responses
  • Use different models depending on task complexity

Watch My AI Automation Builds on YouTube

I share real n8n workflows, AI agent builds, and automation systems on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can n8n connect to OpenRouter?
Yes. You can use the HTTP Request node to call OpenRouter’s API directly.

Is OpenRouter compatible with OpenAI-style requests?
Yes. OpenRouter’s request and response schemas are similar to the OpenAI Chat API, which makes it easier to integrate.

Can I use OpenRouter for AI agents?
Yes. You can use OpenRouter as the model backend for AI chatbots, assistants, and agent-style workflows in n8n.


SEO Title

n8n OpenRouter Tutorial: Build Multi-Model AI Automation Workflows

Meta Description

Learn how to connect n8n with OpenRouter using HTTP Request, send AI prompts, extract responses, and build multi-model AI automation workflows.

Suggested Labels

n8n, OpenRouter, AI Automation, AI Agent, Workflow Automation, Chatbot, OpenAI API, Blogspot Tutorial

Thursday, 23 April 2026

How to Use n8n with PostgreSQL for Database Automation

n8n + PostgreSQL Tutorial

How to Use n8n with PostgreSQL for Database Automation

Learn how to connect n8n to PostgreSQL, run queries, insert and update rows, and automate database workflows with triggers and notifications.

If you want to automate database tasks, combining n8n with PostgreSQL is a strong setup. PostgreSQL stores your structured data, while n8n handles the workflow logic around it.

๐Ÿ’ก Example: when a form is submitted, n8n can save the lead to PostgreSQL, notify your team on Telegram, and send an email automatically.

What You’ll Learn

  • How to connect PostgreSQL to n8n
  • How to run SELECT queries
  • How to INSERT new rows
  • How to UPDATE existing records
  • How to DELETE rows safely
  • How to use PostgreSQL Trigger in n8n

Why Use n8n with PostgreSQL?

PostgreSQL is a powerful relational database used for apps, dashboards, internal systems, and business workflows. n8n makes it easier to automate what happens before and after your database actions.

  • Save leads or orders automatically
  • Read customer or system data on demand
  • Update statuses after payments or approvals
  • Trigger automations when rows change
  • Connect database events to email, Telegram, APIs, and CRMs

Step 1: Prepare Your PostgreSQL Database

Before connecting n8n, make sure your PostgreSQL server is ready and you have these connection details:

  • Host
  • Port
  • Database name
  • Username
  • Password

It is best to create a dedicated database user for n8n instead of using your main admin account.

⚠️ Security tip: only give the n8n database user the permissions it needs.

Step 2: Add Postgres Credentials in n8n

n8n has official Postgres credentials support. Create a new Postgres credential and enter your database connection settings.

  1. Open Credentials in n8n
  2. Create a new Postgres credential
  3. Enter host, port, database, username, and password
  4. Save and test the connection

After that, you can use the Postgres node inside your workflows.

Step 3: Read Data with SELECT

To read data from PostgreSQL, use SELECT.

SELECT id, full_name, email
FROM customers
ORDER BY id DESC;

This is useful for reading customers, orders, attendance logs, payments, and other records.

Step 4: Insert New Rows

To save new data, use INSERT.

INSERT INTO customers (full_name, email, phone)
VALUES ('John Doe', 'john@example.com', '09171234567');

This works well for form entries, lead capture, registrations, chatbot logs, and order records.

Step 5: Update Existing Records

To change existing records, use UPDATE.

UPDATE customers
SET phone = '09998887777'
WHERE id = 1;

This is useful for updating payment status, approval state, timestamps, or workflow progress.

Step 6: Delete Rows Carefully

To remove data, use DELETE. Always include a clear WHERE condition.

DELETE FROM customers
WHERE id = 1;
Warning: if you run DELETE without a WHERE clause, you can remove all rows from the table.

Step 7: Use Dynamic Data from Previous Nodes

One of the best parts of n8n is using data from earlier nodes inside your Postgres workflow.

Example expression:

{{ $json.email }}

This lets you insert, search, or update rows using form values, webhook data, chatbot output, or API responses.

Step 8: Use Postgres Trigger for Event-Based Automation

n8n also has a Postgres Trigger node that can respond to database events. According to n8n’s docs, it supports reacting to insert, update, and delete events.

Postgres Trigger
   ↓
IF
   ↓
Telegram / Gmail / HTTP Request / Google Sheets

This is useful when you want instant automation whenever a row changes in your database.

Example n8n + PostgreSQL Workflow

Webhook
   ↓
Set
   ↓
Postgres (INSERT lead)
   ↓
Postgres (SELECT saved record)
   ↓
Telegram
   ↓
Gmail

In this workflow:

  • A webhook receives incoming data
  • A Set node formats the fields
  • The Postgres node inserts the record
  • Another Postgres step reads the row
  • Telegram and Gmail notify your team

Real Use Cases

Lead capture systems
Order and invoice tracking
Attendance and RFID systems
Internal dashboards and CRMs

Best Practices

  • Use a separate PostgreSQL user for n8n
  • Test SELECT first before running UPDATE or DELETE
  • Log important outputs during development
  • Keep your SQL simple and readable
  • Use UTC and ISO 8601 dates when possible

Common Errors and Fixes

1. Connection failed
Check host, port, username, password, and whether your PostgreSQL server accepts external connections.

2. Access denied
Your database user may not have the needed privileges.

3. Query returned nothing
Review your table name, filters, and incoming data.

4. Wrong data inserted
Check your n8n expressions and field mapping.

5. Array or date issues
n8n’s Postgres common issues page recommends careful parameter handling, UTC for dates, and ISO 8601 formatting to avoid timezone confusion.

Watch My Automation Videos on YouTube

I share n8n workflows, automation tutorials, and AI system ideas on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can I use n8n to insert data into PostgreSQL automatically?
Yes. n8n’s Postgres node supports inserting and updating rows, and it can also execute queries.

Can n8n react when PostgreSQL data changes?
Yes. n8n has a Postgres Trigger node for insert, update, and delete events.

Can I use PostgreSQL with Telegram, Gmail, or Google Sheets in the same workflow?
Yes. That is one of the main strengths of n8n.


SEO Title

n8n PostgreSQL Tutorial: How to Automate Database Workflows

Meta Description

Learn how to use n8n with PostgreSQL to automate queries, inserts, updates, deletes, and trigger-based workflows.

Friday, 17 April 2026

n8n and Apify Tutorial: How to Automate Web Scraping Workflows

n8n + Apify Tutorial

How to Use n8n with Apify for Web Scraping and Automation

Learn how to connect n8n and Apify to run Actors, scrape websites, collect structured data, and send results to apps like Google Sheets, Telegram, and CRMs.

If you want to automate web scraping and data extraction, n8n + Apify is a powerful combination. Apify handles the scraping using Actors, while n8n lets you route the output into your own workflow.

What you can build: website scrapers, lead collectors, competitor monitoring, Google Maps data extraction, content pipelines, and alert systems.

What You’ll Learn

  • What Apify does
  • How to connect Apify to n8n
  • How to run an Actor from n8n
  • How to fetch scraped results
  • How to build a simple real workflow
  • How to use HTTP Request instead of a dedicated node

What Is Apify?

Apify is a platform for running automation and web scraping tools called Actors. These Actors can extract website data, browse pages, collect structured results, and save outputs into datasets or key-value stores.

In simple terms, Apify does the scraping work, and n8n handles the automation around it.

๐Ÿ’ก Simple explanation: Apify gets the data. n8n moves the data where you need it.

Why Use n8n with Apify?

This combo is useful because you can let Apify scrape websites and let n8n handle the business logic afterward.

  • Run scrapers on demand
  • Store results in Google Sheets or databases
  • Send Telegram or email alerts
  • Trigger AI analysis of scraped content
  • Build no-code or low-code data pipelines

How n8n Connects to Apify

There are two main ways to connect n8n and Apify:

  1. Use the Apify integration/node
  2. Use the n8n HTTP Request node with the Apify API

Apify’s official n8n integration supports actions and triggers, including running Actors and reacting to Actor or task events. If you prefer raw API control, you can also use n8n’s HTTP Request node.

Step 1: Create Your Apify Account

First, create an Apify account and choose an Actor you want to run. You can use Actors from the Apify Store or your own custom Actor.

For authentication, Apify documentation says you can connect using OAuth or an Apify API token.

Step 2: Connect Apify to n8n

In n8n, add the Apify node if available in your environment, then create the credential using your Apify login or token.

Basic flow:

Trigger → Apify → Google Sheets / Telegram / Database

If you are not using the Apify node, you can connect through HTTP Request instead.

Step 3: Run an Apify Actor from n8n

The standard Apify API pattern is:

  1. Send a POST request to run the Actor
  2. Get the run response
  3. Read the defaultDatasetId
  4. Fetch the dataset items

Example Actor run endpoint:

POST https://api.apify.com/v2/acts/YOUR-ACTOR-ID/runs?token=YOUR_API_TOKEN

Sample JSON input:

{
  "startUrls": [
    { "url": "https://example.com" }
  ],
  "maxRequestsPerCrawl": 20
}
Tip: The POST payload becomes the Actor input, usually as application/json.

Step 4: Get the Scraped Results

After the Actor starts, the response includes information about the run. Apify’s API documentation explains that you typically monitor the run and then fetch results from the dataset using the defaultDatasetId.

Dataset items example:

GET https://api.apify.com/v2/datasets/YOUR_DATASET_ID/items?token=YOUR_API_TOKEN

These items can then be sent to Google Sheets, Airtable, Telegram, Supabase, or any app connected to n8n.

n8n Workflow Example

Here is a simple workflow idea:

Manual Trigger
   ↓
HTTP Request (Run Apify Actor)
   ↓
Wait
   ↓
HTTP Request (Get Dataset Items)
   ↓
Google Sheets
   ↓
Telegram

This workflow runs an Apify scraper, waits for it to finish, fetches the scraped items, stores them in Google Sheets, and sends a Telegram notification.

Example Use Cases

Google Maps lead scraping
E-commerce product monitoring
News and article collection
AI content research pipelines

Using HTTP Request Instead of a Dedicated Apify Node

n8n’s HTTP Request node can call any REST API, so it works well with Apify if you want more direct control.

Typical HTTP Request setup:

  • Method: POST
  • URL: Apify Actor run endpoint
  • Headers: Content-Type: application/json
  • Body: Your Actor input JSON

This is a good option if you want a custom workflow or if your installed n8n environment does not include the Apify node.

Common Problems and Fixes

1. Invalid API token
Double-check your Apify API token or credential setup.

2. Actor runs but no data appears
Make sure the Actor actually writes output into the dataset.

3. Dataset fetch returns empty
The run may not be finished yet. Add a Wait node or poll the run status.

4. HTTP Request errors
Verify method, URL, headers, and JSON body.

5. Wrong Actor input
Every Actor has its own input schema, so follow the specific Actor’s documentation.

Best Practices

  • Start with one Actor and one destination app
  • Test the Actor in Apify first before wiring it into n8n
  • Log raw results before transforming them
  • Use Wait or polling when the scraper takes time
  • Store API tokens securely in credentials

Watch My n8n tuts on YouTube

I also share videos about automation, n8n workflows, and AI systems on my YouTube channel.

▶ Visit My YouTube

FAQ

Can n8n connect to Apify directly?
Yes. Apify provides an n8n integration for actions and triggers, and you can also use HTTP Request for raw API calls.

Do I need coding to use Apify with n8n?
Not much. You mainly need to understand Actor inputs, API tokens, and JSON bodies.

What is the easiest starter workflow?
Run an Actor, wait for completion, fetch dataset items, and send them to Google Sheets.

Thursday, 16 April 2026

How to Create an AI Agent in n8n Using AI Agent Node and OpenAI

n8n + OpenAI Tutorial

How to Create an AI Agent in n8n Using AI Agent Node and OpenAI

Learn how to build a working AI agent in n8n using the AI Agent node, OpenAI Chat Model, tools, memory, and chat trigger.

If you want to build an AI agent inside n8n, the easiest modern setup is to use the AI Agent node together with the OpenAI Chat Model node. This lets your agent understand user requests, choose tools, and return useful answers automatically.

Important: In current n8n versions, the AI Agent now works as a Tools Agent. Also, you must connect at least one tool to the AI Agent node for it to work properly.

What You’ll Learn

  • What the AI Agent node does in n8n
  • How to connect OpenAI to n8n
  • How to add Chat Trigger, Memory, and Tools
  • How to test your first AI agent
  • Common mistakes and how to fix them

What Is the AI Agent Node in n8n?

The AI Agent node in n8n is used to create an autonomous assistant that can receive input, reason about the task, and use connected tools to perform actions or retrieve information. Instead of giving only a simple text response, an agent can decide which tool to use depending on the user’s request.

This is what makes it different from a normal prompt-based AI flow. An AI agent can do more than just answer questions. It can also interact with APIs, run tools, search knowledge, and handle more advanced logic.

๐Ÿ’ก Simple explanation: a normal AI node answers; an AI agent can also decide and act.

What You Need Before Starting

  • A working n8n instance
  • An OpenAI account and API key
  • Basic understanding of nodes and workflow connections

n8n supports OpenAI authentication using an API key. After you add the credential, you can use it in the OpenAI Chat Model node.

Basic Workflow Structure

Your first AI agent workflow in n8n will usually look like this:

Chat Trigger → AI Agent → OpenAI Chat Model
                    ↘ Memory
                    ↘ Tool(s)

This structure allows the user to send a message, the AI Agent to process it, OpenAI to generate reasoning, memory to keep context, and tools to perform actions.

Step 1: Add the Chat Trigger Node

Start by adding a Chat Trigger node. This lets you test your agent using n8n’s chat interface.

  1. Create a new workflow
  2. Add Chat Trigger
  3. Leave the default settings for now

If you want ongoing multi-message conversations, n8n recommends connecting the same memory sub-node to both the Chat Trigger and the AI Agent. This helps maintain a single source of truth for the conversation.

Step 2: Add the AI Agent Node

Next, add the AI Agent node and connect it to the Chat Trigger.

  1. Add the AI Agent node
  2. Connect Chat Trigger → AI Agent
  3. Set your system prompt or instructions inside the agent
Note: Older n8n versions had multiple agent types. In current documentation, this was removed, and AI Agent now works as a Tools Agent.

Step 3: Add the OpenAI Chat Model Node

The AI Agent needs a model to think and respond. Add the OpenAI Chat Model node and connect it to the AI Agent’s model input.

  1. Add OpenAI Chat Model
  2. Create or select your OpenAI credential
  3. Choose the model you want to use
  4. Connect it to the AI Agent model connector

In the OpenAI Chat Model node, you can optionally enable Use Responses API. When enabled, it uses OpenAI’s Responses API instead of Chat Completions. n8n also notes that OpenAI built-in tools are available only when the OpenAI Chat Model is used together with the AI Agent node.

Step 4: Add at Least One Tool

This is the step many beginners miss. The current AI Agent documentation says you must connect at least one tool sub-node to the AI Agent.

Examples of tools you can connect include:

  • HTTP Request tool
  • Calculator tool
  • Code tool
  • Knowledge/search tool
  • Sub-workflow tool
๐Ÿ’ก For a simple test, add an easy tool first so your agent can actually act on something.

Step 5: Add Memory for Conversations

If you want your AI agent to remember previous messages, attach a memory sub-node. This is useful for chatbots, customer support, and assistants that need conversation context.

For chat sessions, n8n recommends connecting the same memory node to both the Chat Trigger and the AI Agent.

Step 6: Add a System Prompt

A good system prompt tells the agent what role it should play and how it should behave.

Example system prompt:

You are a helpful AI assistant for customer support.
Answer clearly and briefly.
Use connected tools when needed.
If information is missing, ask a short follow-up question.

You can customize this for sales, support, HR, booking, lead qualification, or internal knowledge assistants.

Step 7: Test the AI Agent

Once all nodes are connected, execute the workflow and test it through the chat window.

Try sample prompts like:

  • “Summarize this request”
  • “Use the tool to fetch data”
  • “Help me answer a customer inquiry”

If everything is connected properly, the AI Agent will receive the message, use the OpenAI Chat Model for reasoning, and call the connected tool when necessary.

Simple Example Use Case

Here is a beginner-friendly example:

Chat Trigger
   ↓
AI Agent
   ├── OpenAI Chat Model
   ├── Simple Memory
   └── HTTP Request Tool

In this setup, the user asks a question, the agent decides whether it needs external information, and the HTTP Request tool can fetch that data from an API.

Common Problems and Fixes

1. Agent does not work
Check if you connected at least one tool to the AI Agent.

2. OpenAI model not responding
Verify your OpenAI API key and selected credential.

3. Memory is not working
Make sure the memory node is connected correctly, especially if using Chat Trigger sessions.

4. Multi-item expressions behave oddly
n8n notes that sub-nodes can resolve expressions differently from standard nodes.

5. API quota or bad request errors
Check your OpenAI usage, request parameters, and model configuration.

Best Practices

  • Start with one simple tool before building advanced agents
  • Write a clear system prompt
  • Use memory only when you actually need conversation context
  • Test the OpenAI credential separately if needed
  • Keep your first workflow small and easy to debug

Why This Setup Is Good

This approach is good because it is modular. You can start with a very simple AI agent, then later add more tools such as HTTP requests, Google Sheets, Telegram, CRM actions, or database queries.

It is also flexible enough to grow into customer support bots, internal assistants, data lookup bots, and AI-powered automation systems.

Watch My n8n tuts on YouTube

I also share videos about automation, n8n workflows, and AI systems on my YouTube channel.

▶ Visit My YouTube

Want More n8n Tutorials?

You can use this same setup for Telegram bots, website chatbots, CRM assistants, and AI-powered business workflows.

Read More Tutorials

FAQ

Can I build an AI chatbot with n8n and OpenAI?
Yes. The usual starter setup is Chat Trigger, AI Agent, OpenAI Chat Model, memory, and at least one tool.

Do I need a tool connected to AI Agent?
Yes. Current n8n documentation says the AI Agent requires at least one connected tool sub-node.

Can the OpenAI Chat Model use the Responses API?
Yes. The OpenAI Chat Model node has a toggle for using the Responses API.

Does memory persist forever?
n8n notes that memory does not persist between sessions unless your setup is designed to handle session continuity appropriately.

Monday, 13 April 2026

n8n + Weather API

How to Use n8n with a Weather API for Alerts and Automation

Build smart weather-based workflows for alerts, logging, dashboards, and IoT using n8n and a Weather API.

In this tutorial, you will learn:
  • How to connect n8n to a Weather API
  • How to read temperature, humidity, and rain data
  • How to trigger alerts using IF conditions
  • How to send notifications to Telegram, Gmail, or Google Sheets
  • How to expand the flow for smart home or IoT projects

Why Use n8n with a Weather API?

n8n is a powerful automation platform that helps you connect apps, APIs, and logic without building a full backend from scratch. A Weather API gives you real-time data such as temperature, humidity, wind speed, and weather conditions.

When you combine both, you can build workflows like:

  • Send Telegram alerts when rain starts
  • Email yourself when temperature gets too high
  • Log weather data into Google Sheets every hour
  • Trigger IoT webhooks for fans, pumps, or warning systems
  • Create weather dashboards for home, office, or city monitoring

What You Need

  • An n8n instance
  • A Weather API key
  • A city or location to monitor
  • An output app like Telegram, Gmail, Google Sheets, or Webhook

For beginners, OpenWeather is one of the easiest APIs to use.

Basic Workflow Structure

[Schedule Trigger]
        ↓
[HTTP Request]
        ↓
[IF Node]
        ↓
[Telegram / Gmail / Google Sheets / Webhook]

This flow checks the weather on a schedule, evaluates the result, and performs an action when a condition is met.

Step 1: Add a Schedule Trigger

In n8n, add a Schedule Trigger node. This decides how often the workflow checks the weather.

Suggested schedule examples:
  • Every 30 minutes
  • Every 1 hour
  • Every morning at 6:00 AM

For rain or storm alerts, checking every 15 to 30 minutes is usually enough.

Step 2: Add an HTTP Request Node

Next, add an HTTP Request node to call the Weather API.

https://api.openweathermap.org/data/2.5/weather?q=Manila,PH&appid=YOUR_API_KEY&units=metric

Replace YOUR_API_KEY with your actual API key. This request returns live weather data for Manila in Celsius.

Recommended settings:
  • Method: GET
  • Response Format: JSON

Step 3: Understand the Response

A typical Weather API response looks like this:

{
  "weather": [
    {
      "main": "Rain",
      "description": "light rain"
    }
  ],
  "main": {
    "temp": 29.5,
    "humidity": 84
  },
  "wind": {
    "speed": 3.6
  },
  "name": "Manila"
}

The most useful fields are:

  • weather[0].main = general weather condition
  • weather[0].description = detailed condition
  • main.temp = temperature
  • main.humidity = humidity percentage
  • wind.speed = wind speed
  • name = city name

Step 4: Add an IF Node for Conditions

Now add an IF node to create your alert logic.

Example 1: Rain Alert

{{$json["weather"][0]["main"]}} = Rain

Example 2: High Temperature Alert

{{$json["main"]["temp"]}} > 35

Example 3: High Humidity Alert

{{$json["main"]["humidity"]}} > 80

You can use a single IF node or add multiple branches depending on your needs.

Step 5: Send the Alert

Connect the true path of the IF node to your output app.

  • Telegram for instant mobile alerts
  • Gmail for email notifications
  • Twilio for SMS alerts
  • Google Sheets for weather logging
  • Webhook for IoT triggers

Example Telegram message:

Weather Alert
City: {{$json["name"]}}
Condition: {{$json["weather"][0]["main"]}}
Details: {{$json["weather"][0]["description"]}}
Temperature: {{$json["main"]["temp"]}}°C
Humidity: {{$json["main"]["humidity"]}}%

Optional: Clean the Data with a Set Node

To make your workflow easier to manage, add a Set node before the IF node and keep only the fields you need.

{
  "city": "{{$json['name']}}",
  "weather": "{{$json['weather'][0]['main']}}",
  "description": "{{$json['weather'][0]['description']}}",
  "temp": "{{$json['main']['temp']}}",
  "humidity": "{{$json['main']['humidity']}}"
}

This makes the next nodes cleaner and easier to read.

Practical Use Cases

1. Rain Notification System

Send a message to your phone or group chat whenever rain is detected in your city.

2. Smart Home Automation

Trigger a webhook to turn on a fan, close windows, or activate a pump based on weather conditions.

3. School or Office Safety Alerts

Notify staff when severe heat, rain, or wind conditions are detected.

4. Weather Logging Dashboard

Save weather data every hour to Google Sheets or Supabase for reports and charts.

5. IoT and ESP32 Integration

Use n8n as the automation layer between the Weather API and your hardware system.

Tips for Better Workflows

  • Use metric units for Celsius values
  • Add error handling in case the API fails
  • Store your API key securely in n8n credentials or environment variables
  • Avoid duplicate alerts by adding cooldown logic
  • Log alerts so you can review what happened later

Example Advanced Flow

[Schedule Trigger]
        ↓
[HTTP Request: Weather API]
        ↓
[Set Node]
        ↓
[IF: Rain?]
   ├── Yes → [Telegram Alert]
   └── No  → [Google Sheets Log]

Final Thoughts

If you are building automations, dashboards, or smart alert systems, n8n plus a Weather API is a very practical combination. It is simple to set up, flexible to expand, and useful for both beginners and advanced users.

You can start with a basic rain alert, then expand into Google Sheets logging, Telegram notifications, Supabase storage, or even IoT automation for devices and sensors.

Conclusion

Using n8n with a Weather API is one of the easiest ways to build real-time automation based on environmental data. With just a few nodes, you can monitor weather conditions, trigger alerts, log history, and connect the workflow to other apps or devices.

```

Watch My n8n tuts on YouTube

I also share videos about automation, n8n workflows, and AI systems on my YouTube channel.

▶ Visit My YouTube

Monday, 6 April 2026

How to Automate Supabase with n8n (Step-by-Step Tutorial)

How to Automate Supabase with n8n (Step-by-Step Tutorial)

If you're building modern apps, Supabase is one of the best backend platforms. When combined with n8n, you can automate database actions, notifications, and workflows without writing complex backend code.

In this tutorial, you’ll learn how to connect Supabase with n8n and automatically insert data into your database using a webhook.


๐Ÿš€ What You Will Learn

  • Connect n8n to Supabase
  • Insert data automatically into a database
  • Use webhook triggers
  • Build real-world backend automation

๐Ÿ—„️ Step 1: Create Supabase Table

Create a table in Supabase:

Table: leads

Columns:
id (uuid)
name (text)
email (text)
message (text)
created_at (timestamp)

Enable API access (Supabase provides REST automatically).


⚙️ Step 2: Create Workflow in n8n

Create a workflow:

  • Webhook Node (Trigger)
  • HTTP Request Node (Supabase API)

๐ŸŒ Step 3: Add Webhook Trigger

  • Method: POST
  • Copy webhook URL

๐Ÿ”— Step 4: Configure Supabase API (HTTP Request)

Use HTTP Request node:

Method: POST
URL: https://YOUR_PROJECT.supabase.co/rest/v1/leads

Headers:
apikey: YOUR_SUPABASE_API_KEY
Authorization: Bearer YOUR_SUPABASE_API_KEY
Content-Type: application/json
Prefer: return=representation

Body:

{
  "name": "{{$json["name"]}}",
  "email": "{{$json["email"]}}",
  "message": "{{$json["message"]}}",
  "created_at": "{{$now}}"
}

๐Ÿงช Step 5: Test the Workflow

Send test request:

POST /your-webhook-url

{
  "name": "Juan",
  "email": "juan@email.com",
  "message": "Interested in your service"
}

Check Supabase → Data should be inserted automatically.


๐Ÿ”ฅ Real-World Use Cases

  • ๐Ÿ“ฉ Lead capture system
  • ๐ŸŽ“ Student logs (your SAMS ๐Ÿ”ฅ)
  • ๐Ÿ›’ Order storage
  • ๐Ÿ“Š Analytics tracking
  • ๐Ÿค– AI chatbot memory storage

⚡ Pro Tips

  • Use Row Level Security (RLS) properly
  • Create a Supabase view for AI queries
  • Combine with Gmail / SMS for notifications
  • Use n8n IF node for validation

Watch My n8n tuts on YouTube

I also share videos about automation, n8n workflows, and AI systems on my YouTube channel.

▶ Visit My YouTube

๐Ÿ“ˆ SEO Keywords

n8n supabase tutorial, supabase automation, webhook database automation, no code backend, supabase api tutorial


๐Ÿ’ก Tools Used in This Tutorial

Disclosure: This post contains affiliate links. I may earn a commission at no extra cost to you.


๐ŸŽฏ Conclusion

n8n and Supabase together create a powerful backend automation system without needing complex server code.

You can use this setup for SaaS apps, dashboards, AI agents, and business automation.

๐Ÿš€ Start building your automation backend today!

Sunday, 5 April 2026

How to Send SMS Automatically with n8n and Twilio (Step-by-Step Tutorial)

How to Send SMS Automatically with n8n and Twilio (Step-by-Step Tutorial)

Want to send SMS alerts automatically from your system? With n8n and Twilio, you can build powerful SMS automation workflows without complex coding.

This tutorial will show you how to send SMS messages using n8n + Twilio — perfect for alerts, OTPs, notifications, and customer communication.


https://youtube.com/shorts/yDAmh7Ir8Cg?feature=share

๐Ÿš€ What You Will Learn

  • Connect Twilio to n8n
  • Send SMS automatically
  • Use webhook triggers
  • Build real-world notification systems

๐Ÿ“ฒ Step 1: Create Twilio Account

1. Go to Twilio.com and sign up

2. Get your:

  • Account SID
  • Auth Token
  • Twilio Phone Number

⚙️ Step 2: Create Workflow in n8n

Create a new workflow:

  • Webhook Node (Trigger)
  • Twilio Node (Send SMS)

๐ŸŒ Step 3: Add Webhook Trigger

  • Set method to POST
  • Copy webhook URL

This allows your system (website, app, API) to trigger SMS.


๐Ÿ“ฉ Step 4: Configure Twilio Node

  • Operation: Send Message
  • From: Your Twilio number
  • To: {{$json["phone"]}}

Message example:

Hello {{$json["name"]}},

Your request has been received.
We will contact you shortly.

- Your Company

๐Ÿงช Step 5: Test the Workflow

Send test data:

POST /your-webhook-url

{
  "name": "Pedro",
  "phone": "+639XXXXXXXXX"
}

Once triggered, Twilio will send the SMS instantly.


๐Ÿ”ฅ Real-World Use Cases

  • ๐Ÿ“ฉ Lead notifications
  • ๐Ÿ” OTP verification
  • ๐Ÿ“ฆ Order updates
  • ๐Ÿšจ Emergency alerts

⚡ Pro Tips

  • Format PH numbers → +63 (remove leading 0)
  • Add IF node for validation
  • Combine with Gmail / Slack for multi-channel alerts
  • Log SMS in Google Sheets or Supabase

Watch My n8n tuts on YouTube

I also share videos about automation, n8n workflows, and AI systems on my YouTube channel.

▶ Visit My YouTube

๐Ÿ“ˆ SEO Keywords

n8n twilio tutorial, sms automation, twilio api sms, webhook sms automation, no code sms system


๐Ÿ’ก Tools Used in This Tutorial

  • n8n – automation platform
  • Twilio – SMS API provider
  • Hostinger – hosting for your apps

Disclosure: This post contains affiliate links. I may earn a commission at no extra cost to you.


๐ŸŽฏ Conclusion

n8n and Twilio give you a powerful way to automate SMS communication for your business.

You can start simple and scale into full automation systems including AI, CRM, and multi-channel messaging.

๐Ÿš€ Want a Custom SMS Automation System?

I build SMS, WhatsApp, Voice AI, and workflow automation systems using n8n and Twilio.

๐Ÿ‘‰ Contact me for a custom setup for your business.

๐Ÿš€ Start building your SMS automation today!

Friday, 3 April 2026

How to Send Emails Automatically with n8n and Gmail (Beginner Tutorial)

How to Send Emails Automatically with n8n and Gmail (Step-by-Step Tutorial)

If you want to automate email sending without writing complex code, combining n8n and Gmail is one of the best solutions.

This tutorial will show you how to send emails automatically using Gmail in n8n — including a real webhook example for forms and leads.


๐Ÿš€ What You Will Learn

  • Connect Gmail to n8n
  • Send automated emails
  • Use webhook for real-time triggers
  • Build a real lead notification system

๐Ÿ“ฉ Step 1: Create Workflow in n8n

Go to your n8n dashboard and click New Workflow.

We will build this flow:

  • Webhook → Gmail

๐ŸŒ Step 2: Add Webhook Trigger

  • Add Webhook Node
  • Set method to POST
  • Copy the webhook URL

This webhook will receive data from your website or app.


๐Ÿ“ง Step 3: Add Gmail Node

  • Add Gmail Node
  • Select Send Email
  • Connect your Gmail account

⚙️ Step 4: Configure Email (Dynamic Data)

To: {{$json["email"]}}
Subject: New Inquiry from {{$json["name"]}}

Message:
Hello {{$json["name"]}},

Thank you for contacting us.

We received your message:
"{{$json["message"]}}"

We will get back to you shortly.

- Your Team

This allows you to send personalized emails automatically.


๐Ÿงช Step 5: Test Using Webhook

Use Postman or CURL to send test data:

POST /your-webhook-url

{
  "name": "Juan Dela Cruz",
  "email": "juan@email.com",
  "message": "I want to know your pricing"
}

Once triggered, Gmail will automatically send an email.


๐Ÿ”ฅ Real-World Use Case (VERY POWERFUL)

  • Website contact form → Auto reply email
  • Lead capture → Send confirmation
  • Order system → Send receipt

⚡ Pro Tips

  • Add Slack / WhatsApp notifications (multi-channel)
  • Use IF node for filtering
  • Store leads in Google Sheets / Supabase
  • Add AI auto-reply using OpenAI

๐Ÿ“ˆ SEO Keywords

n8n gmail tutorial, email automation, webhook email automation, no code email system, gmail automation


๐ŸŽฏ Conclusion

With n8n and Gmail, you can build powerful automated email systems in minutes.

This is perfect for freelancers, agencies, and SaaS builders.

๐Ÿš€ Start small, then scale your automation.

n8n + Hunter.io Tutorial: Build Automated Lead Generation & Email Discovery Workflows ๐Ÿš€

n8n + Hunter.io Tutorial How to Use n8n with Hunter.io for Automated Lead Generation Find business emails, verify contacts, enric...