AI Agent-Powered Pinterest Keyword Scraper to Google Sheets - n8n Workflow

Automate Pinterest content scraping using an advanced n8n workflow, BrightData, and an AI Agent (Claude/LangChain). This n8n template extracts structured content and saves it directly to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • SEO Professionals & Content Strategists: Need to rapidly gather competitive intelligence or content ideas from Pinterest.

  • Marketing Teams: Require large datasets of trending pins for analysis or content replication.

  • n8n Automation Specialists: Looking for complex n8n templates integrating LangChain Agents, external scraping APIs (BrightData), and iterative polling logic.

  • Data Analysts: Seeking automated methods for large-scale web scraping projects within the n8n platform.

Overview

This powerful n8n workflow solves the challenge of dynamic, large-scale web scraping by integrating an AI Agent architecture with a professional scraping service. Unlike simple HTTP request flows, this n8n template uses a LangChain Agent to intelligently manage the scraping process, including launching the job, continuously checking the status (polling), and finally downloading the data once the status is 'ready'. This ensures reliability and handles the asynchronous nature of web scraping APIs.

The resulting raw data is then cleaned and structured by an n8n node dedicated to data extraction, transforming unstructured text into clean fields (Title, URL, Image URL). The final structured output is seamlessly saved into a Google Sheet, providing a complete, hands-free data pipeline entirely within n8n.

How it Works

The entire process is initiated by the custom form n8n trigger:


  1. Keyword Input: The Pinterest Keyword Input form serves as the starting n8n trigger, collecting the keyword provided by the user.

  2. Agent Activation: The input is passed to the Keyword-based Scraping Agent (a sophisticated n8n node powered by Anthropic's Claude 4 Sonnet model).

  3. Job Launch: The AI Agent uses the BrightData Pinterest Scraping tool (an n8n node utilizing an HTTP POST request) to launch a scraping snapshot using the keyword. This returns a snapshotid.

  4. Status Polling Loop: The AI Agent then leverages the Check Scraping Status n8n node (HTTP GET request) to repeatedly poll BrightData using the snapshotid until the status changes from 'running' to 'ready'.

  5. Data Retrieval: Once the snapshot is ready, the Agent executes the Fetch Pinterest Snapshot Data n8n node to download the complete scraped dataset.

  6. Data Structuring: The raw scraped output is routed through the Format & Extract Pinterest Content Code n8n node. This node uses custom JavaScript and regex to parse the raw text, extracting fields like Title, Post ID, Image URL, and Hashtags into structured JSON objects.

  7. Final Storage: Finally, the Save Pinterest Data to Google Sheets n8n node appends the clean, structured data columns (Title, Content, Post URL, Image URL) to the designated Google Sheets document. This comprehensive n8n workflow provides a robust solution for content extraction.

Installation Guide

To set up this powerful n8n template, follow these steps:


  1. Import: Import this JSON into your n8n instance.

  2. Credentials: You must configure the following credentials for the required n8n nodes:

Anthropic API: Set up credentials for the Anthropic Chat Model node (using Claude 4 Sonnet).
BrightData API Key: Update the placeholder headers in the BrightData Pinterest Scraping, Check Scraping Status, and Fetch Pinterest Snapshot Data HTTP Request nodes with your actual BrightData API key.
* Google Sheets OAuth2: Configure OAuth2 credentials for the Save Pinterest Data to Google Sheets n8n node.

  1. BrightData Configuration: Ensure you replace the placeholder datasetid in the BrightData n8n node with the ID of your intended Pinterest collector.

  2. Google Sheet Setup: Create a new Google Sheet and replace GOOGLESHEETIDPLACEHOLDER in the Google Sheets n8n node with the ID of your target sheet. Ensure the sheet contains columns for 'Title', 'Content', 'Post URL', and 'Image URL'.

  3. Activation: Activate the n8n workflow and use the Form Trigger URL to test the flow by submitting a keyword.

Node Details

Pinterest Keyword Input (Form Trigger): The starting n8n trigger. Configured to collect the 'Keywords' field, which feeds the input into the AI Agent.
Anthropic Chat Model (LangChain LM): Provides the intelligence for the AI Agent, utilizing the powerful claude-sonnet-4-20250514 model.
Keyword-based Scraping Agent (LangChain Agent): The control center n8n node. It is instructed to use three subsequent HTTP Request nodes as tools to launch, check, and download data, ensuring a reliable execution of the scraping n8n workflow.
BrightData Pinterest Scraping (HTTP Request Tool): This n8n node launches the scraping job. Key Configuration includes a POST request to the BrightData /datasets/v3/trigger endpoint, passing the user's keyword and BrightData specific query parameters (datasetid, type: discovernew, discoverby: keyword).
Check Scraping Status (HTTP Request Tool): This n8n node dynamically checks the status URL using the snapshotid returned from the previous step, allowing the AI Agent to perform necessary polling.
Fetch Pinterest Snapshot Data (HTTP Request Tool): Executes only when the status is 'ready'. This n8n node retrieves the actual scraped content from the BrightData API.
Format & Extract Pinterest Content (Code Node): Crucial processing n8n node. Contains custom JavaScript using regex patterns to parse the raw, text-based output into a structured format (e.g., extracting URL, Title, and Hashtags).
Save Pinterest Data to Google Sheets (Google Sheets Node): The final action n8n node. Configured to append the structured data (Title, Content, Post URL, Image URL) to the specified Google Sheet document, completing the automated data pipeline.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Shiv Gupta
Shiv Gupta

Featured*