Data Enrichment Pipeline
Enrich lead data with company information, technographics, and intent signals.
This workflow takes basic lead information and enriches it with firmographics, tech stack, funding data, and contact details.
Implementation
1import { relay } from "@relayplane/workflows";23const result = await relay4 .workflow("data-enrichment")56 // Step 1: Research company information7 .step("company-research")8 .with("perplexity:sonar-pro")9 .prompt(`Research this company:1011Company: {{companyName}}12Domain: {{domain}}1314Gather:15- Company size (employee count)16- Industry and sub-industry17- Headquarters location18- Year founded19- Funding stage and total raised20- Key products/services21- Recent news or expansions2223Provide structured data with sources.`)2425 // Step 2: Identify technology stack26 .step("tech-stack")27 .with("openai:gpt-4o")28 .depends("company-research")29 .prompt(`Based on this company profile, infer their technology stack:3031{{company-research.output}}32Website: {{domain}}3334Likely technologies:35- Cloud infrastructure (AWS/GCP/Azure)36- CRM system (Salesforce/HubSpot)37- Marketing tools38- Development stack39- Data/analytics platforms4041Also identify:42- Pain points related to their stack43- Potential need for our product44- Competitive intel (if they use competitors)`)4546 // Step 3: Find decision makers47 .step("find-contacts")48 .with("anthropic:claude-3.5-sonnet")49 .depends("company-research", "tech-stack")50 .prompt(`Identify decision makers for our product:5152Company Data: {{company-research.output}}53Tech Stack: {{tech-stack.output}}5455Our Product: {{productDescription}}5657Who to target:58- Job titles of decision makers59- Departments involved in buying decision60- Typical org structure for this company size61- Champions vs economic buyers6263Provide LinkedIn search queries to find these people.`)6465 // Step 4: Generate account score66 .step("score-account")67 .with("openai:gpt-4o")68 .depends("company-research", "tech-stack", "find-contacts")69 .prompt(`Score this account as a sales opportunity:7071Company: {{company-research.output}}72Tech: {{tech-stack.output}}73Contacts: {{find-contacts.output}}7475Scoring criteria:76- Company size fit (0-25 points)77- Industry fit (0-25 points)78- Tech stack compatibility (0-20 points)79- Budget indicators (0-15 points)80- Intent signals (0-15 points)8182Total score (0-100) with breakdown.83Recommend: Pursue, Nurture, or Disqualify`)8485 // Step 5: Draft personalized outreach86 .step("draft-outreach")87 .with("anthropic:claude-3.5-sonnet")88 .depends("company-research", "tech-stack", "score-account")89 .prompt(`Draft personalized outreach email:9091Company Context: {{company-research.output}}92Tech Stack: {{tech-stack.output}}93Account Score: {{score-account.output}}9495Target Role: {{targetRole}}96Our Value Prop: {{valueProposition}}9798Email requirements:99- Personalized hook (reference specific company detail)100- Relevant pain point based on their tech stack101- Concise value proposition (2 sentences)102- Soft CTA (15-min chat)103- Under 100 words total104105Professional but conversational tone.`)106107 .run({108 companyName: "TechCorp Solutions",109 domain: "techcorp.com",110 productDescription: "AI workflow automation platform for enterprises",111 targetRole: "VP of Engineering",112 valueProposition: "Reduce engineering ops overhead by 60% with AI agents",113 });114115// Update CRM116await updateCRM({117 company: result.steps["company-research"].output,118 enrichmentData: {119 techStack: result.steps["tech-stack"].output,120 accountScore: result.steps["score-account"].output,121 contacts: result.steps["find-contacts"].output,122 },123 draftEmail: result.steps["draft-outreach"].output,124});Batch Processing
1// Enrich list of leads2import { relay } from "@relayplane/workflows";34async function enrichLeadList(leads: Array<{ company: string; domain: string }>) {5 const results = [];67 for (const lead of leads) {8 const enriched = await relay9 .workflow("data-enrichment")10 .run({11 companyName: lead.company,12 domain: lead.domain,13 productDescription: "Workflow automation platform",14 targetRole: "Engineering Leader",15 valueProposition: "Ship faster with AI-powered workflows",16 });1718 const score = JSON.parse(enriched.steps["score-account"].output);1920 results.push({21 company: lead.company,22 score: score.total,23 recommendation: score.recommendation,24 outreach: enriched.steps["draft-outreach"].output,25 });2627 // Rate limit: 1 per second28 await new Promise(resolve => setTimeout(resolve, 1000));29 }3031 // Sort by score32 return results.sort((a, b) => b.score - a.score);33}3435const enrichedLeads = await enrichLeadList(csvLeads);36console.log("Top prospects:", enrichedLeads.slice(0, 10));Webhook Integration
1# Auto-enrich leads from form submissions2relayplane webhooks create lead-enrichment \3 --workflow data-enrichment \4 --secret ${WEBHOOK_SECRET}56# Configure in your form handler:7# POST https://api.relayplane.com/webhooks/lead-enrichment8# { "companyName": "...", "domain": "..." }Sample Output
**Account Score Breakdown:** - Company Size Fit: 25/25 (500-1000 employees, perfect ICP) - Industry Fit: 20/25 (B2B SaaS, high intent) - Tech Stack: 18/20 (Modern stack, no competitor detected) - Budget: 12/15 (Series B funded, $50M raised) - Intent: 10/15 (Recent job posting for automation engineer) **Total: 85/100 - PURSUE** **Recommended Action:** High-priority outbound sequence
Data Sources
- Perplexity: Real-time web research for company data
- BuiltWith/Wappalyzer: Technology stack detection
- LinkedIn: Decision maker identification
- Crunchbase API: Funding and growth data