Skip to main content

Create Facebook posts and images with Google Gemini and Facebook Graph API

Workflow preview

Workflow preview
100%
Create Facebook posts and images with Google Gemini and Facebook Graph API preview
Open on n8n.io

1. Workflow Overview

This n8n template automates the creation of professional Facebook posts and visually striking illustrations directly from simple raw text. If you want to...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.if, n8n-nodes-base.httprequest, @n8n/n8n-nodes-langchain.googlegemini

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Nguyễn Thiệu Toàn (Jay Nguyen).

Original n8n.io source

1.1 Workflow description

Title
Create Facebook posts and images with Google Gemini and Facebook Graph API
Workflow name
Create Facebook posts and images with Google Gemini and Facebook Graph API

This n8n template automates the creation of professional Facebook posts and visually striking illustrations directly from simple raw text. If you want to maintain a consistent social media presence without spending hours writing copy and designing images, this workflow is perfect for you.

How it works

  • Trigger & Configuration: The workflow begins with your raw text and brand guidelines, configured entirely within a single Set Context node.
  • AI Copywriting: A Google Gemini Agent analyzes the input and crafts an engaging Facebook caption—complete with hooks, emojis, and hashtags—alongside a highly detailed image generation prompt.
  • Image Processing: The workflow intelligently branches. If you provide an original image, Gemini edits and enhances it for social media. If no image is provided, Gemini generates a brand-new illustration from scratch.
  • Facebook Publishing: The final text and image are automatically published to your Facebook Fanpage via the Graph API.

How to use

  1. Connect your Google Gemini API key in the AI Agent and Language Model nodes.
  2. Connect your Facebook Graph API credentials in the Post to Facebook node.
  3. Edit the Set Context node to update the raw_content, fanpage_name, content_style, and your specific page_id.
  4. Run the workflow to automatically generate and publish your content.

Requirements

  • n8n Version: Built and tested on n8n 2.9.4+. (Note: It is highly recommended to update to the latest n8n version to use this workflow effectively).
  • Google Gemini API key (googlePalmApi credential).
  • Facebook Page Access Token with pages_manage_posts permissions.

Customizing this workflow

  • Automate the input: Swap the Manual Trigger for a Webhook, Google Sheets, or Telegram node to generate posts on the fly from external apps.
  • Expand to other platforms: Replace the Facebook node with a LinkedIn or X (Twitter) node to distribute your AI-generated content across multiple channels.

About the Author

Created by: Nguyễn Thiệu Toàn (Jay Nguyen) Email: [email protected] Website: nguyenthieutoan.com Company: GenStaff (genstaff.net) - AI Staff. Always On. Always Yours. Socials (Facebook / X / LinkedIn): @nguyenthieutoan More templates: n8n.io/creators/nguyenthieutoan

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 - Manual Trigger

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

Block 2 - Set Context

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

Block 3 - AI Agent: Write Post & Image Prompt

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

Block 4 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1.1

Block 5 - JSON Output Parser

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

Block 6 - Select Image Mode

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

Block 7 - Download Image to Edit

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

Block 8 - Edit Original Image

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

Block 9 - Generate New Image

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

Block 10 - Post to Facebook

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

Block 11 - Post Result

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

Block 12 - Sticky Note - Main Overview

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

Block 13 - Sticky Note - Section 1

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

Block 14 - Sticky Note - Section 2

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

Block 15 - Sticky Note - Section 3

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

Block 16 - Sticky Note - Section 4

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

Block 17 - Sticky Note - Warning

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

Block 18 - Sticky Note - Author Message

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

3. Summary Table

Workflow Create Facebook posts and images with Google Gemini and Facebook Graph API
Complexity advanced
Nodes 18
Categories Content Creation, Multimodal AI
Author Nguyễn Thiệu Toàn (Jay Nguyen)
Published 18 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15794/15794.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 Create Facebook posts and images with Google Gemini and Facebook Graph API do?

This n8n template automates the creation of professional Facebook posts and visually striking illustrations directly from simple raw text. If you want to...

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 Content Creation, Multimodal AI use case.