How to Use n8n to Create an AI Agent for Lead Generation
Learn how to use n8n to create an AI agent that automates lead generation using Google Maps and the Perplexity Sonar API.
Introduction to Perplexity Sonar API
Perplexity Sonar API is a powerful tool that can help you extract and organize business details efficiently. The API has just been publicly announced and there are two versions available: Sona and Sona Pro. Sona is designed to give you real-time and web-connected search capabilities, making it perfect for tasks like lead generation. Sona Pro outperformed leading search engines and LM in terms of answer quality.
Setting Up the AI Agent
To set up the AI agent, you need to have a server provider like n8n and credentials for the Google Maps API and Perplexity Sonar API. You also need to have a Google Sheets account to store the lead data.
Creating the n8n Workflow
The n8n workflow consists of three main parts:
- The AI agent workflow for lead generation: This workflow uses the Google Maps API to extract business details and the Perplexity Sonar API to enhance the leads with company emails and background information.
- The workflow for storing data to Google Sheets: This workflow takes the extracted data and stores it in a Google Sheets document.
- The workflow for getting company email and background from Perplexity: This workflow uses the Perplexity Sonar API to retrieve company emails and background information.
Setting Up the Credentials
To set up the credentials, you need to sign up for a free account on the server provider's website and get the API key. You can then paste the API key into the n8n workflow.
Testing the Workflow
Once you have set up the workflow and credentials, you can test it by sending a message to the AI agent. The agent will then extract the business details and store them in the Google Sheets document.
This is the initial setup for the AI agent workflow
Extracting Business Details
The AI agent uses the Google Maps API to extract business details such as name, address, website, rating, opening hours, and phone number.
This is the extracted business details
Enhancing Leads with Company Emails and Background Information
The AI agent uses the Perplexity Sonar API to enhance the leads with company emails and background information.
This is the enhanced lead with company email and background information
Storing the Data in Google Sheets
The workflow stores the extracted data in a Google Sheets document.
This is the data stored in Google Sheets
Conclusion
In conclusion, using n8n to create an AI agent for lead generation is a powerful way to automate the process of extracting and organizing business details. With the Perplexity Sonar API, you can enhance the leads with company emails and background information, making it easier to personalize your outreach efforts.