Amazon Ads AI Optimization
Configured with Chain LLM, Extract From File, Gmail, Google Drive, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Files / media
- AI & models
- Routing
- Transform
- Code
- Messaging
- Trigger
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| List Files | Files / media | Google Drive | fileFolder |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| is XLSX | Routing | If | See node parameters |
| Get File | Files / media | Google Drive | download |
| Merge XLSX and CSV | Transform | Merge | See node parameters |
| Format Data | Code | Code | See node parameters |
| Set fileName | Transform | Edit Fields | See node parameters |
| Preserve File Name | Transform | Edit Fields | See node parameters |
| Email Optimizations | Messaging | Gmail | See node parameters |
| Extract XLSX Data | Transform | Extract From File | xlsx |
| Extract CSV Data | Transform | Extract From File | See node parameters |
| Preserve CSV File Name | Transform | Edit Fields | See node parameters |
| When clicking ‘Test workflow’ | Trigger | Manual Trigger | See node parameters |
| Email Options | Transform | Edit Fields | See node parameters |
| AI Analyze | AI & models | Chain LLM | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
gmailOAuth2googleDriveOAuth2ApiopenAiApi
Workflow notes
Change
Change
Choose the "folder" in the filter options to the folder containing your Ad reports
AI Analysis
AI Analysis
Uses GPT-4o to process the bundled reports and generate optimization instructions. Passes system instructions and cleaned data as input.
Amazon Ads Report Scheduling Instructions
Amazon Ads Report Scheduling Instructions
To run this workflow, schedule the following Sponsored Products reports in the Amazon Ads Console:
Use "Detailed" for:
Search Term Report → Sponsored_Products_Search_Term_Detailed_L30
Targeting Report → Sponsored_Products_Targeting_Detailed_L30
Use "Summary" for:
Campaign Report → Sponsored_Products_Campaign_L30
Placement Report → Sponsored_Products_Placement_L30
Budget Report → Sponsored_Products_Budget_L30
Shared settings for all reports:
Date Range: Last 30 Days
Frequency: Daily
Format: .xlsx or .csv
Delivery: Email + Console Download
Make sure filenames match expectations so the workflow can route them correctly.
Report Delivery
Report Delivery
How to get reports into Google Drive
Use one of the following:
📥 Manual Upload – Download emailed reports and move them to your Drive folder
🤖 Automation – Use n8n to watch Gmail for user@example.com, extract attachments, and upload to Drive
💻 Drive Sync Folder – Use a local folder synced to Google Drive with rules for report types
Reports must match expected filenames so the flow can identify and classify them.
Upgrade! 🚀
Upgrade! 🚀
Apply for an Amazon Advertising API developer account to unlock full automation:
Generate reports programmatically via the Reports API
Fetch report files directly into n8n using HTTP or custom nodes
Eliminate email + Drive dependency entirely
🔗 https://advertising.amazon.com/API/docs/en-us/
Once approved, you can schedule report generation and download all required data securely and automatically. Double click to edit me. Guide
Trigger
Trigger
You may replace this with a scheduled event or poll the folder for changes.
Change!
Change!
Edit these email options.
Amazon Ads AI Optimization
Amazon Ads AI Optimization
Purpose and structure
This folder contains the Amazon Ads AI Optimization workflow. Its executable nodes use chainLlm, code, extractFromFile, gmail, googleDrive, if, lmChatOpenAi, manualTrigger, merge, set. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking ‘Test workflow’
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1301_Code_Extractfromfile_Automation_Triggered.json MIT; preserve source notices.