Automated Image Metadata Tagging with Google Drive & OpenAI

Discover how this workflow automates image content analysis and embeds descriptive metadata keywords directly into image files stored in Google Drive, saving hours of manual tagging.
googleDriveTrigger
googleDrive
openAi
+4
Workflow Identifier: 1955
NODES in Use: Google Drive Trigger, Google Drive, OpenAI, Extract from File, Merge, Code, Convert to File

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow watches a Google Drive folder for new images.

It uses AI to read what is in the image and makes keywords.

Then it adds those keywords into the image’s metadata.

This saves many hours of manual work and helps find pictures fast later.


Who should use this workflow

Anyone who handles many pictures on Google Drive.

Especially if tagging images with keywords takes too long or is not consistent.

This helps content teams, marketers, and managers find images quicker.


Tools and services used

  • Google Drive API: To watch folders, download, and update images.
  • OpenAI GPT-4o model: To analyze image content and create descriptive keywords.
  • n8n automation platform: Runs the workflow nodes and custom code.

Inputs, processing steps, and output

Input

  • New image file uploaded to a specific Google Drive folder.

Processing

  1. Trigger activates every minute, checking new files in the folder.
  2. Download the new image in base64 format.
  3. Send the image data to OpenAI GPT-4o to get a list of keywords describing the picture.
  4. Convert the image file to base64 for editing.
  5. Use custom JavaScript code to add the keywords into the image’s XMP metadata tags.
  6. Convert the edited base64 data back to binary file format.
  7. Update the same image file on Google Drive with the new metadata.

Output

  • The image is now tagged with AI-generated keywords in its metadata on Google Drive.
  • This makes searching and finding images much easier.

Beginner step-by-step: How to use this workflow in n8n

Importing the workflow

  1. Download the workflow file using the Download button on this page.
  2. Inside the n8n editor, choose “Import from File” and select the downloaded file.

Configure credentials and settings

  1. Add your Google Drive API credentials for file access and updates.
  2. Add your OpenAI API key with permissions for GPT-4o model image analysis.
  3. Update folder IDs, file IDs, or any emails or channels if the workflow deals with them.
  4. Copy and paste the exact AI input prompt: Deliver a comma separated list describing the content of this image.
  5. Make sure the JavaScript code node contains the correct code to insert metadata tags.

Testing and activating

  1. Upload a test image to the specified Google Drive folder.
  2. Run the workflow manually or wait for trigger to activate to verify tags are added.
  3. If results are correct, toggle the workflow to “Active” to start automatic processing.
  4. For users doing self-host n8n, make sure your instance is running and workflow is enabled.

Customizations

  • Change AI model by updating the modelId in the OpenAI node (e.g., to gpt-4).
  • Add more metadata fields such as creator name or copyright in the JavaScript node.
  • Monitor a different Google Drive folder by changing the folder ID in the trigger node.
  • Alter the AI prompt to receive tags separated by semicolons or other symbols, then adjust code to split accordingly.

Common issues and fixes

  • OpenAI API error or empty tags returned:
    Check the API Key, ensure usage limits are not exceeded, and that image input is base64.
  • Permission denied on Google Drive updates:
    Make sure OAuth credentials have file update rights and folder access is allowed.
  • Corrupted image after update:
    Verify the JavaScript code is exactly as given. Even small changes can break file structure.

Pre-production tips

  • Confirm Google Drive API has read and write permissions.
  • Test OpenAI connection and get sample keywords from image input.
  • Check the folder ID is correct and accessible in Google Drive.
  • Try uploading a sample image and watch for tags to appear on metadata.
  • Backup original images before running changes on real files.

Summary

✓ Saves time by automatically tagging images uploaded to Google Drive.

✓ Uses AI to understand image content and create meaningful keywords.

→ Metadata updated on original files without changing structure.

→ Easier image search for teams managing large libraries.


Frequently Asked Questions

Update the folder ID in the Google Drive Trigger node to the new folder’s ID before running the workflow.
Check that the OpenAI API Key is valid, ensure the usage quota is not exceeded, and confirm the input image is properly base64 encoded.
Most likely the JavaScript code that inserts metadata was modified incorrectly, breaking the image file format.
Yes, replace the OpenAI node with another AI provider supported by n8n, adjusting the prompt and credentials accordingly.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free