Skip to main content

Automate product ad creation with Telegram, Fal.AI & Facebook posting

Workflow preview

Workflow preview
100%
Automate product ad creation with Telegram, Fal.AI & Facebook posting preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow automates the entire process of creating and publishing social media ads — directly from Telegram. By simply sending a product photo to your Telegram bot, the system analyzes the imag...

Best for

  • Social Media automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.stickynote, n8n-nodes-base.wait, n8n-nodes-base.telegramtrigger, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.openai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jaruphat J..

Original n8n.io source

1.1 Workflow description

Title
Automate product ad creation with Telegram, Fal.AI & Facebook posting
Workflow name
Automate product ad creation with Telegram, Fal.AI & Facebook posting

This workflow automates the entire process of creating and publishing social media ads — directly from Telegram.
By simply sending a product photo to your Telegram bot, the system analyzes the image, generates an AI-based advertising prompt, creates a marketing image via Fal.AI, writes an engaging Facebook/Instagram caption, and posts it automatically.

This template saves hours of manual work for marketers and small business owners who constantly need to design, write, and publish product campaigns. It eliminates repetitive steps like prompt writing, AI model switching, and post scheduling — letting you focus on strategy, not execution.

The workflow integrates seamlessly with Fal.AI for image generation, OpenAI Vision for image analysis, and the Facebook Graph API for automated publishing.
Whether you’re launching a 10.10 campaign or promoting a new product line, this template transforms your product photo into a ready-to-publish ad in just minutes.


Who’s it for

This workflow is designed for:

  • Marketers and e-commerce owners who need to create social content quickly.
  • Agencies managing multiple clients’ campaigns.
  • Small business owners who want to automate Facebook/Instagram posts.
  • n8n creators who want to learn AI-assisted content automation.

What problem does this solve

Manually creating ad images and captions is time-consuming and repetitive.
You need to:

  1. Edit the product photo.
  2. Write a creative brief or prompt.
  3. Generate an image in Fal.AI or Midjourney.
  4. Write a caption.
  5. Log into Facebook and post.

This workflow combines all five steps into one automation — triggered directly by sending a Telegram message.
It handles AI analysis, image creation, caption writing, and posting, removing human friction while maintaining quality and creative control.


What this workflow does

The workflow is divided into four main zones, color-coded inside the canvas:

🟩 Zone 1 – Product Image Analysis

  • Trigger: User sends a product image to a Telegram bot.
  • n8n retrieves the file path using Telegram API.
  • OpenAI Vision analyzes the product photo and describes color, material, and shape.
  • An AI agent converts this into structured data for generating ad prompts.

🟥 Zone 2 – Generate Ad Image Prompt

  • The AI agent creates a professional advertising prompt based on the product description and campaign (e.g., “10.10 Sale”).
  • The prompt is sent to the user for confirmation via Telegram before proceeding.

🟨 Zone 3 – Create Ad Image via Fal.AI

  • The confirmed prompt and image are sent to Fal.AI’s image generation API.
  • The system polls the generation status until completion.
  • The generated image is sent back to Telegram for user review and approval.

🟦 Zone 4 – Write Caption & Publish

  • The approved image is re-analyzed by AI to write a Facebook/Instagram caption.
  • The user confirms the text on Telegram.
  • Once approved, the workflow uploads the final post (image + caption) to Facebook automatically using the Graph API.

Setup

Prerequisites

  • n8n self-hosted or Cloud account
  • Telegram Bot Token (via @BotFather)
  • Fal.AI API key
  • Facebook Page Access Token with publishing permissions
  • OpenAI API Key for image analysis and text generation

Steps

  1. Create a Telegram Bot and paste its token into n8n Credentials.
  2. Set up Fal.AI Credentials under HTTP Request → Authentication.
  3. Connect your Facebook Page through Facebook Graph API credentials.
  4. In the HTTP Request node, set:
    • URL: https://fal.run/fal-ai/nano-banana
    • Auth: Bearer {{ $credentials.FalAI.apiKey }}
  5. Configure all LLM and Vision nodes using your OpenAI credentials.

Node settings

🟩 Analyze Image (OpenAI Vision)

{
  "model": "gpt-4o-mini",
  "input": [
    {
      "role": "user",
      "content": [
        { "type": "image_url", "image_url": "{{$json.image_url}}" },
        { "type": "text", "text": "Describe this product in detail for advertising context." }
      ]
    }
  ]
}

🟥 Set Node – Prepare Fal.AI Body

{
  "prompt": {{ JSON.stringify(($json.ad_prompt || '').replace(/\r?\n/g, ' ')) }},
  "image_urls": [{{ JSON.stringify($json.image_url || '') }}],
  "num_images": 1,
  "output_format": "jpeg"
}

🟦 HTTP Request (Facebook Graph API)

{
  "method": "POST",
  "url": "https://graph.facebook.com/v19.0/me/photos",
  "body": {
    "caption": "{{ $json.caption_text }}",
    "url": "{{ $json.final_image_url }}",
    "access_token": "{{ $credentials.facebook.accessToken }}"
  }
}

How to customize the workflow

  • Change AI Models: Swap Fal.AI for Flux, Veo3, or SDXL by adjusting API endpoints.
  • Add Channels: Extend the workflow to post on LINE OA or Instagram.
  • Add Approval Logic: Keep Telegram confirmation steps before every publish.
  • Brand Rules: Adjust AI prompt templates to enforce tone, logo, or color palette consistency.
  • Multi-language Posts: Add translation nodes for global campaigns.

Troubleshooting

Problem Cause Solution
Telegram message not triggering Webhook misconfigured Reconnect Telegram Trigger
Fal.AI API error Invalid JSON or token Use JSON.stringify() in Set node and check credentials
Facebook upload fails Missing permissions Ensure Page Access Token has pages_manage_posts
LLM parser error Output not valid JSON Add Structured Output Parser and enforce schema

⚠️ Security Notes

  • Do NOT hardcode API keys in Set or HTTP Request nodes.
  • Always store credentials securely under n8n Credentials Manager.
  • For self-hosted setups, use .env variables for sensitive keys (OpenAI, Fal.AI, Facebook).

🏷️ Hashtags

#n8n #Automation #AIworkflow #FalAI #FacebookAPI #TelegramBot #nanobanana #NoCode #MarketingAutomation #SocialMediaAI #JaruphatJ #WorkflowTemplate #OpenAI #LLM #ProductAds #CreativeAutomation

Product Image

Process Step

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Send a text message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 4 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 6 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - Structured Output Parser1

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 8 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Receive Product Image (Telegram Trigger)

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 12 - Get Telegram File Path

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Analyze Product Image (OpenAI Vision)

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 14 - Generate Ad Prompt Draft (from Image Analysis)

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 15 - Assemble Prompt Parameters

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - User Review: Approve/Reject Ad Prompt

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 17 - Check Prompt Approval (Yes/No)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 18 - Revise Prompt Based on Feedback

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 19 - Prepare Fal.AI Input Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Call Fal.AI API (nano-banana model)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 21 - Check Fal.AI Image Status

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 22 - Verify Image Generation Completed

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 23 - Retrieve Generated Image URL

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 24 - Send Generated Image to Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate product ad creation with Telegram, Fal.AI & Facebook posting
Complexity advanced
Nodes 35
Categories Social Media, Multimodal AI
Author Jaruphat J.
Published 13 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9561/9561.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate product ad creation with Telegram, Fal.AI & Facebook posting do?

This workflow automates the entire process of creating and publishing social media ads — directly from Telegram. By simply sending a product photo to your Telegram bot, the system analyzes the imag...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, Multimodal AI use case.