Showing posts with label Google Sheets. Show all posts
Showing posts with label Google Sheets. Show all posts

Tuesday, 28 April 2026

n8n Gemini Image Generation Tutorial: Create AI Images Automatically

n8n + Google Gemini Tutorial

How to Create AI Images with n8n and Google Gemini

Learn how to automate AI image generation using n8n, Google Gemini, Google Sheets, and Google Drive.

If you want to create images automatically for blogs, YouTube thumbnails, social media posts, product visuals, or marketing content, combining n8n with Google Gemini is a powerful workflow.

💡 Example: Google Sheets contains image ideas → n8n reads the rows → Gemini generates images → n8n saves them to Google Drive → status updates automatically.

What You’ll Learn

  • How Gemini image generation works
  • How to connect Gemini API to n8n
  • How to generate images from text prompts
  • How to save generated images to Google Drive
  • How to build a full content automation workflow

What Is Google Gemini Image Generation?

Google Gemini can generate and process images using text prompts, reference images, or a combination of both. This makes it useful for creating thumbnails, social media graphics, blog images, concept art, product visuals, and marketing assets.

Google also provides Imagen models for high-fidelity image generation. Imagen is designed to generate realistic, high-quality images from text prompts.

Simple explanation: Gemini creates the image, while n8n automates the full process around it.

Step 1: Prepare Your Google Gemini API Key

First, get your Gemini API key from Google AI Studio or your Google AI developer account.

  1. Go to Google AI Studio
  2. Create or select your API key
  3. Copy the key
  4. Store it securely in n8n credentials or environment variables
⚠️ Security tip: never expose your API key in frontend code or public blog pages.

Step 2: Create the n8n Workflow Structure

A simple image automation workflow can look like this:

Google Sheets Trigger
   ↓
Get Row / Prompt
   ↓
HTTP Request or Gemini Node
   ↓
Convert Base64 / Download Image
   ↓
Google Drive Upload
   ↓
Update Google Sheet
   ↓
Telegram Notification

This workflow is useful if you want to generate images in bulk from a spreadsheet.

Step 3: Prepare Your Google Sheet

Create a Google Sheet with these columns:

  • title – image topic or content title
  • prompt – full image prompt
  • status – pending / done / failed
  • image_url – final uploaded image link

Example prompt:

A futuristic n8n automation dashboard with glowing nodes, dark background, cinematic lighting, high-tech UI, no text

Step 4: Generate Image Using Gemini API

In n8n, you can use either a Gemini-supported node or the HTTP Request node to call the Gemini image generation endpoint.

Typical HTTP Request setup:

  • Method: POST
  • Authentication: API key or Bearer token, depending on your setup
  • Body type: JSON
  • Prompt: use dynamic value from Google Sheets

Example dynamic prompt:

{{ $json.prompt }}
💡 Tip: For blog thumbnails, add style details like “cinematic lighting,” “dark tech background,” “3D vector style,” and “no text” for cleaner output.

Step 5: Save the Generated Image

Image generation APIs often return either a downloadable image URL or base64 image data. In n8n, your next step depends on the response type.

  • If the API returns a URL, use HTTP Request to download the file.
  • If the API returns base64, convert it to binary data.
  • Then upload the file to Google Drive, Supabase Storage, or WordPress media.

Workflow sample:

Gemini Image Response
   ↓
Convert to Binary
   ↓
Google Drive Upload
   ↓
Get Share Link
   ↓
Update Google Sheet

Step 6: Update Google Sheet Status

After saving the image, update the same Google Sheet row.

Recommended values:

  • status: done
  • image_url: Google Drive or storage link
  • generated_at: current timestamp

Real Use Cases

YouTube thumbnail ideas
Blog featured images
Social media creatives
Product mockup images

Prompt Examples for n8n Automation Content

Example 1: Tech thumbnail

A premium dark tech illustration showing automation nodes connected to AI, glowing blue and purple lights, cinematic, modern SaaS style, no text

Example 2: AI agent image

A futuristic AI assistant controlling business workflows, floating automation nodes, digital dashboard, dark background, clean modern style, no text

Example 3: Blog featured image

A clean vector-style image of a workflow automation system connecting Google Sheets, AI image generation, and cloud storage, dark background, professional, no text

Common Errors and Fixes

1. API key error
Check if your Gemini API key is active and correctly added to n8n.

2. No image returned
Check if you are using an image-capable Gemini or Imagen model.

3. Base64 conversion issue
Make sure you convert the correct response field into binary data.

4. Prompt gives messy text
Add “no text” or “no typography” to your prompt if you want a clean thumbnail background.

5. Google Drive upload fails
Check your Google Drive credentials and binary property name in n8n.

Best Practices

  • Use Google Sheets to manage prompts in bulk
  • Keep prompts clear and style-specific
  • Add “no text” for cleaner blog images
  • Save outputs to Google Drive or Supabase Storage
  • Log failed generations for retry
  • Use a Wait node if generating many images

Watch My Automation Videos on YouTube

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

▶ Visit My YouTube Channel

FAQ

Can I generate images automatically with n8n and Gemini?
Yes. You can use n8n to send prompts to Gemini or Imagen image models, then save the generated output to Drive, storage, or WordPress.

Can I generate images from Google Sheets rows?
Yes. A common workflow is Google Sheets → Gemini image generation → Google Drive upload → update row status.

Can I use this for YouTube thumbnails?
Yes. It is useful for thumbnail backgrounds, blog featured images, social media graphics, and marketing visuals.


SEO Title

n8n Gemini Image Generation Tutorial: Create AI Images Automatically

Meta Description

Learn how to use n8n and Google Gemini to generate AI images from prompts, save them to Google Drive, and automate content creation workflows.

Suggested Labels

n8n, Google Gemini, AI Image Generation, Automation, Google Drive, Google Sheets, Blogspot Tutorial

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.

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

n8n + Microsoft Outlook Tutorial

n8n + Microsoft Outlook Tutorial How to Use n8n with Microsoft Outlook for Email Automation ...