Amazon Affiliate Content Generator for Facebook using Gemini AI - n8n Workflow

Automate Amazon affiliate marketing by using this n8n workflow to generate scroll-stopping Facebook posts with AI-enhanced images and captions, triggered by Google Sheets. Get started with n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Affiliate marketers managing product promotion across social media platforms.

  • Social media managers needing scalable, automated content creation.

  • Users looking for advanced examples of multimodal AI capabilities within n8n.

  • Developers needing robust n8n templates for integrating multiple APIs (AI, RapidAPI, Social Media).

Overview

This powerful n8n workflow is designed to streamline the demanding process of Amazon affiliate marketing content generation. When a new product link is added to your dedicated Google Sheet, this n8n automation immediately springs into action. It solves the pain point of manual content creation by leveraging multiple advanced AI models (like Gemini via OpenRouter) to generate high-quality, engaging content and professional images.

This specialized n8n node combination handles everything from fetching granular product specifics via RapidAPI to creating custom, professional product photography using multimodal AI transformation, and writing compelling, high-converting Facebook captions. Deploying this robust n8n workflow ensures a high volume of quality social media content with minimal effort, making it one of the most effective n8n templates for commerce.

How it Works

The entire process begins with the Google Sheets Trigger n8n node, which initiates the n8n workflow whenever a new row (containing a product link) is added.


  1. ASIN Extraction: An initial AI agent (asin number) uses the product link to cleanly extract the required ASIN (Amazon Standard Identification Number).

  2. Product Data Retrieval: The Amazon Product Details n8n node (configured as an HTTP Request to RapidAPI) uses the extracted ASIN to retrieve all relevant product information, including the title, description, and original product photo URL.

  3. Content Generation in Parallel: The n8n workflow splits to generate the text caption and the image prompt simultaneously.

Caption: The FB caption n8n node (using an OpenRouter/Gemini model) generates a short, scroll-stopping Facebook post caption, ensuring the affiliate link and a strong CTA are included.
Image Prompt: The Image Prompt Generate n8n node creates a sophisticated prompt designed for AI image transformation, instructing the model to turn the basic product photo into a professional, cinematic shot featuring a human model.

  1. Image Preparation: The original product image is downloaded via an HTTP Request (Product Image) and subsequently uploaded to the Gemini server using the Image Upload To Server n8n node, preparing it for multimodal AI processing.

  2. AI Image Transformation: The ai image generator n8n node sends the uploaded image URI and the detailed prompt to the Gemini API. This node executes the multimodal AI task, generating a professional, enhanced product photograph.

  3. Final Steps: The output image data is converted to a binary file using the Convert to File n8n node, followed by a brief Wait n8n node pause to ensure readiness.

  4. Posting and Tracking: The Facebook Graph API n8n node posts the newly generated image and the AI-written caption to your designated Facebook page/profile. Finally, the Google Sheets n8n node updates the original trigger row, marking the 'Facebook Upload' column as “Done ✅”, thereby closing the entire n8n automation loop.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Google Sheets Setup: Configure the Google Sheets Trigger n8n node. You must connect your Google Sheets credentials and specify the Document ID and Sheet Name. Ensure your sheet has columns like “Product Link” and “Facebook Upload”.

  3. API Keys: Update the necessary HTTP Request n8n node credentials:

RapidAPI: In the Amazon Product Details n8n node, replace YOURAPIKEY with your actual key for the Amazon product data endpoint.
Google Gemini API: Replace YOURAPIKEY in the Image Upload To Server and ai image generator n8n nodes with your Gemini API key.

  1. AI Model Connection: Provide credentials for OpenRouter, which is used by the OpenRouter Chat Model n8n nodes for ASIN extraction and content generation.

  2. Facebook Integration: Authenticate the Facebook Graph API n8n node with your Facebook account, granting permission for posting photos and messages.

Once all credentials are set up, activate this n8n workflow to run automatically upon new Google Sheet additions.

Node Details

Google Sheets Trigger (n8n trigger): The entry point of the n8n workflow. It monitors a specified sheet for newly added rows, capturing the Amazon product link to start the automation.
OpenRouter Chat Model2 (AI Agent n8n node): Specialized AI agent using Gemini to reliably extract the ASIN number from the incoming Amazon product URL.
Amazon Product Details (HTTP Request n8n node): Fetches comprehensive product data (title, images, descriptions) from Amazon using the extracted ASIN, requiring a RapidAPI key.
FB caption (AI Agent n8n node): Utilizes the OpenRouter platform (Gemini) to generate a short, high-conversion Facebook caption tailored to the product, incorporating emojis and the affiliate link directly from the product details.
Image Prompt Generate (AI Agent n8n node): Creates a detailed, cinematic prompt used to guide the multimodal image generation process, instructing the AI to feature a human model with the product for professional results.
ai image generator (HTTP Request n8n node): The core creative n8n node. It sends the original product image and the generated prompt to the Gemini API to transform the basic photo into professional, high-quality social media creative.
Facebook Graph API (n8n node): Uploads the newly generated AI image and the AI-written caption to the designated Facebook feed or page.
Google Sheets (n8n node): Performs the final action of the n8n workflow, updating the row that triggered the execution, confirming successful content creation and posting.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Featured*