This automation is an AI-powered LinkedIn Lead Search Agent that turns a natural-language chat request into a ranked list of relevant LinkedIn profiles and a shareable HTML report. It removes the need to manually interpret the request, search multiple times, clean noisy results, rank candidates, and format the final output.

Chat-Triggered Input:
The workflow starts when a user sends a natural-language message through the chat interface. The agent reads the incoming chat payload and forwards the raw request text for AI-based interpretation.
AI-Powered Parameter Extraction:
The user’s message is sent to an AI model that extracts structured search parameters such as:
· Target role
· Country
· Region
· Mapped country list (when a region is given)
· Industry
· Company
· Relevant keywords
· Maximum number of results
· Search depth
This allows users to request leads in natural language like:
“Find senior JS backend developers in Southern Europe.”
Smart Parameter Normalization:
The extracted AI output is cleaned, validated, and converted into a consistent JSON object. If the user gives a region instead of a single country, the workflow preserves the region, maps it to supported countries, and avoids sending invalid country values to Tavily. If the user omits optional parameters, safe defaults are applied automatically.
Role Validation & Clarification:
If the AI cannot identify a target role, the workflow stops early and returns a clarification response asking the user to provide a role such as CTO, CEO, Head of AI, or Senior Backend Developer.
Search Query Construction:
The normalized parameters are converted into two query variants:
· Primary query: a natural phrasing that starts with “LinkedIn profile” for better retrieval quality
· Fallback query: a shorter backup query to improve recall if the first search misses good candidates
Automated Web Search (Tavily API):
Using the structured parameters, the workflow queries Tavily twice (primary and fallback). Each request can include:
· Role and keyword-based query text
· Optional single-country filter when one exact country is known
· Configurable search depth
· Configurable max number of candidate results
· Domain restriction to LinkedIn
This dual-search pattern improves both precision and recall while staying compatible with Tavily’s country requirements.
JavaScript Pre-Cleaning & Deduplication:
Before the results go back to AI, the workflow uses a JavaScript node to:
· Merge the primary and fallback Tavily result arrays
· Keep only real LinkedIn profile URLs (linkedin.com/in/...)
· Remove duplicate profiles
· Trim overly long content snippets
· Prepare a compact candidate list for semantic reranking
AI Semantic Reranking:
The cleaned candidate list is passed to a second AI node that acts as a reranker. It evaluates each candidate against the user’s requested role, geography, industry, company, and keywords, then returns:
· A ranked list of the best matches
· A match score for each candidate
· Short reasons explaining why each profile matched
· A human-friendly markdown summary of the final shortlist
HTML Report Generation:
A final JavaScript node converts the AI-generated markdown and ranked candidate list into a complete HTML document. The HTML includes:
· Summary headings and notes
· LinkedIn profile cards
· Links to candidate profiles
· Match scores
· Why-matched bullet points
· Clean formatting for browser viewing or sharing
Final Output Delivery:
The workflow returns both structured JSON and a generated HTML file. This makes the result usable for chat responses, browser previews, exports, or downstream automation steps such as email delivery, cloud storage, or CRM ingestion.
Recruiter Research Assistant:
Find relevant professionals on LinkedIn from a natural-language brief.
Sales Lead Discovery:
Search for decision-makers or technical buyers by role, geography, and sector.
Hiring Support:
Generate shortlists of candidates for engineering, product, or executive hiring.
Regional Market Mapping:
Explore talent pools or lead pools across regions such as DACH, Southern Europe, or Benelux.
Executive Prospecting:
Identify senior leaders in target industries and export the results as a readable HTML report.
Workflow Building Block:
Use the generated JSON and HTML as inputs for CRMs, ATS systems, outreach agents, or reporting dashboards.
This agent is modular and can be adapted easily for different lead-generation and talent-search use cases:
Change Search Provider:
Replace Tavily with another search API or a private search index.
Improve Extraction Prompt:
Add seniority, must-have skills, exclude keywords, language, or company-size extraction.
Tighten Reranking:
Teach the reranker to penalize weak geography matches, outdated profiles, or adjacent roles.
Alternative Outputs:
Generate PDF, DOCX, CSV, Google Sheets rows, CRM records, or email-ready summaries instead of or in addition to HTML.
Multi-Channel Delivery:
Send the ranked report to Telegram, Slack, email, Notion, Google Drive, or webhooks.
Branding & UI:
Extend the HTML template with company branding, logos, colors, and richer styling.
Name | Type | Default | Description |
chatInput | string | None | User’s natural-language request that describes the target LinkedIn leads or candidates |
Name | Type | Default | Description |
role | string | "" | Primary target role to search for, such as CTO or Senior JS Backend Developer |
country | string | "" | Single exact country when explicitly provided by the user |
region | string | "" | Region name such as west europe, southern europe, or dach |
countries | array<string> | [] | Mapped country list derived from a region or a single-country request |
industry | string | "" | Industry or sector hint such as banking, fintech, or AI |
company | string | "" | Optional target company name if the search is company-specific |
keywords | array<string> | [] | Relevant skill or domain keywords such as javascript, node.js, backend, aws |
max_results | number | 10 | Maximum number of ranked results to return |
search_depth | string | "basic" | Tavily search depth, typically basic or advanced |