Marketing keeps producing leads, but sales gets a thin row in a CRM: a name, an email, maybe a company. Before they can act, someone has to look up the company size, the industry, the location, and decide if this is a high value lead or just noise.
This research takes time. While it happens, the lead cools down. By the time someone calls, the prospect has already moved on to a competitor.
dataflows triggers the moment a new lead is captured. It enriches the contact with company data from public sources, scores the lead based on your own rules, and routes it to the right sales channel: enterprise, mid market, self serve, or "do not pursue".
The right sales person gets a notification in Slack with the full context, ready to act. The whole flow happens within seconds, not the next morning.
// Lead enrichment workflow
export const leadEnrichment = defineWorkflow({
id: 'lead-enrichment',
trigger: { type: 'webhook', path: '/lead' },
async run({ event, step }) {
const { name, email } = event.body
const enrichment = await step.run('enrich', () =>
enrich.byEmail(email)
)
const score = await step.run('score', () =>
scoring.evaluate({ ...enrichment, source: event.source })
)
const lead = await step.run('upsert-crm', () =>
crm.leads.upsert({
name, email,
company: enrichment.company,
score,
rating: score > 80 ? 'Hot' : 'Warm'
})
)
await step.run('notify-sales', () =>
slack.send(
score > 80 ? '#sales-enterprise' : '#sales-inbound',
`New lead: ${name} (${enrichment.company.name}) — score ${score}`
)
)
return { leadId: lead.id, score }
}
})