๐ŸŽฌ Generate AI images with Gemini and upload them to WordPress (sub-workflow)

โšก 61 views ยท ๐ŸŽฌ Content Creation & Video

Description

๐Ÿ–ผ๏ธ Generate AI Image with Gemini and Upload to WordPress

Sub-workflow โ€” Called by a parent workflow to generate a photorealistic AI image from a text prompt and upload it directly to the WordPress Media Library.

How it works

  1. Receives a query string field via the Execute Workflow Trigger (passthrough mode).
  2. Sends the query to Google Gemini to generate a professional, photorealistic image.
  3. Uploads the resulting binary image to your WordPress Media Library via the WP REST API.
  4. Returns url, media_id, and alt to the calling parent workflow.

Setup

  1. Connect your Google Gemini (PaLM) API credential to the Gemini โ€” Generate Image node.
  2. Connect your WordPress API credential to the WP โ€” Upload Image to Media Library node.
  3. Update the WordPress URL in that node to point to your site: https://your-site.com/wp-json/wp/v2/media.
  4. Call this workflow from a parent workflow, passing a JSON field named query.

Customization

โš ๏ธ Community Node Notice: This workflow uses @n8n/n8n-nodes-langchain.googleGemini, a LangChain community node. It requires a self-hosted n8n instance with the LangChain add-on installed.

๐Ÿ”— Nodes Used

HTTP Request, Execute Workflow Trigger, Google Gemini

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup