AI Virtual TryOn for WooCommerce from Google Sheets

Overview

This workflow automates the creation of realistic "virtual try-on" images for WooCommerce clothing products. It eliminates the need for expensive photoshoots by using an AI model (fal.ai's Nano Banana) to generate an image of a model wearing a specific clothing item. The workflow reads product data from a Google Sheet, triggers the AI image generation, waits for completion, downloads the result, uploads it to Google Drive, updates the Google Sheet with the new image URL, and finally updates the WooCommerce product with the generated image.

This is particularly useful for eCommerce stores with large catalogs, allowing them to quickly generate high-quality product images for all their clothing items without manual photoshoots. The entire process is automated and can be run on a schedule or manually triggered.

Workflow Steps

  1. When clicking 'Test workflow' (Manual Trigger) — Starts the workflow manually for testing or on-demand execution.

  2. Google Sheets (Google Sheets - OAuth2) — Fetches all rows from a specified Google Sheet. The sheet must contain columns for 'IMAGE MODEL', 'IMAGE PRODUCT', 'PRODUCT ID', and 'IMAGE RESULT' (which will be filled by the workflow).

  3. Loop Over Items (Split In Batches) — Iterates over each row from the Google Sheet, processing one product at a time.

  4. Set data (Set) — Extracts the 'IMAGE MODEL' and 'IMAGE PRODUCT' URLs from the current row and assigns them to variables named 'model' and 'shirt' for use in subsequent nodes.

  5. Create Image (HTTP Request - Header Auth) — Sends a POST request to the fal.ai Nano Banana API endpoint (https://queue.fal.run/fal-ai/nano-banana/edit). The request body includes a prompt instructing the AI to generate a photo of the model wearing the clothing item. It uses Header Auth with an Authorization: Key YOURAPIKEY header.

  6. Wait 60 sec. (Wait) — Pauses execution for 10 seconds (configured as 10 seconds in the JSON, despite the node name) to allow the AI image generation to complete.

  7. Get status (HTTP Request - Header Auth) — Polls the fal.ai API status endpoint (https://queue.fal.run/fal-ai/nano-banana/requests/{{request_id}}/status) to check if the image generation is complete. Uses Header Auth.

  8. Completed? (IF) — Checks if the status from the previous node equals "COMPLETED". If yes, the workflow proceeds to download the image. If not, it loops back to the Wait node to poll again.

  9. Get Url image (HTTP Request - Header Auth) — Once the status is COMPLETED, this node fetches the result data from the fal.ai API to get the URL of the generated image. Uses Header Auth.

  10. Get File image (HTTP Request - No Auth) — Downloads the actual image file from the URL provided by the previous node. This is a simple GET request with no authentication.

  11. Upload Image (Google Drive - OAuth2) — Uploads the downloaded image file to a specified folder in Google Drive. The filename is timestamped to avoid conflicts.

  12. Update result (Google Sheets - OAuth2) — Updates the current row in the Google Sheet, writing the URL of the generated image into the 'IMAGE RESULT' column.

  13. WooCommerce (WooCommerce - API Key Auth) — Updates the WooCommerce product (identified by the 'PRODUCT ID' from the sheet) by setting its main image to the newly generated image URL.

Setup Instructions

Required Accounts & Services

  1. Google Account — For Google Sheets and Google Drive access. You'll need to create OAuth2 credentials in the Google Cloud Console.
  2. fal.ai Account — Sign up at fal.ai to get an API key. This is the AI image generation service.
  3. WooCommerce Store — A WooCommerce site with API credentials (Consumer Key and Consumer Secret) enabled.

Configuration Steps

  1. Google Sheet: Create a Google Sheet with columns: IMAGE MODEL, IMAGE PRODUCT, PRODUCT ID, IMAGE RESULT. Populate the first three columns with the model image URL, product image URL, and WooCommerce product ID respectively. Leave IMAGE RESULT empty.
  2. fal.ai API Key: In the 'Create Image', 'Get status', and 'Get Url image' nodes, configure Header Auth with:
    • Name: Authorization
    • Value: Key YOUR_API_KEY (replace YOUR_API_KEY with your actual key)
  3. WooCommerce Credentials: Configure the WooCommerce node with your site URL, Consumer Key, and Consumer Secret.
  4. Google Drive Folder: (Optional) Specify a folder ID in the 'Upload Image' node to organize generated images.

Use Cases & Variations

  • Scheduled Runs: Replace the Manual Trigger with a Cron or Schedule trigger to run daily/weekly for new products.
  • Multiple AI Models: Swap the fal.ai endpoint with other image generation APIs (e.g., Stable Diffusion, DALL-E) by changing the URL and request body.
  • Different Outputs: Instead of updating WooCommerce, you could send the image URL via email, post to social media, or save to a different storage service.
  • Error Handling: Add error handling nodes (e.g., IF node for failed status) to notify you if image generation fails.
  • Batch Processing: Adjust the 'Loop Over Items' batch size to control how many products are processed concurrently.
20 nodesmanual triggerecommerce
HTTP RequestSticky NoteWoo CommerceGoogle SheetsWaitIFGoogle DriveSet

Workflow JSON

{
  "id": "HQcHQhEaig6JXOH4",
  "meta": {
    "instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462"
  },
  "name": "AI Virtual TryOn for WooCommerce Nano Banana",
  "tags": [],
  "nodes": [
    {
      "id": "614bb588-3180-47e7-8dd6-fd61883d6042",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -480,
        1600
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9f15348f-8e76-43d7-a17a-3efb1b9d5724",
      "name": "Get File image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        1872
      ],
      "parameters": {
        "url": "={{ $json.images[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "44d01abf-6b54-432a-a21c-a4b94c1487c7",
      "name": "Get Url image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        1872
      ],
      "parameters": {
        "url": "=https://queue.fal.run/fal-ai/nano-banana/requests/{{ $json.request_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "credential-id",
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

E-commerce Order Confirmation & Team Notification via Email

📦 Overview This workflow automatically processes new e-commerce orders as they come in via a webhook. It validates the order data, sends a professional confirmation email to the customer, notifies your team of the new order, logs processing details, and responds to the webhook with a success or error status. It's a complete, beginner-friendly solution for small online stores that want to provide instant order confirmations without manual effort. 🔧 Workflow Nodes New Order Webhook (No auth) — Receives incoming order data via HTTP POST at the path . Responds immediately with a JSON object after processing (either success or error). No authentication is required on the webhook, but you should secure it using your e-commerce platform's webhook secret if needed. Store Configuration (No auth) — A node that stores static store information (store name, store email, support email, phone, website, team email). These values are used later in email templates. You must update these with your own details. Extract Order Details (No auth) — A node that extracts and normalizes common order fields from the incoming webhook payload. It uses fallback expressions to handle different field names from various e-commerce platforms (Shopify, WooCommerce, etc.). Fields extracted: order number, customer name, customer email, order total, currency, order date, payment status. Validate Order Data (No auth) — An node that checks if the customer email is not empty and the order number is not "N/A". If valid, the workflow proceeds to send emails; otherwise, it sends an error response back to the webhook. Send Customer Confirmation (Email credentials — OAuth2 or SMTP) — Sends a formatted HTML email to the customer using the node. The email includes order details, next steps, and store contact information. The subject line and body are dynamically built using expressions referencing the and nodes. Send Team Notification (Email credentials — OAuth2 or SMTP) — Sends a separate notification email to the team email address (configured in ). This email contains a summary of the new order, action items, and quick stats. Log Processing Details (No auth) — A node that records processing status, timestamps, and confirmation flags. This data is passed to the final response. Send Success Response (No auth) — A node that returns a JSON success message with order details and processing timestamps. Send Error Response (No auth) — A node that returns a JSON error message indicating missing required fields, used when validation fails. Sticky Notes (No auth) — Several sticky notes are included for documentation and guidance. They explain each step and provide setup instructions. 🚀 Setup Instructions Configure Store Details — Open the node and replace the placeholder values with your actual store name, email addresses, phone number, and website URL. The team email should be where you want order notifications sent. Set Up Email Credentials — In n8n, create a credential for the email service you want to use. For Gmail, use OAuth2 (recommended) or an app password. For any SMTP server, provide the server, port, username, and password. Attach this credential to both and nodes. Activate the Webhook — Copy the webhook URL from the node (it will look like ). In your e-commerce platform (Shopify, WooCommerce, Etsy, etc.), go to the webhook settings and create a new webhook that triggers on new orders, pointing to this URL. Use HTTP POST method. Test the Workflow — Place a test order on your store. Check that the customer receives a confirmation email and that your team gets a notification. The webhook response should indicate success. 💡 Use Cases & Variations Customize Email Templates — Modify the message bodies in the email nodes to match your brand voice, include product images, or add tracking links. Add Slack/Telegram Notifications — Replace the team email with a Slack message or Telegram bot notification for faster alerts. Log to Google Sheets — Insert a Google Sheets node after to record every order for analytics or accounting. Handle Multiple Platforms — The node already uses fallback expressions, so you can easily support Shopify, WooCommerce, Magento, or custom APIs by adjusting the field mappings. Add Inventory Updates — Connect an HTTP Request node to your inventory management system to decrement stock after a successful order. Use Conditional Logic — Create different email paths based on payment status (e.g., send a separate email for failed payments).

17 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.