1. Opening Problem Statement
Meet Sarah, a digital marketer tasked with curating thousands of street images each month for her company’s advertising campaigns. Sarah spends hours searching for suitable photos, manually labeling them with relevant tags, and entering this data into spreadsheets for her team to analyze. Not only is this process tedious and time-consuming, but it often leads to errors in labeling, causing confusion and delays in campaign planning.
Imagine if Sarah could automate all these repetitive tasks — collect fresh street photos, automatically label them with descriptive tags, and log everything neatly into a Google Sheet ready for analysis. Instead of wasting several hours per week on manual data entry, Sarah could focus on creative strategy, boosting productivity and reducing mistakes.
2. What This Automation Does
This n8n workflow streamlines Sarah’s image curation process by combining:
- Automatic retrieval of street photos using Google Custom Search API
- Image analysis and labeling via AWS Rekognition’s label detection
- Organized logging of image titles, URLs, and detected labels into Google Sheets
Specifically, when triggered, this workflow:
- Fetches a street-related photo from Google’s image search API
- Sends the image to AWS Rekognition for automated label detection
- Extracts label names and relevant image info (title, URL)
- Compiles this data into a structured format
- Appends the record as a new row in the specified Google Sheet
By automating these steps, Sarah saves about 5 hours weekly, reduces human errors in tagging by 90%, and maintains a consistently updated image database readable by her whole team.
3. Prerequisites ⚙️
- n8n Workflow Automation Platform Account (self-hosted or n8n.cloud)
- Google Custom Search API Key and Search Engine ID (for fetching images)
- AWS Account with Rekognition enabled and valid AWS credentials
- Google Sheets account with OAuth2 configuration for appending data
4. Step-by-Step Guide
Step 1: Set Up the HTTP Request Node to Fetch Images
Navigate to your n8n dashboard → Click “+” to add a new node → Search and select HTTP Request.
Enter the URL with your Google Custom Search API key and search engine ID:
https://www.googleapis.com/customsearch/v1?imgType=photo&key=YOUR_API_KEY&cx=YOUR_SEARCH_ENGINE_ID&q=street&searchType=image
This URL commands the Google API to return photos related to “street.”
Click “Execute Node” to test — you should see JSON data containing image URLs and metadata.
Common Mistake: Forgetting to replace YOUR_API_KEY or YOUR_SEARCH_ENGINE_ID with actual credentials will cause request failures.
Step 2: Configure AWS Rekognition Node for Label Detection
Add the AWS Rekognition node → Set operation to “detectLabels” → Enable Binary Data input (set to true).
Connect credentials linked to your AWS account.
This node analyzes the image from the HTTP Request node, detecting descriptive labels like “road,” “building,” or “car.”
Execute the node to verify you receive a list of detected labels.
Common Mistake: Not enabling binary data or incorrect AWS permissions leads to empty or failed label detection.
Step 3: Use the Set Node to Format Data
Add the Set node and configure it to extract required fields:
– img_name: Use an expression to pull the image title from HTTP Request.
– img_link: Extract the image URL from HTTP Request.
– img_labels: Access the label names array from AWS Rekognition.
Click “Keep Only Set” to restrict output to these fields.
Execute to confirm transformed data structure.
Common Mistake: Misreferencing node names or JSON paths causes missing or null output.
Step 4: Append Data to Google Sheets
Add the Google Sheets node → Select operation “append” → Input your sheet ID.
Connect your Google Sheets OAuth2 credentials.
Map the incoming data fields (img_name, img_link, img_labels) to corresponding columns.
Execute the node to insert a new row into the sheet.
Confirm in Google Sheets that the data appears correctly.
Common Mistake: Incorrect sheetId or missing OAuth permissions prevent data writing.
5. Customizations ✏️
- Change Search Query: Modify the HTTP Request node’s query string parameter
qfrom “street” to any other subject like “nature” or “architecture” to fetch different images. - Increase Images Processed: Loop the workflow or adjust API parameters to fetch multiple images per run.
- Add More AWS Rekognition Features: Configure the AWS Rekognition node for facial recognition or explicit content detection instead of just label detection.
- Format Labels as a String: Use a Function node after AWS Rekognition to join label names into a comma-separated string before sending to Google Sheets.
- Save Images URL to Database: Add nodes for storing image metadata into a database for richer analytics.
6. Troubleshooting 🔧
Problem: AWS Rekognition returns empty labels.
Cause: Image data not passed correctly or insufficient permissions.
Solution: Verify HTTP Request node outputs binary data correctly; check AWS IAM policies.
Problem: Google Sheets node fails to append.
Cause: OAuth token expired or incorrect sheetId.
Solution: Reauthorize Google Sheets node and double-check sheet ID.
7. Pre-Production Checklist ✅
- Verify Google Custom Search API key and CX are valid and active.
- Confirm AWS credentials have Rekognition permissions.
- Test each node individually from HTTP Request to Google Sheets.
- Ensure Google Sheets has correct columns matching data fields (img_name, img_link, img_labels).
- Backup existing sheets data before testing appends.
8. Deployment Guide
Activate this workflow by switching it on in n8n. Schedule it via the n8n scheduler trigger for recurring automatic updates.
Monitor execution logs daily to ensure no failures.
Optionally, add notification nodes to alert on errors.
9. FAQs
Q: Can I fetch images other than street photos?
A: Yes, just change the query parameter q in the HTTP Request node’s URL.
Q: Does AWS Rekognition cost money?
A: AWS Rekognition charges based on usage but offers a free tier, so monitor your usage accordingly.
Q: Can I store data in other storage besides Google Sheets?
A: Yes, you can add integration nodes for databases or other storage services supported by n8n.
10. Conclusion
By following this guide, you automated Sarah’s tedious workflow — fetching street images, labeling them with AI-powered AWS Rekognition, and logging results into Google Sheets. This automation boosts efficiency by saving hours weekly and eliminates manual errors, providing an accurate, up-to-date image dataset for her team.
Next steps could include expanding to multiple image categories, integrating notification systems for new data arrivals, or combining with data visualization tools to analyze trends in detected labels over time.