---
title: "Recipe: Enrich new leads automatically"
description: "TL;DR: When a new lead enters your CRM or a form, this playbook enriches it with company size, industry, and contact details from web research and enrichment APIs, then writes the data back to HubSpot or Salesforce. Trigger is a webhook or schedule; output is an enriched CRM record."
canonical_url: "https://docs.ballet.dev/articles/recipe-enrich-new-leads-automatically-mPEoUuj0zc"
md_url: "https://docs.ballet.dev/articles/recipe-enrich-new-leads-automatically-mPEoUuj0zc.md"
---
# Recipe: Enrich new leads automatically

**TL;DR:** When a new lead enters your CRM or a form, this playbook enriches it with company size, industry, and contact details from web research and enrichment APIs, then writes the data back to HubSpot or Salesforce. Trigger is a webhook or schedule; output is an enriched CRM record.

## Who this is for

Sales and RevOps teams that manually research new leads before outreach.

## What you'll need

* **Connectors:** HubSpot or Salesforce, a web research/enrichment source (Exa or an HTTP enrichment API).
* **Secrets:** CRM API key, enrichment API key.
* **Trigger:** Webhook on new lead, or a schedule that processes recent leads.

## How to build it with Ask Ballet

1. Open the Console on Home.
2. Paste the prompt below; set your CRM and enrichment source.
3. Review the plan and confirm.
4. Connect the CRM and enrichment source, then register the webhook.

```text
Build a playbook that triggers when a new lead is created in HubSpot. Take the lead's
email and company domain, look up company industry, employee count, and location using
our enrichment API and web search, and find the contact's title and LinkedIn URL.
Write the enriched fields back to the HubSpot contact and company records. If the
domain is a free email provider, tag the lead "needs-review" instead.
```

## What the playbook does

1. **Webhook trigger** — receives the new lead.
2. **Code step (extract)** — parses the email domain and existing fields.
3. **HTTP step (enrich)** — calls enrichment/web search for firmographic and contact data.
4. **HTTP step (update CRM)** — writes enriched fields back to the contact and company.
5. **Code step (flag)** — tags low-confidence or personal-email leads for review.

## Variations and tips

* Cache enrichment results to avoid repeat API costs for the same domain.
* Feed the enriched record straight into [Lead routing and follow-up](./lead-routing-follow-up.md).
* Store API keys in Secrets and respect enrichment provider rate limits.

## Related articles

* [Lead routing and follow-up](./lead-routing-follow-up.md)
* [Customer onboarding](./customer-onboarding.md)
* [What is a connector?](/articles/what-is-a-connector-and-how-do-i-browse-the-registry-6PxIdsLTWe)
* [How do I store credentials with Secrets?](/articles/how-do-i-store-credentials-with-secrets-1D8OUcCo0n)
