← Back to directory

Create daily historical AI videos with Gemini, fal.ai, Telegram and YouTube

unverified

geminitelegramn8n-template

Install Guide

Draft — community verifying

Generated by claude-sonnet-auto · 5/26/2026

Prerequisites

Before setting up this integration, ensure you have the following:

  • n8n (self-hosted or cloud) — version 1.0+ recommended
    • Self-hosted requires Node.js v18+
    • Alternatively, use n8n Cloud
  • Google account with access to Google AI Studio (for Gemini API)
  • fal.ai account for AI video generation — fal.ai
  • Telegram account and the ability to create a Telegram Bot via @BotFather
  • YouTube account with a channel and access to Google Cloud Console for the YouTube Data API v3
  • A Google Cloud project with OAuth 2.0 credentials configured (required for YouTube uploads)
  • Basic familiarity with n8n's workflow editor and credential management

Get Your API Keys

1. Gemini API Key (Google AI Studio)

  1. Go to https://aistudio.google.com/app/apikey
  2. Sign in with your Google account.
  3. Click Create API key.
  4. Select an existing Google Cloud project or create a new one.
  5. Copy the generated API key and store it securely.

2. fal.ai API Key

  1. Go to https://fal.ai/dashboard/keys
  2. Sign in or create a free account.
  3. Click Add key, give it a name (e.g., n8n-video-integration).
  4. Copy the key — it will only be shown once.

3. Telegram Bot Token

  1. Open Telegram and search for @BotFather.
  2. Send the command /newbot.
  3. Follow the prompts to name your bot and choose a username (must end in bot).
  4. BotFather will reply with a token like 123456789:ABCDefGHIjklMNOpqrSTUvwxYZ.
  5. Copy this token.

4. YouTube Data API v3 (OAuth 2.0)

  1. Go to https://console.cloud.google.com/ and select your project.
  2. Navigate to APIs & Services → Library.
  3. Search for YouTube Data API v3 and click Enable.
  4. Go to APIs & Services → Credentials.
  5. Click Create Credentials → OAuth 2.0 Client ID.
  6. Set application type to Web application.
  7. Add your n8n instance URL as an Authorized redirect URI, e.g.:
    https://your-n8n-instance.com/rest/oauth2-credential/callback
    
  8. Click Create and note down the Client ID and Client Secret.

Installation

Option A: Self-Hosted n8n (Recommended for full control)

Install n8n globally via npm:

npm install -g n8n

Or using Docker:

docker pull n8nio/n8n
docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

Import the Workflow

  1. Log in to your n8n instance at http://localhost:5678.
  2. In the left sidebar, click Workflows → New.
  3. Click the ⋮ (three dots) menu in the top-right corner and select Import from file or Import from URL.
  4. If you have the workflow JSON file, select it from your local machine:
    /path/to/daily-historical-ai-videos-workflow.json
    
  5. Click Import to load the workflow into the editor.

Option B: n8n Cloud

  1. Log in at https://app.n8n.cloud/.
  2. Follow the same import steps above — no local installation required.

Configuration

Set up the following credentials inside n8n under Settings → Credentials → New Credential:

| Variable / Credential | Description | Where to get it | |---|---|---| | GEMINI_API_KEY | API key for Google Gemini (text/content generation) | Google AI Studio | | FAL_AI_API_KEY | API key for fal.ai video generation | fal.ai Dashboard | | TELEGRAM_BOT_TOKEN | Token for your Telegram bot to send messages/notifications | @BotFather on Telegram | | TELEGRAM_CHAT_ID | The chat or channel ID where the bot posts updates | Send a message to your bot, then call https://api.telegram.org/bot<TOKEN>/getUpdates | | YOUTUBE_CLIENT_ID | OAuth 2.0 Client ID for YouTube Data API v3 | Google Cloud Console → Credentials | | YOUTUBE_CLIENT_SECRET | OAuth 2.0 Client Secret for YouTube Data API v3 | Google Cloud Console → Credentials | | YOUTUBE_CHANNEL_ID | The ID of the YouTube channel to upload videos to | Found in YouTube Studio → Settings → Channel → Advanced |

Connecting Credentials in n8n

  1. Open the imported workflow.
  2. Click each node that shows a credential warning (Gemini, fal.ai HTTP node, Telegram, YouTube).
  3. For each node, click Credential → Create New and fill in the relevant values from the table above.
  4. For YouTube, complete the OAuth2 authorization flow by clicking Connect and signing in with your Google account.

Running the Bot

Start n8n (self-hosted)

n8n start

Then open your browser to:

http://localhost:5678

Activate the Workflow

  1. Open the imported workflow in the editor.
  2. Toggle the Active switch in the top-right corner to ON.
  3. The workflow will now run automatically on its configured schedule (typically once daily — check the Schedule Trigger node to confirm or adjust the cron time).

Running Manually (for testing)

  1. Open the workflow.
  2. Click Execute Workflow (the ▶ play button) to trigger a manual run immediately.

Production Mode (Docker, persistent)

docker run -d \
  --name n8n-prod \
  --restart unless-stopped \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

Testing

Smoke Test — Manual Execution

  1. Open the workflow in n8n.
  2. Click Execute Workflow to run it immediately.
  3. Watch each node turn green (success) as it executes.
  4. Verify the following outcomes:
    • The Gemini node returns a historical topic/script (check node output panel).
    • The fal.ai node returns a video URL or file reference.
    • The Telegram node shows a message was sent — check your Telegram chat for the notification.
    • The YouTube node shows a successful upload response with a videoId.

Verify Telegram Notification

Send a test API call to confirm your bot token and chat ID are correct:

curl "https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendMessage" \
  -d "chat_id=<YOUR_CHAT_ID>&text=Test+from+n8n+workflow"

You should receive the message in Telegram within seconds.

Verify YouTube Upload

After a successful run, check your YouTube Studio at:

https://studio.youtube.com/

Navigate to Content and confirm the new video appears (it may be in Processing status initially).


Troubleshooting

| Problem | Likely cause | Fix | |---|---|---| | Gemini node returns 403 Permission Denied | API key is invalid or Gemini API is not enabled | Double-check the key in Google AI Studio; ensure the API is active for your project | | fal.ai node times out or returns 401 Unauthorized | Incorrect or expired fal.ai API key | Regenerate your key at fal.ai Dashboard and update the credential in n8n | | Telegram bot sends no message | Wrong TELEGRAM_CHAT_ID or bot not added to the chat | Call https://api.telegram.org/bot<TOKEN>/getUpdates after messaging the bot to retrieve the correct chat_id; ensure the bot is a member of the target group/channel | | YouTube upload fails with insufficientPermissions | OAuth scope missing or token expired | Re-authorize the YouTube credential in n8n (Settings → Credentials), ensuring the youtube.upload scope is granted during OAuth consent | | Workflow doesn't run on schedule | Workflow is not activated | Toggle the Active switch to ON in the workflow editor; also verify the Schedule Trigger node's cron expression is correct | | n8n crashes on startup | Node.js version too old | Run node --version and confirm it is v18+; upgrade via nvm install 18 && nvm use 18 if needed | | fal.ai video generation returns an empty or broken file | Model parameters out of range or unsupported format | Check the fal.ai node's model input parameters against the fal.ai model docs and adjust resolution or duration settings |

Sign in to leave feedback on this guide.

Language
n8n-workflow
Author
itan
Stars
1758
Source
n8n
Added
5/25/2026
Found something off? Email meow@cheesyboy.dev and we'll update the entry.