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.

Wednesday, 22 April 2026

n8n Apollo Tutorial: Automate Lead Generation

n8n + Apollo Tutorial

How to Use n8n with Apollo for Lead Generation Automation

Automate B2B lead generation, enrichment, and outreach using n8n and Apollo 🚀

If you want to build a powerful lead generation system, combining n8n with Apollo is a game changer. Apollo provides B2B contact data, while n8n automates extraction, enrichment, and follow-ups.

💡 Example: search leads in Apollo → send to Google Sheets → trigger email outreach → notify via Telegram.

📌 What You'll Learn

  • Connect Apollo API to n8n
  • Search and extract leads
  • Save leads to database or Sheets
  • Automate outreach workflows
  • Real use cases

What is n8n + Apollo?

Apollo is a B2B data platform that provides verified emails, company data, and prospecting tools. n8n allows you to automate how that data is used.

Step 1: Get Apollo API Key

  1. Login to Apollo dashboard
  2. Go to Settings → API
  3. Copy your API key
⚠️ Keep your API key private.

Step 2: Setup HTTP Request in n8n

Apollo does not have a native n8n node, so we use the HTTP Request node.

  • Method: POST
  • URL: https://api.apollo.io/v1/mixed_people/search

Headers:

Content-Type: application/json
X-Api-Key: YOUR_API_KEY

Step 3: Search Leads

{
  "q_organization_domains": ["example.com"],
  "page": 1,
  "per_page": 5
}

This returns leads from Apollo database.

Full Workflow Example

Manual Trigger → HTTP Request (Apollo) → Set → Google Sheets → Gmail → Telegram
  • Fetch leads
  • Format data
  • Store in Sheets
  • Send outreach email
  • Notify team

Real Use Cases

Cold Email Automation
Lead Database Builder
Sales CRM Sync
AI Lead Scoring

Common Errors

❌ Invalid API key
❌ Rate limits
❌ Wrong query format
❌ No results returned

Pro Tips

  • Filter leads carefully to improve quality
  • Use AI to personalize emails
  • Limit requests to avoid API limits
  • Store leads before outreach

🎥 Watch My Automation Tutorials

I share n8n workflows, lead gen systems, and AI automations on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Q: Is Apollo free?
Apollo has limited free credits.

Q: Can I automate outreach?
Yes, using Gmail or other email APIs.

Q: Can I use AI personalization?
Yes, integrate OpenAI with n8n.


SEO Title:

Meta Description: Learn how to use n8n with Apollo API to automate lead generation and outreach workflows.

Tuesday, 21 April 2026

n8n MySQL Tutorial: How to Automate Database Workflows

n8n + MySQL Tutorial

How to Use n8n with MySQL for Database Automation

Learn how to connect n8n to MySQL, run queries, insert records, update rows, and automate database workflows.

If you want to automate your database tasks, combining n8n with MySQL is a great setup. MySQL stores your data, while n8n helps automate what happens before and after every database action.

💡 Example: when a form is submitted, n8n can save the lead to MySQL, send a Telegram alert, and update Google Sheets automatically.

What You’ll Learn

  • How to connect MySQL to n8n
  • How to run SELECT queries
  • How to INSERT new rows
  • How to UPDATE records
  • How to DELETE data safely
  • How to use MySQL in real workflows

Why Use n8n with MySQL?

MySQL is one of the most common relational databases for web apps, CRMs, dashboards, and internal systems. n8n helps you automate how data enters, changes, and moves across your systems.

  • Save form submissions to a database
  • Read customer or order data automatically
  • Update records after payment or approval
  • Delete old records on schedule
  • Sync MySQL data with email, Telegram, CRMs, and APIs

Step 1: Prepare Your MySQL Database

Before connecting n8n, make sure your MySQL server is running and you have:

  • 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: give the n8n database user only the permissions it actually needs.

Step 2: Add MySQL Credentials in n8n

In n8n, create a new MySQL credential and enter your connection details.

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

Once connected, you can use MySQL inside your workflows to query and modify database records.

Step 3: Read Data with SELECT

The most common database action is reading data. In MySQL, this is done with the SELECT statement.

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

In n8n, you can use a MySQL node or a query-based setup to run this and return rows for the next node in your workflow.

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 is useful for leads, registrations, orders, contact form entries, and chatbot submissions.

Step 5: Update Existing Records

Use UPDATE when you need to change existing rows.

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

This is useful for updating order status, customer details, payment state, or workflow progress.

Step 6: Delete Records Carefully

Use DELETE only when needed, and always include a clear WHERE condition to avoid removing everything by mistake.

DELETE FROM customers
WHERE id = 1;
Warning: running DELETE without a WHERE clause can remove all rows from a table.

Step 7: Use Dynamic Data from Previous Nodes

One of the best parts of n8n is that you can use values from previous nodes inside your database logic.

Example expression:

{{ $json.email }}

n8n also supports referencing data from earlier nodes when building more advanced workflows.

Example n8n + MySQL Workflow

Webhook
   ↓
Set
   ↓
MySQL (INSERT lead)
   ↓
MySQL (SELECT latest data)
   ↓
Telegram
   ↓
Gmail

In this workflow:

  • A webhook receives a form submission
  • A Set node formats the incoming data
  • MySQL inserts the record
  • Another MySQL step reads the saved row
  • Telegram and Gmail notify your team

Real Use Cases

Lead capture systems
Order and payment tracking
Attendance and RFID systems
CRM and admin dashboards

Best Practices

  • Use a separate MySQL user for n8n
  • Back up your database before testing destructive queries
  • Test SELECT first before running UPDATE or DELETE
  • Log important outputs during development
  • Keep table and column names clear and consistent

Common Errors and Fixes

1. Connection failed
Check host, port, username, password, and whether the MySQL server accepts remote connections.

2. Access denied
The database user may not have the right privileges.

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

4. Wrong data inserted
Check your n8n expressions and field mappings carefully.

5. Update or delete affected too many rows
Always verify your WHERE condition before executing the query.

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 MySQL automatically?
Yes. n8n can receive data from forms, APIs, spreadsheets, or webhooks and save it into MySQL automatically.

Can I update MySQL rows from n8n?
Yes. You can use update queries to change values such as status, amount, timestamps, or user details.

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


SEO Title

n8n MySQL Tutorial: How to Automate Database Workflows

Meta Description

Learn how to use n8n with MySQL to automate database queries, inserts, updates, deletes, and connected workflow actions.

Monday, 20 April 2026

How to Automate WordPress Posts Using n8n

n8n + WordPress Tutorial

How to Automate WordPress Posts Using n8n

Automatically publish blog posts, images, and SEO content using n8n workflows 🚀

If you want to automate content publishing, combining n8n with WordPress is one of the best setups. You can generate content, upload images, and publish posts — all automatically.

💡 Example: AI generates blog → n8n formats content → WordPress publishes post → Done automatically.

📌 What You'll Learn

  • Connect WordPress to n8n
  • Create posts automatically
  • Upload featured images
  • Build full automation workflow
  • SEO automation tips

What is n8n + WordPress Automation?

WordPress is a powerful CMS, and n8n allows you to automate how content gets created and published.

Step 1: Enable WordPress API

WordPress has a built-in REST API:

https://yourdomain.com/wp-json/wp/v2/posts

Make sure your site is accessible and supports authentication.

Step 2: Create WordPress Credentials in n8n

  • Go to n8n → Credentials
  • Add WordPress
  • Use Application Password (recommended)
⚠️ Use WordPress Application Password instead of your main password.

Step 3: Create a Post via n8n

Endpoint:

POST /wp-json/wp/v2/posts

Example body:

{
  "title": "My Automated Blog Post",
  "content": "This post was created using n8n 🚀",
  "status": "publish"
}

This will publish a post instantly.

Step 4: Upload Featured Image

Upload image via:

POST /wp-json/wp/v2/media

Then attach the image ID as:

"featured_media": 123

Full Automation Workflow

Google Sheets → OpenAI → Format → WordPress → Telegram
  • Get topic from Google Sheets
  • Generate content with AI
  • Format HTML
  • Publish to WordPress
  • Send notification

SEO Automation Tips

  • Use proper headings (H1, H2, H3)
  • Add meta description
  • Use keywords in title
  • Generate tags automatically

Real Use Cases

Auto Blog Posting
News Aggregation
AI Content Generation
SEO Automation

Common Errors

❌ Unauthorized (wrong credentials)
❌ REST API disabled
❌ Missing fields
❌ Wrong endpoint

Pro Tips

  • Use HTML formatting for posts
  • Store content in Google Sheets
  • Use AI for content generation
  • Schedule posts using cron node

🎥 Watch My n8n Automation Tutorials

I share real workflows, automation systems, and AI tutorials.

▶ Visit My YouTube Channel

FAQ

Q: Can I auto post daily?
Yes, using n8n Cron node.

Q: Can I add images automatically?
Yes, using WordPress media API.

Q: Can I use AI content?
Yes, integrate OpenAI with n8n.


SEO Title: n8n WordPress Automation Tutorial (Auto Blog Posting Guide)

Meta Description: Learn how to automate WordPress posts using n8n with AI, images, and scheduling.

Sunday, 19 April 2026

n8n Xendit GCash Tutorial: Automate Payments in the Philippines

n8n + Xendit + GCash Tutorial

How to Use n8n with Xendit GCash for Payment Automation

Learn how to automate GCash payment flows using n8n, Xendit API, webhooks, and notifications.

If you want to build a modern payment automation workflow in the Philippines, combining n8n with Xendit GCash is a strong setup. Xendit handles the payment collection, while n8n automates what happens before and after the payment.

💡 Example: customer clicks pay → Xendit creates a GCash payment request → customer completes payment in GCash → webhook hits n8n → Google Sheets, Telegram, email, or CRM updates automatically.

What You’ll Learn

  • How Xendit GCash works
  • How to connect Xendit to n8n
  • How to create a payment request
  • How to receive webhook events in n8n
  • How to build a full payment automation workflow

What Is Xendit GCash?

Xendit allows merchants to collect payments through supported payment channels. For GCash, the channel is documented as an e-wallet payment method for the Philippines using PHP.

In practice, the usual user flow is simple: you create a payment request, Xendit returns the next action for the customer, and the customer completes the payment through a redirect or deep link.

Important: GCash uses a redirect approval flow, so your workflow should expect a checkout URL or app handoff for the user to complete payment.

Key GCash Details for Integration

  • Channel Code: GCASH
  • Type: EWALLET
  • Currency: PHP
  • Country: PH
  • Min Amount: 1
  • Max Amount: 100,000.00
  • User Approval Flow: REDIRECT
  • Desktop Support: Web URL
  • Mobile Support: Deeplink URL

Step 1: Get Your Xendit API Key

In Xendit, generate your secret API key from the dashboard. Xendit’s docs say their API uses Basic Auth, with your secret API key as the username and an empty password.

⚠️ Keep your secret key private. Do not expose it in frontend code or public pages.

Step 2: Build the n8n Workflow

A practical starter workflow looks like this:

Webhook / Manual Trigger
   ↓
Set / Edit Fields
   ↓
HTTP Request (Create Xendit Payment Request)
   ↓
Respond to Webhook or Store Checkout URL
   ↓
Webhook (Xendit Event)
   ↓
IF
   ↓
Google Sheets / Telegram / Gmail / CRM

In n8n, the HTTP Request node is the easiest way to call Xendit’s REST API, while the Webhook node is how you receive payment updates from Xendit.

Step 3: Create the Payment Request

Xendit’s current Payments API uses /payment_requests for collecting one-off payments. For e-wallet flows like GCash, this is the endpoint you’ll typically use for a standard pay flow.

Endpoint:

POST https://api.xendit.co/payment_requests

Example n8n HTTP Request settings:

  • Method: POST
  • Authentication: Basic Auth
  • Username: YOUR_XENDIT_SECRET_KEY
  • Password: leave blank
  • Headers: Content-Type: application/json

Example body:

{
  "reference_id": "ORDER-1001",
  "type": "PAY",
  "country": "PH",
  "currency": "PHP",
  "amount": 500,
  "payment_method": {
    "type": "EWALLET",
    "reusability": "ONE_TIME_USE",
    "ewallet": {
      "channel_code": "GCASH",
      "channel_properties": {
        "success_return_url": "https://yourdomain.com/payment-success",
        "failure_return_url": "https://yourdomain.com/payment-failed"
      }
    }
  }
}
💡 After creating the request, Xendit returns a payment object and next-step data. For redirect-based methods, your app should send the user to the provided checkout or action URL.

Step 4: Send the Customer to GCash

Since GCash uses a redirect flow, the customer needs to complete payment outside your backend flow. On desktop, this may be a web URL. On mobile, this may be a deep link into the GCash app.

In n8n, if your workflow starts from a Webhook node, you can either:

  • Return the checkout URL directly to your frontend, or
  • Use Respond to Webhook to send a clean JSON response containing the payment link.

Step 5: Receive Xendit Webhook Events

After the customer completes or abandons the payment, Xendit sends a webhook event to your server. In n8n, the Webhook node can receive this event and start the status-handling workflow.

n8n provides both Test URL and Production URL for Webhook nodes, so make sure you register the production URL in your Xendit dashboard when you go live.

Typical webhook workflow:

Webhook
   ↓
IF payment status = succeeded
   ├── Google Sheets update
   ├── Telegram notification
   ├── Send receipt email
   └── Update CRM
else
   └── Mark payment as failed / pending

Step 6: Log the Payment in Google Sheets

A common pattern is to store payment records in Google Sheets for simple reporting. You can save fields like:

  • reference_id
  • payment_request_id
  • amount
  • currency
  • status
  • customer name
  • paid_at

Step 7: Notify via Telegram or Email

Once a successful GCash payment comes in, n8n can instantly notify you or your team via Telegram, Gmail, Slack, or SMS.

Example message:

✅ New GCash payment received
Order: ORDER-1001
Amount: ₱500
Status: SUCCEEDED

Real Use Cases

Online order checkout
Invoice payment links
Reservation or booking deposits
Auto-updated payment dashboards

Common Errors and Fixes

1. Authentication failed
Make sure your HTTP Request node is using Basic Auth correctly with the secret key as username and blank password.

2. Customer cannot complete payment
Check your success and failure return URLs and confirm you are using the correct redirect URL returned by Xendit.

3. Webhook not triggering in n8n
Verify that Xendit is pointed to your production webhook URL, not your test URL.

4. Payment record not updating
Use an IF node to branch by payment status and log the raw webhook payload while testing.

5. Invalid amount or channel data
Check that your request matches GCash requirements such as PHP currency and valid amount range.

Best Practices

  • Test in Xendit test mode first
  • Log full API responses during setup
  • Use reference_id values you can trace easily
  • Separate create-payment and webhook-processing workflows
  • Keep your Xendit key only in n8n credentials or secure variables

Watch My Automation Videos on YouTube

I share real n8n builds, automation ideas, and AI workflow content on my YouTube channel.

▶ Visit My YouTube Channel

FAQ

Can I use n8n with Xendit GCash even without a dedicated Xendit node?
Yes. The n8n HTTP Request node can call Xendit’s REST API directly.

Does GCash require redirect handling?
Yes. Xendit documents GCash as using a redirect approval flow.

Can I automate payment notifications?
Yes. Once Xendit sends a webhook to n8n, you can update Sheets, send Telegram alerts, email receipts, or update your CRM automatically.


SEO Title

n8n Xendit GCash Tutorial: Automate Payments in the Philippines

Saturday, 18 April 2026

How to Use n8n with Stripe for Payment Automation

n8n + Stripe Tutorial

How to Use n8n with Stripe for Payment Automation

Automate payments, invoices, subscriptions, and alerts using n8n and Stripe 🚀

If you want to automate your payment system, combining n8n with Stripe is one of the best setups. Stripe handles payments, while n8n automates everything around it — notifications, CRM updates, invoices, and workflows.

💡 Example: When a customer pays → automatically send invoice → update Google Sheets → notify via Telegram.

📌 What You'll Learn

  • Connect Stripe to n8n
  • Create payments and invoices
  • Handle Stripe webhooks
  • Build automation workflows
  • Real use cases

What is Stripe + n8n?

Stripe is a payment platform that allows you to accept online payments, subscriptions, and invoices. n8n lets you automate what happens after a payment event.

Step 1: Get Stripe API Keys

  1. Login to Stripe Dashboard
  2. Go to Developers → API Keys
  3. Copy your Secret Key
⚠️ Keep your Secret Key secure. Never expose it publicly.

Step 2: Connect Stripe to n8n

  • Go to n8n → Credentials
  • Add Stripe credential
  • Paste your Secret Key

Step 3: Create Payment (Example)

{
  "amount": 1000,
  "currency": "usd",
  "payment_method_types": ["card"]
}

This creates a payment intent in Stripe.

Step 4: Use Stripe Webhooks

Webhooks allow Stripe to notify n8n when events happen.

payment_intent.succeeded

When this event triggers, n8n can run automation.

Real Automation Workflow

Stripe Webhook → n8n → Google Sheets → Telegram → Email
  • Customer pays
  • Webhook triggers n8n
  • Save data
  • Send notification

Real Use Cases

Auto Invoice System
Subscription Alerts
Payment Notifications
CRM Integration

Common Errors

❌ Invalid API Key
❌ Webhook not configured
❌ Wrong event type
❌ Missing fields

Pro Tips

  • Use test mode first
  • Log all webhook data
  • Use IF node for conditions
  • Secure your endpoints

🎥 Learn More on My YouTube Channel

I share real automation builds, n8n workflows, and AI systems.

▶ Visit My Channel

FAQ

Q: Is Stripe free?
No, Stripe charges transaction fees.

Q: Can I automate invoices?
Yes, using Stripe + n8n.

Q: Can I use GCash?
Stripe may support local methods depending on region.


SEO Title: n8n Stripe Tutorial: Automate Payments and Workflows

Meta Description: Learn how to integrate Stripe with n8n to automate payments, invoices, and notifications.

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.

How to Use n8n with PostgreSQL for Database Automation

n8n + PostgreSQL Tutorial How to Use n8n with PostgreSQL for Database Automation Learn how to connec...