Live Preview
Working Duration
Category
Client
The LinkedIn Sales Agent is a sophisticated automation designed to handle the entire top-of-funnel sales process, from lead generation to personalized first contact. The project’s goal was to create a “virtual sales assistant” that could be controlled entirely through a simple, conversational interface in Telegram.
The system is built as a multi-stage autonomous agent within a single n8n workflow. It intelligently classifies user commands to trigger one of three core modules: finding new leads, analyzing their profiles, or emailing qualified prospects. The workflow integrates multiple services, using Apify for web scraping, Airtable as a central CRM, and a combination of Google Gemini and OpenAI models for different AI tasks.
3 Autonomous Stages: The agent manages a full pipeline: Lead Finding, Profile Scraping & Analysis, and Personalized Email Outreach.
5+ Major APIs Integrated: The workflow orchestrates Telegram, Apify (for two different actors), Airtable, Google Gemini, OpenAI, and Gmail to create a seamless process.
Dual AI Model Strategy: Utilizes Google Gemini for fast and accurate structured data extraction and OpenAI’s powerful GPT-4 model for creative, high-quality email copywriting.
Voice & Text Command Input: The system can accept commands via standard text messages or by transcribing user voice notes using OpenAI’s audio-to-text model.
This workflow goes beyond simple automation by incorporating AI at every stage to replicate the decision-making and personalization of a human sales agent.
Conversational AI Control Center: Users interact with the agent through Telegram. An AI text classifier interprets their intent (e.g., “find me marketing managers in London”) and routes the request to the appropriate module (SCRAPE, ANALYZE, or EMAIL).
Automated Lead Generation & Enrichment: The agent calls an Apify actor to scrape LinkedIn for leads based on the user’s query. In a separate step, it enriches these leads by scraping their full profiles, cleaning the raw data with a custom script, and extracting key details using an LLM.
Hyper-Personalized AI Copywriter: This is the core intelligence of the system. It uses OpenAI’s GPT-4 with a highly detailed system prompt that instructs the AI to act as an “expert email copywriter and designer”. The AI analyzes the lead’s enriched profile data (job title, experience, skills) to write a unique, psychologically persuasive HTML email, complete with a strong call-to-action.
Automated CRM Management: Airtable serves as the agent’s memory and CRM. Every lead is logged, and its status is updated as it moves through the pipeline from SCRAPED to ANALYZED to EMAILED, providing a clear and persistent record of all activity.
The main challenge was orchestrating a complex, multi-step process that requires context and state management, all from a stateless, event-driven platform like n8n. The solution was to design the workflow as a state machine, using Airtable as the single source of truth for the status of each lead. This allows the agent to run different parts of the workflow (e.g., scraping on Monday, emailing on Tuesday) and always know which leads to process next.
Another key architectural decision was the “Dual AI Model Strategy.” Instead of relying on a single, expensive model for everything, the workflow uses the fast and efficient Google Gemini for structured data extraction tasks. For the more nuanced and creative task of writing persuasive emails, it leverages the more powerful GPT-4 model from OpenAI, optimizing both cost and quality.
This project is a powerful force multiplier for any sales professional or small business. It effectively puts a tireless, 24/7 sales assistant in the user’s pocket, controlled via a simple chat app. The primary impact is the massive reduction in manual, repetitive labor associated with prospecting, researching leads, and writing “first touch” emails.
Furthermore, the quality of the outreach is exceptionally high. The AI’s ability to instantly analyze a lead’s entire professional history and apply proven psychological copywriting techniques allows for a level of personalization that is difficult to achieve manually at scale. This system doesn’t just automate tasks; it elevates the quality of the sales outreach, enabling users to connect with more prospects more effectively.