Enrich Company Data from Google Sheet with OpenAI Agent and Scraper Tool
Configured with Agent, Execute Workflow Trigger, Google Sheets, HTTP Request, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Transform
- AI & models
- Data store
- Subworkflow
- Web / API
- Trigger
- Routing
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 |
|---|---|---|---|
| Structured Output Parser | Transform | Output Parser Structured | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Get rows from Google Sheet | Data store | Google Sheets | See node parameters |
| Call n8n workflow : Scrape companies homepage content | Subworkflow | Tool Workflow | See node parameters |
| Update Company's Row on Google Sheet | Data store | Google Sheets | update |
| ScrapingBee : Scrape company's homepage data | Web / API | HTTP Request | See node parameters |
| Tool called from Agent | Trigger | Execute Workflow Trigger | See node parameters |
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Set company url | Transform | Edit Fields | See node parameters |
| HTML to Markdown | Transform | Markdown | See node parameters |
| Webhook | Trigger | Webhook | 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
googleApiopenAiApi
Workflow notes
Enrich Company Data from Google Sheet with OpenAI Scraper Agent
Enrich Company Data from Google Sheet with OpenAI Scraper Agent
This workflow demonstrates how to enrich data from a list of companies in a spreadsheet. While this workflow is production-ready if all steps are followed, adding error handling would enhance its robustness.
Impportant notes
- Check legal regulations: This workflow involves scraping, so make sure to check the legal regulations around scraping in your country before getting started. Better safe than sorry!
- Mind those tokens: OpenAI tokens can add up fast, so keep an eye on usage unless you want a surprising bill that could knock your socks off! 💸
Main Workflow
Node 1 - Webhook
This node triggers the workflow via a webhook call. You can replace it with any other trigger of your choice, such as form submission, a new row added in Google Sheets, or a manual trigger.
Node 2 - Get Rows from Google Sheet
This node retrieves the list of companies from your spreadsheet. The columns in this Google Sheet are:
-
Company: The name of the company
-
Website: The website URL of the company
These two fields are required at this step. -
Business Area: The business area deduced by OpenAI from the scraped data
-
Offer: The offer deduced by OpenAI from the scraped data
-
Value Proposition: The value proposition deduced by OpenAI from the scraped data
-
Business Model: The business model deduced by OpenAI from the scraped data
-
ICP: The Ideal Customer Profile deduced by OpenAI from the scraped data
-
Additional Information: Information related to the scraped data, including:
- Information Sufficiency:
- Description: Indicates if the information was sufficient to provide a full analysis.
- Options: "Sufficient" or "Insufficient"
- Insufficient Details:
- Description: If labeled "Insufficient," specifies what information was missing or needed to complete the analysis.
- Mismatched Content:
- Description: Indicates whether the page content aligns with that of a typical company page.
- Suggested Actions:
- Description: Provides recommendations if the page content is insufficient or mismatched, such as verifying the URL or searching for alternative sources.
- Information Sufficiency:
Node 3 - Loop Over Items
This node ensures that, in subsequent steps, the website in "extra workflow input" corresponds to the row being processed. You can delete this node, but you'll need to ensure that the "query" sent to the scraping workflow corresponds to the website of the specific company being scraped (rather than just the first row).
Node 4 - AI Agent
This AI agent is configured with a prompt to extract data from the content it receives. The node has three sub-nodes:
- OpenAI Chat Model: The model used is currently
gpt4-o-mini. - Call n8n Workflow: This sub-node calls the workflow to use ScrapingBee and retrieves the scraped data.
- Structured Output Parser: This parser structures the output for clarity and ease of use, and then adds rows to the Google Sheet.
Node 5 - Update Company Row in Google Sheet
This node updates the specific company's row in Google Sheets with the enriched data.
Scraper Agent Workflow
Node 1 - Tool Called from Agent
This is the trigger for when the AI Agent calls the Scraper. A query is sent with:
- Company name
- Website (the URL of the website)
Node 2 - Set Company URL
This node renames a field, which may seem trivial but is useful for performing transformations on data received from the AI Agent.
Node 3 - ScrapingBee: Scrape Company's Website
This node scrapes data from the URL provided using ScrapingBee. You can use any scraper of your choice, but ScrapingBee is recommended, as it allows you to configure scraper behavior directly. Once configured, copy the provided "curl" command and import it into n8n.
Node 4 - HTML to Markdown
This node converts the scraped HTML data to Markdown, which is then sent to OpenAI. The Markdown format generally uses fewer tokens than HTML.
Improving the Workflow
It's always a pleasure to share workflows, but creators sometimes want to keep some magic to themselves ✨. Here are some ways you can enhance this workflow:
- Handle potential errors
- Configure the scraper tool to scrape other pages on the website. Although this will cost more tokens, it can be useful (e.g., scraping "Pricing" or "About Us" pages in addition to the homepage).
- Instead of Google Sheets, connect directly to your CRM to enrich company data.
- Trigger the workflow from form submissions on your website and send the scraped data about the lead to a Slack or Teams channel.
Enrich Company Data from Google Sheet with OpenAI Agent and Scraper Tool
Enrich Company Data from Google Sheet with OpenAI Agent and Scraper Tool
Purpose and structure
This folder contains the Enrich Company Data from Google Sheet with OpenAI Agent and Scraper Tool workflow. Its executable nodes use agent, executeWorkflowTrigger, googleSheets, httpRequest, lmChatOpenAi, markdown, outputParserStructured, set, splitInBatches, toolWorkflow, webhook. 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
Tool called from Agent, Webhook
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/Webhook/1694_Webhook_HTTP_Automation_Webhook.json MIT; preserve source notices.