Enrich new HubSpot leads with your AWS Lambda function
When a new contact hits HubSpot, we run your Lambda enrichment, save the score and firmographics back to the record, and ping your sales channel.
When a new contact is created in HubSpot, run my AWS Lambda enrichment function on it, write the result back onto the contact, and post a summary to the sales channel in Slack.
Trigger: HubSpot webhook on the contact.creation event. Every new contact — form submission, list import, manual add, integration push — should fire this workflow exactly once.
Step 1. From the webhook payload, resolve the HubSpot contact and read its email, company (or associated company name), and any utm_source, utm_medium, utm_campaign, utm_term, and utm_content properties. If company isn't set on the contact, fall back to the primary associated company's name when one exists.
Step 2. Call AWS Lambda Invoke synchronously (InvocationType = RequestResponse) against the customer's enrichment function. The function name is a workflow input the user provides at setup — do not create or manage the function; it is customer-owned. Send the event payload as JSON with the shape { email, company, utm: { source, medium, campaign, term, content } }. Parse the JSON body of the response. Expected shape: { leadScore: number, firmographics: { industry, employeeCount, revenue, region, ... }, routingOwner: string }. If the response is missing or malformed, skip the HubSpot update and still send the Slack message with just the basics so the team is not blind.
Step 3. Update the contact in HubSpot with Update Contact, targeting the contact ID from the trigger. Map leadScore to a numeric contact property (default name: lead_score) and each key in firmographics to a matching contact property by name. Only write fields that came back non-empty — never blank out an existing HubSpot value with an empty enrichment value.
Step 4. Send a Message with the Slack bot into the sales channel (channel is a workflow input; default #sales). Include the contact's full name, company, lead score, and suggested routing owner, plus a link back to the HubSpot contact record so the rep can jump straight in.
Every step is a known node — HubSpot webhook, AWS Lambda Invoke, HubSpot Update Contact, Slack bot Send a Message — so build this as a code workflow, not an agent.
Additional information
What does this prompt do?
- Watches HubSpot for brand-new contacts, including form fills, list adds, and manual creates.
- Sends the contact's email, company, and campaign details to your existing AWS enrichment function and reads back the result.
- Writes the returned lead score and enrichment fields onto the matching HubSpot contact properties.
- Posts a summary to your sales channel in Slack with the contact name, company, score, and suggested owner so the right rep picks it up fast.
What do I need to use this?
- A HubSpot account you can log into, with permission to see contact-creation events.
- Your existing enrichment function running on AWS, plus an access key that can call it.
- A Slack workspace and the channel where sales should be notified about new inbound leads.
How can I customize it?
- Change which HubSpot contact properties the lead score and enrichment fields land in.
- Swap in a different sales channel, or reformat the Slack message to include extra fields.
- Adjust which contact fields get sent to your function (add region, phone, form ID, referrer, and so on).
Frequently asked questions
Do I need to build the enrichment function first?
Will this run for every new HubSpot contact?
What if my function fails or returns nothing useful?
Can I send the alert somewhere other than Slack?
Does this replace HubSpot's built-in workflow tool?
Related templates
Stop letting inbound leads sit unenriched.
Every new HubSpot contact gets scored, enriched, and routed to the right rep the moment the form is submitted.