Templates / Generate viral Facebook posts with Gemini 2.0 & AI image generation

Generate viral Facebook posts with Gemini 2.0 & AI image generation

Needs changes

by Charles ✓ · 4,420 views · created 2025-09-19 · Social Media, Multimodal AI

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Function (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 18 nodes and runs when someone submits an n8n form (“Input the post idea”). Along the way it connects Facebook Graph API, Google Sheets, Google Gemini Chat Model and Gmail. It also calls router.huggingface.co over HTTP.

How it runs

Trigger: When someone submits an n8n form (“Input the post idea”).

  1. Append row in sheet (Google Sheets): append
  2. If: checks a condition and branches into true / false
  3. Basic LLM Chain: sends a prompt to an LLM, with model: Google Gemini Chat Model
  4. Code: runs custom JavaScript code
  5. If: checks a condition and branches into true / false
  6. Basic LLM Chain: sends a prompt to an LLM, with model: Google Gemini Chat Model
  7. HTTP Request: calls router.huggingface.co (POST)
  8. save content (Google Sheets): append
  9. Convert to File code (Code): runs custom JavaScript code
  10. Format Content (Function): runs custom JavaScript (legacy Function node)

…plus 5 more steps. See the full node list below.

Services it uses

Facebook Graph APIGoogle SheetsGoogle Gemini Chat ModelGmail

HTTP calls to: router.huggingface.co

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • Function (legacy) in Format Content: replace with Code node, mode 'Run Once for All Items'.
Removed in 3.0Replace with
Function (legacy)
Format Content
Code node, mode 'Run Once for All Items'

Nodes used (11)

From the author

🚀 AI Facebook Post Generator - Complete Setup Guide > Transform your content ideas into viral Facebook posts with AI-powered automation in just 30 minutes! --- 📋 Prerequisites Checklist What you'll need before we start: - ✅ n8n instance (cloud or…

Excerpt from Charles's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.