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
Automate image tagging with n8n and Google Drive

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

Learn how to Build this Workflow with AI:

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


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.


Automate image tagging with n8n and Google Drive

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.