Steadybase
Temporal Workflows

Lead Qualification Workflow

3-step AI-powered lead scoring and intelligent routing workflow.

Lead Qualification Workflow

A 3-step Temporal workflow that enriches lead data, scores leads using AI (0-100), and routes them to the appropriate GTM motion.

Workflow Definition

interface LeadQualificationInput {
  leadId: string;
  company: string;
  contact: string;
  source: string;
}
 
interface LeadQualificationOutput {
  score: number;        // 0-100
  route: string;        // 'ae-direct' | 'bdr-nurture' | 'marketing-drip'
  enrichedData: object;
  reasoning: string;
}

Steps

Enrich Lead Data Activity: enrichLeadData

Gathers additional data about the lead:

  • Company firmographics (size, industry, funding, tech stack)
  • Contact role and seniority
  • Recent activity signals (website visits, content downloads)
  • Existing relationship context from memory

AI Scoring Activity: scoreLeadWithAI Model: Claude CLI

AI-powered scoring using the enriched data. The model evaluates against qualification criteria (BANT + MEDDIC hybrid) and returns a score from 0-100 with reasoning.

const result = await scoreLeadWithAI({
  enrichedData,
  scoringCriteria: await readMemory('org', 'qualification-criteria'),
  historicalPatterns: await readMemory('team', 'scoring-baselines')
});
// Returns: { score: 82, reasoning: "Strong ICP fit, budget confirmed, ..." }

Route Lead Activity: routeLead

Routes the lead based on score:

Score RangeRouteAction
80-100AE DirectCreate meeting, assign to territory AE
50-79BDR NurtureAdd to 5-touch outreach sequence
0-49Marketing DripAdd to marketing automation nurture

Queries

QueryReturns
statusCurrent step, lead score (if computed), route decision

Scoring Criteria

The AI scoring model evaluates across these dimensions:

CriteriaWeightSignals
ICP Fit30%Company size, industry, tech stack alignment
Budget20%Funding stage, ARR, stated budget
Authority20%Contact seniority, decision-making role
Need15%Pain signals, competitive mentions, use case fit
Timeline15%Urgency signals, contract renewal dates

Memory Integration

  • Scoring criteria stored in org scope (shared across all workers)
  • Historical scoring baselines stored in team scope
  • Individual lead context stored in worker scope for the assigned BDR

On this page