---
title: "How to use AI for lead classification on LinkedIn"
description: "Explore an innovative approach to LinkedIn lead classification using AI. This article showcases a real-world solution combining a custom Chrome extension, n8n workflow, and AI algorithms to streamline the process of identifying valuable connections on LinkedIn, saving time and improving networking efficiency."
author: "Bartosz Mikulski"
author_bio: "Principal AI Engineer & MLOps Architect. I bridge the gap between \"it works in a notebook\" and \"it works for 200 million users.\""
author_url: https://mikulskibartosz.name
author_linkedin: https://www.linkedin.com/in/mikulskibartosz/
author_github: https://github.com/mikulskibartosz
canonical_url: https://mikulskibartosz.name/lead-classification-with-ai
---

Every time we get a new lead, we must know whether we can help them. However, getting data out of LinkedIn is tedious work. Their API doesn't provide access to the data you need, and paying for Sales Navigator gives you a fancy web interface, but API access is not included. This is one of the cases where AI-powered automation can save hours of manual work, similar to how I built an [AI receptionist for apartment rentals](https://mikulskibartosz.name/ai-receptionist-for-apartment-rentals).

## The problem of finding the right people with Sales Navigator

I got the same problem while looking for people who may be interested in the content I post on LinkedIn and inviting them as a connection. I want to write a personal message to each, but Sales Navigator let's you filter only by job title, location, etc. Even the "recently posted" filter is not helpful because the time window is too long, and LinkedIn considers writing a "Thank you" comment to be a post.

Therefore, every time I use Sales Navigator, I have to scroll to the recent posts, check the date, see if they posted something interesting, scroll back to the contact information, see if they have a website, and whether it contains a blog. Usually, the website no longer exists, or the blog is inactive. I want to write a message about something relevant and relatively recent, not a post they published three years ago.

The process takes a few minutes per person, and I filter out most of the profiles. It's normal to see a hundred profiles and send only a dozen connection requests because I have nothing in common with most of those people, or I have no clue what they do because they don't write about anything interesting.

## Requirements for the automated workflow

There is no way to get the data from the API, so I had to stick to a browser-compatible solution. I created a Google Chrome extension that reads the LinkedIn profile data from the currently visited profile and sends the relevant information to the n8n workflow.

In the workflow, I check whether the person has a website and whether the website works and contains a blog. Alternatively, they may not have a blog, but post content on LinkedIn. If their recent activity is at most one month old, I check whether they published something of value. If any of those conditions are met, I send a task to my Todoist and write a personal message later.

In the workflow, I need AI for two steps. First, AI looks for a blog link on the website. Second, it classifies the person's posts as relevant or irrelevant for the purpose of writing a personal message. I don't use AI to generate the message because they are generic, dreadful, and give out the "fake" vibe. If you want to learn more about [building AI workflows](https://mikulskibartosz.name/ai-workflow-design-patterns), I have a detailed guide with code examples.

## The workflow in detail

### Getting the data from LinkedIn

To retrieve the data, I got a Chrome extension that reads the LinkedIn profile, summarizes the information, and lets me decide if I want to send the profile to the workflow. Sometimes, the summary is enough. If I see the profile has no contact information or content, running the workflow makes no sense. The automation won't have enough data to run anyway.

![Chrome extension that reads LinkedIn profile](/images/2024-10-14-lead-classification-with-ai/extension.png)

### n8n workflow for profile classification

The purpose of the workflow is to minimize the time spent reading empty profiles. Automation may occasionally send me an irrelevant profile, but it should filter out most such profiles.

First, the workflow checks whether the person has a current role and any LinkedIn activity. Then, check whether each contact information is a website link. If yes, it tries to open the website and decide whether it's a blog or at least contains a link to a blog. In the other workflow branch, n8n looks for recent LinkedIn posts and classifies them as relevant or not. Finally, if a person has at least one relevant, recent post or a blog, the workflow sends me a Todoist task so I can write a personal message.

![Lead classification workflow in n8n](/images/2024-10-14-lead-classification-with-ai/workflow.png)

### Passing the task to Todoist

I use Todoist for task management, so every profile of a person who may be interested in my content becomes a task in Todoist. Once a week, I go through the profiles one by one and write a personal connection message.

![A Todoist task with a link to a LinkedIn profile](/images/2024-10-14-lead-classification-with-ai/todoist.png)

## The result: 50% acceptance rate

My connection requests have around 40-50% acceptance rate. Simply because I write a message about something they recently published. This approach of [blending AI with human creativity](https://mikulskibartosz.name/blending-ai-with-human-creativity-content-creation) gives the best results. It's much more personal than "Hey, we should be connected" and it works. Most importantly, if the profile passes the workflow verification, it means I have something in common with the other person and am genuinely interested in connecting with them.

