Back to Integrations
integrationFacebook Graph API node
integrationGoogle Gemini Chat Model node

Facebook Graph API and Google Gemini Chat Model integration

Save yourself the work of writing custom integrations for Facebook Graph API and Google Gemini Chat Model and use n8n instead. Build adaptable and scalable Development, AI, and Langchain workflows that work with your technology stack. All within a building experience you will love.

How to connect Facebook Graph API and Google Gemini Chat Model

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

Facebook Graph API and Google Gemini Chat Model integration: Create a new workflow and add the first step

Step 2: Add and configure Facebook Graph API and Google Gemini Chat Model nodes

You can find Facebook Graph API and Google Gemini Chat Model in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure Facebook Graph API and Google Gemini Chat Model nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Facebook Graph API and Google Gemini Chat Model integration: Add and configure Facebook Graph API and Google Gemini Chat Model nodes

Step 3: Connect Facebook Graph API and Google Gemini Chat Model

A connection establishes a link between Facebook Graph API and Google Gemini Chat Model (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

Facebook Graph API and Google Gemini Chat Model integration: Connect Facebook Graph API and Google Gemini Chat Model

Step 4: Customize and extend your Facebook Graph API and Google Gemini Chat Model integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect Facebook Graph API and Google Gemini Chat Model with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Facebook Graph API and Google Gemini Chat Model integration: Customize and extend your Facebook Graph API and Google Gemini Chat Model integration

Step 5: Test and activate your Facebook Graph API and Google Gemini Chat Model workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from Facebook Graph API to Google Gemini Chat Model or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

Facebook Graph API and Google Gemini Chat Model integration: Test and activate your Facebook Graph API and Google Gemini Chat Model workflow

✨🤖Automate Multi-Platform Social Media Content Creation with AI

Automate Multi-Platform Social Media Content Creation with AI

Who is this for?
Social Media Managers and Digital Marketers seeking to streamline content production across 7+ platforms (X/Twitter, Instagram, LinkedIn, Facebook, TikTok, Threads, YouTube Shorts) using AI-powered automation.

What problem does this solve?
Creating platform-optimized content at scale while maintaining brand consistency across multiple channels, reducing manual work by 80% through AI generation and automated publishing.

What this workflow does
AI Content Generation:
Uses GPT-4/Gemini to create platform-specific posts
Automatically generates hashtags, CTAs, and emoji placement
Supports image/video suggestions and image creation using OpenAI or Pollinations.ai
Uses SERP api to search for relavent content

Approval Workflow:
Sends formatted HTML emails for human review
Implements double-approval system with Gmail integration

Cross-Platform Publishing:
One-click deployment to:
Instagram/Facebook (via Graph API)
X/Twitter (Official API)
LinkedIn (Sales Navigator integration)

Setup
Credentials:
OpenAI API key
Google Gemini API
Social media platform tokens (X, LinkedIn, Facebook)
ImgBB for image hosting
Gmail
SERP API
Telegram

Configuration:
Update all "your-unique-id" placeholders in API nodes
Set email recipients in Gmail nodes
Customize AI prompts

Customization:
Adjust character limits per platform
Modify approval thresholds
Add/remove social platforms as needed

How to customize
Content Style**: Edit prompt templates in the "Social Media Content Factory" agent node
Approval Process**: Modify email templates
Analytics**: Connect to Google Sheets for performance tracking
Image Generation**: Switch between Pollinations.ai/DALL-E/Midjourney

Nodes used in this workflow

Popular Facebook Graph API and Google Gemini Chat Model workflows

+13

🤖 AI content generation for Auto Service 🚘 Automate your social media📲!

Who Is This For? 🚘This workflow is designed for auto service / car repair businesses looking to streamline their social media marketing with Ai tools and automation via n8n. Whether you’re a small garage owner, a car repair shop, an automotive specialist or automechanic - this tool helps you maintain an active online presence without spending hours creating content. 💪🏼 Though this template is set up for Auto Service daily content uploads, but the underlying logic is universal. You can easily adapt it for any niche by editing prompts, adding nodes, and creating or uploading a variety of content to any platform. You can use any LLM and generative AI of your choice. Personally, I prefer the smooth and effective results from ChatGPT 4.1 combined with GPT Image 1. But you can generate videos instead of images for your posts as well 😉 What Problem Is This Workflow Solving? 🤦‍♂️ Many auto service businesses struggle with consistently posting engaging content due to time constraints or lack of marketing expertise. 💎This workflow solves that by automating the content creation and posting process, ensuring your social media channels stay fresh and active, ultimately attracting more customers. What This Workflow Does: Generates daily social media posts tailored specifically to the auto service niche using AI. Allows easy customization of post and image prompts. Integrates research links through the Tavily Internet Search tool for relevant content. Supports starting posts based on reference article links via Google Sheets. Automatically publishes posts to your connected social media platforms. Enables scheduled or trigger-based posting for maximum flexibility. How It Works? Easy, actually ☺️ AI creates daily social media content made just for Auto Service. You can simply edit prompts for both posts and images, set up news or articles research links via the Tavily Internet Search tool. You can also start the workflow with a reference article link through Google Sheets. 🎯 Consistently posting relevant and actual niche content helps attract new customers, all while leveraging AI and n8n tools to keep the process seamless and cost-effective. Set Up Steps: I kept it quick and simple for you ✨ If you’re happy with the current LLM and image model configurations, just connect your OpenAI API credentials to enable AI content generation. Link your social media accounts (Facebook, Telegram, X, etc.) for autoposting. Optionally connect Google Sheets if you want to trigger posts based on sheet updates with reference links. Customize prompts as needed to match your brand voice, style and marketing tasks. Choose between: 1) Scheduled automatic generation and posting at the same time as socials algorythms like it. 2) Google Sheets trigger with reference. 3) Manual start. How to Customize This Workflow to Your Needs? Switch AI models and edit prompts to better reflect your specific services or promotions. Add or modify research links in Tavily to keep your posts timely and relevant. Adjust posting schedules to match peak engagement times for your audience. Expand or reduce the number of social platforms integrated depending on your marketing strategy. Use Google Sheets to batch upload ideas or curate specific content topics. After adjusting a few settings, activate the workflow and let it run. 🤖 The system will then automatically publish your content across your selected social platforms — saving you time and effort. 📌 You’ll find more detailed tips and additional ai models for customizing ai generation process inside the workflow via sticky notes. 💬 Need help? For additional guidance, feel free to message me — here’s my profile in the n8n community for direct contact 👈 click!
+8

✨🤖Automate Multi-Platform Social Media Content Creation with AI

Automate Multi-Platform Social Media Content Creation with AI Who is this for? Social Media Managers and Digital Marketers seeking to streamline content production across 7+ platforms (X/Twitter, Instagram, LinkedIn, Facebook, TikTok, Threads, YouTube Shorts) using AI-powered automation. What problem does this solve? Creating platform-optimized content at scale while maintaining brand consistency across multiple channels, reducing manual work by 80% through AI generation and automated publishing. What this workflow does AI Content Generation: Uses GPT-4/Gemini to create platform-specific posts Automatically generates hashtags, CTAs, and emoji placement Supports image/video suggestions and image creation using OpenAI or Pollinations.ai Uses SERP api to search for relavent content Approval Workflow: Sends formatted HTML emails for human review Implements double-approval system with Gmail integration Cross-Platform Publishing: One-click deployment to: Instagram/Facebook (via Graph API) X/Twitter (Official API) LinkedIn (Sales Navigator integration) Setup Credentials: OpenAI API key Google Gemini API Social media platform tokens (X, LinkedIn, Facebook) ImgBB for image hosting Gmail SERP API Telegram Configuration: Update all "your-unique-id" placeholders in API nodes Set email recipients in Gmail nodes Customize AI prompts Customization: Adjust character limits per platform Modify approval thresholds Add/remove social platforms as needed How to customize Content Style**: Edit prompt templates in the "Social Media Content Factory" agent node Approval Process**: Modify email templates Analytics**: Connect to Google Sheets for performance tracking Image Generation**: Switch between Pollinations.ai/DALL-E/Midjourney

Automated AI Content Creation & Instagram Publishing from Google Sheets

Automated AI Content Creation & Instagram Publishing from Google Sheets This n8n workflow automates the creation and publishing of social media content directly to Instagram, using ideas stored in a Google Sheet. It leverages AI (Google Gemini and Replicate Flux) to generate concepts, image prompts, captions, and the final image, turning your content plan into reality with minimal manual intervention. Think of this as the execution engine for your content strategy. It assumes you have a separate process (whether manual entry, another workflow, or a different tool) for populating the Google Sheet with initial post ideas (including Topic, Audience, Voice, and Platform). This workflow takes those ideas and handles the rest, from AI generation to final publication. What does this workflow do? This workflow streamlines the content execution process by: Automatically fetching** unprocessed content ideas from a designated Google Sheet based on a schedule. Using Google Gemini to generate a platform-specific content concept (specifically for a 'Single Image' format). Generating two distinct AI image prompt options based on the concept using Gemini. Writing an engaging, platform-tailored caption (including hashtags) using Gemini, based on the first prompt option. Generating a visual image using the first prompt option via the Replicate API (using the Flux model). Publishing* the generated image and caption directly to a connected Instagram Business account*. Updating the status** in the Google Sheet to mark the idea as completed, preventing reprocessing. Who is this for? Social Media Managers & Agencies:** Automate the execution of your content calendar stored in Google Sheets. Marketing Teams:** Streamline content production from planned ideas and ensure consistent posting schedules. Content Creators & Solopreneurs:** Save significant time by automating the generation and publishing process based on your pre-defined ideas. Anyone** using Google Sheets to plan social media content and wanting to automate the creative generation and posting steps with AI. Benefits Full Automation:** From fetching planned ideas to Instagram publishing, automate the entire content execution pipeline. AI-Powered Generation:** Leverage Google Gemini for creative concepts, prompts, and captions, and Replicate for image generation based on your initial topic. Content Calendar Execution:** Directly turn your Google Sheet plan into published posts. Time Savings:** Drastically reduce the manual effort involved in creating visuals and text for each planned post. Consistency:** Maintain a regular posting schedule by automatically processing your queue of ideas. Platform-Specific Content:** AI prompts are designed to tailor concepts, prompts, and captions for the platform specified in your sheet (e.g., Instagram or LinkedIn). How it Works Scheduled Trigger: The workflow starts automatically based on the schedule you set (e.g., every hour, daily). Fetch Idea: Reads the next row from your Google Sheet where the 'Status' column indicates it's pending (e.g., '0'). It only fetches one idea per run. Prepare Inputs: Extracts Topic, Audience, Voice, and Platform from the sheet data. AI Concept Generation (Gemini): Creates a single content concept suitable for a 'Single Image' post on the target platform. AI Prompt Generation (Gemini): Develops two detailed, distinct image prompt options based on the concept. AI Caption Generation (Gemini): Writes a caption tailored to the platform, using the first image prompt and other context. Image Generation (Replicate): Sends the first prompt to the Replicate API (Flux model) to generate the image. Prepare for Instagram: Formats the generated image URL and caption. Publish to Instagram: Uses the Facebook Graph API in three steps: Creates a media container by uploading the image URL and caption. Waits for Instagram to process the container. Publishes the processed container to your feed. Update Sheet: Changes the 'Status' in the Google Sheet for the processed row (e.g., to '1') to mark it as complete. n8n Nodes Used Schedule Trigger Google Sheets (Read & Update operations) Set (Multiple instances for data preparation) Langchain Chain - LLM (Multiple instances for Gemini calls) Langchain Chat Model - Google Gemini (Multiple instances) Langchain Output Parser - Structured (Multiple instances) HTTP Request (for Replicate API call) Wait Facebook Graph API (Multiple instances for Instagram publishing steps) Prerequisites Active n8n instance (Cloud or Self-Hosted). Google Account** with access to Google Sheets. Google Sheets API Credentials (OAuth2):** Configured in n8n. A Google Sheet** structured with columns like Topic, Audience, Voice, Platform, Status (or similar). Ensure your 'pending' and 'completed' statuses are defined (e.g., '0' and '1'). Google Cloud Project** with the Vertex AI API enabled. Google Gemini API Credentials:** Configured in n8n (usually via Google Vertex AI credentials). Replicate Account** and API Token. Replicate API Credentials (Header Auth):** Configured in n8n. Facebook Developer Account**. Instagram Business Account** connected to a Facebook Page. Facebook App** with necessary permissions: instagram_basic, instagram_content_publish, pages_read_engagement, pages_show_list. Facebook Graph API Credentials (OAuth2):** Configured in n8n with the required permissions. Setup Import the workflow JSON into your n8n instance. Configure Schedule Trigger: Set the desired frequency (e.g., every 30 minutes, every 4 hours) for checking new ideas in the sheet. Configure Google Sheets Nodes: Select your Google Sheets OAuth2 credentials for both Google Sheets nodes. In 1. Get Next Post Idea..., enter your Spreadsheet ID and Sheet Name. Verify the Status filter matches your 'pending' value (e.g., 0). In 7. Update Post Status..., enter the same Spreadsheet ID and Sheet Name. Ensure the Matching Columns (e.g., Topic) and the Status value to update match your 'completed' value (e.g., 1). Configure Google Gemini Nodes: Select your configured Google Vertex AI / Gemini credentials in all Google Gemini Chat Model nodes. Configure Replicate Node (4. Generate Image...): Select your Replicate Header Auth credentials. The workflow uses black-forest-labs/flux-1.1-pro-ultra by default; you can change this if needed. Configure Facebook Graph API Nodes (6a, 6c): Select your Facebook Graph API OAuth2 credentials. Crucially, update the Instagram Account ID in the Node parameter of both Facebook Graph API nodes (6a and 6c). The template uses a placeholder (17841473009917118); replace this with your actual Instagram Business Account ID. Adjust Wait Node (6b): The default wait time might be sufficient, but if you encounter errors during publishing (especially with larger images/videos in the future), you might need to increase the wait duration. Activate the workflow. Populate your Google Sheet: Ensure you have rows with your content ideas and the correct 'pending' status (e.g., '0'). The workflow will pick them up on its next scheduled run. This workflow transforms your Google Sheet content plan into a fully automated AI-powered Instagram publishing engine. Start automating your social media presence today!
+2

Automated Instagram Reels Workflow

This workflow automates the process of creating and posting Instagram Reels, combining Google Drive, AI, Airtable, and the Facebook Graph API. It supports two content creation paths: Scheduled Random Video Selection & Posting Selects a random video from a Google Drive folder named "Random video mover" based on a schedule. Moves the video to a processing folder for posting. Manual Upload Trigger & Posting Watches a specific Google Drive folder ("n8n reels automation on instagram"). Triggers the workflow when a new video is uploaded. Core Process (applies to both paths) Download Video from Google Drive. AI Caption Generation with Google Gemini, using the file name as context. The AI creates concise captions with hashtags and a call-to-action. Airtable Logging to store video name, caption, and URL. Instagram Reels Posting via the Facebook Graph API. Recent Change In early 2025, Meta tightened its requirements for video_url and image_url parameters. URLs must now be direct, public links to the raw media file with no redirects or authentication. Google Drive links no longer work. Our Fix Store the binary file locally on the n8n server at /tmp/video.mp4. Serve the file through a public n8n webhook with the correct Content-Type. Use the webhook URL in the Facebook Graph API request. Upload succeeds without the “Media download has failed” error. Cleanup Deletes the temporary file after posting. Benefits Saves time with full automation. Improves engagement through AI-generated captions. Keeps content organized in Airtable. Works with Meta’s updated API requirements by hosting files directly from the n8n server.

Auto-Generate & Post AI Images to Facebook using Gemini & Pollinations AI

This workflow is designed for content creators or AI artists who want to automate posting unique AI-generated images to their Facebook Page multiple times a day. It uses Google Gemini via LangChain to generate imaginative image prompts, and Pollinations AI to generate the images. Posts are published with hashtags and a clean caption. Who Is It For AI artists Facebook page managers Digital marketers looking for automated creative content What It Does Triggers 3x daily at 7:00, 11:00, and 17:00 (local time) Generates random AI image prompts in a retro-futuristic, cinematic, or surreal style using Google Gemini Fetches images from Pollinations AI using custom prompts Posts images automatically to your Facebook Page with hashtags Requirements n8n self-hosted or desktop (workflow uses schedule trigger) Pollinations API (no auth needed) Facebook Page with Facebook Graph API token: Required scopes: pages_manage_posts, pages_read_engagement, pages_show_list Google Gemini API Key (used via LangChain node) How to Customize Change the prompt style in the Basic LLM Chain node (promptType: define) to suit your theme. Adjust Set The Generator Image node if you want: Different image sizes (width / height) Different seed randomness Other Pollinations models (&model=kontext) Add Telegram/Twitter nodes if you want cross-posting Use Set node to allow easy user-level configuration of models, hashtags, times, etc.
+3

AI-Powered Social Media Content Generator & Publisher

AI-Powered Social Media Content Generator & Publisher 🚀 This AI-driven n8n workflow automates social media content creation and publishing across LinkedIn, Instagram, Facebook, and Twitter (X). It generates engaging, platform-optimized posts using Google Gemini AI, based on user inputs such as a post title, keywords, and an uploaded image. The workflow ensures seamless content generation and publishing, making it a perfect tool for marketers, business owners, influencers, and content creators. 🌟 Features & Benefits ✅ AI-Generated Social Media Posts – Uses Google Gemini AI to create high-quality, optimized content. ✅ Multi-Platform Support – Automatically generates posts for LinkedIn, Instagram, Facebook, and Twitter (X). ✅ Hashtag & SEO Optimization – Includes trending hashtags to enhance visibility and engagement. ✅ Image Upload & Processing – Allows image uploads for Instagram and Facebook using imgbb and Facebook Graph API. ✅ Automated Publishing – Posts are automatically published on all selected platforms. ✅ Custom Call-to-Action – Each platform's post is optimized with CTAs for better engagement. ✅ User-Friendly Form Submission – Easy-to-use form where users can enter post titles, keywords, links, and images. ✅ Performance Tracking – Provides confirmation and tracking links for published posts. 📌 How It Works 1️⃣ User Submission Form Fill out the form with Post Title, Keywords, and an Optional Link. Upload an image for Instagram & Facebook posts. 2️⃣ AI Content Generation Google Gemini AI generates optimized content for each platform. The AI ensures professional, engaging, and audience-specific content. 3️⃣ Content Review Users review and approve the AI-generated content before publishing. 4️⃣ Automated Publishing Posts are automatically published on LinkedIn, Facebook, Instagram, and Twitter (X). Uses Facebook Graph API, LinkedIn API, Twitter API, and Instagram API. 5️⃣ Post Confirmation & Tracking Get links to track published posts on each platform. 🛠️ Prerequisites Before using this workflow, ensure you have: ✅ n8n Instance (Cloud or Self-Hosted) ✅ Social Media API Credentials (Facebook, Instagram, LinkedIn, Twitter API) ✅ Google Gemini AI API Key ✅ imgbb API Key (for image hosting) Get N8n My Affiliate Link Buy My Book: Mastering n8n on Amazon Full Courses & Tutorials: http://lms.syncbricks.com 📺 YouTube Video Tutorial 🎥 Watch the step-by-step tutorial on how to set up and use this n8n workflow template: 🔗 YouTube Tutorial - AI-Powered Social Media Posting in n8n 🎯 Use Cases 📌 Marketing Agencies – Automate client content scheduling. 📌 Businesses & Brands – Maintain a consistent brand presence on social media. 📌 Content Creators & Influencers – Generate high-quality posts quickly. 📌 E-commerce & Startups – Promote products and services effortlessly. 📌 Corporate & Enterprise Teams – Streamline internal and external communications. Important Start with n8n Learn n8n with Amjid Get n8n Book 👨‍💻 Creator Information 👤 Developed by: Amjid Ali 🌐 Website: SyncBricks 📧 Email: [email protected] 💼 LinkedIn: Amjid Ali 📺 YouTube: SyncBricks 💡 Support & Contributions If you find this workflow helpful, consider supporting my work: 👉 Donate via PayPal For full courses on * AI Automation*, visit: 📚 SyncBricks LMS 📚 AI and Auotmation Course 👉 Get Started with N8N

Build your own Facebook Graph API and Google Gemini Chat Model integration

Create custom Facebook Graph API and Google Gemini Chat Model workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

Facebook Graph API and Google Gemini Chat Model integration details

integrationFacebook Graph API node
Facebook Graph API

Facebook needs no introduction. It is an online social networking and media service that gathers people from all parts of the world, from different backgrounds, and allows them to promote their businesses and services, share, react to and comment on all types of content, and communicate and message their friends.

Use case

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more

FAQs

  • Can Facebook Graph API connect with Google Gemini Chat Model?

  • Can I use Facebook Graph API’s API with n8n?

  • Can I use Google Gemini Chat Model’s API with n8n?

  • Is n8n secure for integrating Facebook Graph API and Google Gemini Chat Model?

  • How to get started with Facebook Graph API and Google Gemini Chat Model integration in n8n.io?

Looking to integrate Facebook Graph API and Google Gemini Chat Model in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Facebook Graph API with Google Gemini Chat Model

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon