12-node n8n workflow using OpenAI, SerpAPI, and Think Tool for chain-of-thought YouTube script pattern analysis.
A clean, elegant 12-node workflow that proves you do not need hundreds of nodes to do serious AI work. This workflow reads YouTube scripts from Google Sheets, loops through each one, and sends it to an AI Agent equipped with SerpAPI web search and a "Think" reasoning tool for chain-of-thought analysis. The agent extracts actionable content patterns -- what works, what does not, and why -- then appends the results back to the sheet. It is surgical, efficient, and immediately useful.
| Nodes | Category | Complexity | Key Integrations |
|---|---|---|---|
| 12 | Content Creation & AI | Intermediate | OpenAI, SerpAPI, Google Sheets, Think Tool |
15-20 minutes including API credential setup, Google Sheets preparation with script data, and agent configuration.
The workflow starts by reading a batch of YouTube scripts from a Google Sheets document. Each script enters a loop where it is processed individually by an AI Agent. The agent has two tools at its disposal: SerpAPI for real-time web search (to research similar content and pull benchmarking data) and a Think Tool that enables structured chain-of-thought reasoning before producing output.
For each script, the agent performs a multi-step analysis. First, it uses the Think Tool to reason through the script's structure: how the hook is constructed, how arguments are sequenced, where transitions occur, what rhetorical devices are employed, and how the conclusion drives action. Then it searches the web via SerpAPI to compare these patterns against high-performing content in the same niche. The agent produces a structured pattern report that includes identified patterns, effectiveness assessments, comparison benchmarks, and specific recommendations.
A Wait node manages pacing between iterations to respect API rate limits. Results are appended to Google Sheets as structured pattern analyses, building a growing library of content intelligence that compounds over time. After processing all scripts, the loop completes and the workflow finishes cleanly.
Triggers
AI & Language Models
Data & Integrations
Tip: Key Techniques Used in This Workflow
- The Think Tool -- Giving an AI Agent a "Think" tool enables it to perform structured reasoning before producing output. This is particularly valuable for analytical tasks where step-by-step reasoning produces better conclusions than direct answering.
- SerpAPI as an agent tool -- Providing web search as a callable tool (rather than pre-fetching results) lets the agent decide what to search for based on what it finds in each script, making research contextually adaptive.
- Rate-limited loops -- The Wait node between iterations is a simple but critical pattern for any workflow that makes external API calls in a loop. Without it, you hit rate limits and the workflow fails.
- Google Sheets as both input and output -- Using the same tool for reading scripts and writing results keeps the data pipeline clean and makes results immediately accessible alongside source material.
- Minimal viable architecture -- This workflow demonstrates that not every problem needs a 200-node solution. Identifying the minimum set of nodes that solves the problem well is itself a skill.
The workflow.json file in this folder can be imported directly into your n8n instance via Settings > Import Workflow.
I build production n8n and Cloudflare automation for teams — the same engineering behind HarperFlow. Fixed-price, escrow-protected, US-based.