Route new HubSpot contacts into the right MailForge nurture list

By General Input

The moment a new contact lands in HubSpot, we sort them into the right MailForge list, tag them, and ping sales in Slack if they look hot.

Integrations

  • HubSpot
  • MailForge
  • Slack Bot

Type

Agentic Task

Categories

  • Sales
  • Marketing

Build me an agent workflow that routes brand-new HubSpot contacts into the right MailForge nurture list, and pings sales in Slack when the contact looks like an enterprise fit.

Trigger: a HubSpot webhook subscribed to the contact.creation event. When the webhook fires, take the contact id from the event and call HubSpot Get Contact to load these properties: email, firstname, lastname, company, lifecyclestage, industry, numemployees, hs_lead_status, hubspotscore, and hs_analytics_source.

Then run these steps in order:

1. Skip if suppressed. Call MailForge List Suppressions and check whether the contact's email appears in the results. If it does, stop immediately with a "skipped: suppressed" outcome. Do not upsert, do not add to a list, do not post to Slack. This step is critical so we never re-nurture someone who has opted out.

2. Upsert into MailForge. Call MailForge Create or Update Contact keyed on the contact's email address. Carry over firstname and lastname, and set two tags on the contact: an industry tag of the form industry:<value> (lower-cased, or industry:unknown if the HubSpot property is blank) and a source tag of the form source:<value> based on hs_analytics_source (lower-cased, or source:unknown if blank). This gives marketing a way to segment inside MailForge later without a second sync.

3. Pick a nurture list. Reason about which MailForge nurture list the contact belongs on using these default rules, and treat the list names as workflow inputs so they can be renamed later:

- If numemployees is 1000 or more, OR lifecyclestage is salesqualifiedlead, OR hubspotscore is 80 or higher, choose the Enterprise list.

- Else if lifecyclestage is lead or marketingqualifiedlead and the contact has a company set, choose the SMB Trial list.

- Else if lifecyclestage is subscriber or customer, choose the Newsletter Only list.

- Otherwise, fall back to Newsletter Only.

Then call MailForge Add Contact to List passing the contact email and the chosen list name.

4. Alert sales if hot. If the contact matched the Enterprise rule, post a message to Slack using the Slack Bot Send a Message operation (prefer the bot integration over the user integration for automated alerts). The target channel is a workflow input, defaulting to #sales-alerts. The message body should be about four short lines: the contact's full name, their company and industry on one line, their HubSpot score if present, and a permalink to the HubSpot contact of the form https://app.hubspot.com/contacts/<portalId>/contact/<contactId>. The HubSpot portal id is a workflow input.

At the end of every run, log a short summary: the contact email, whether they were suppressed, which MailForge list they landed on, and whether a Slack alert fired.

Workflow inputs the user should be able to edit without touching the prompt text: the Slack alert channel (default #sales-alerts), the HubSpot portal id used for permalinks, the four MailForge list names (Enterprise, SMB Trial, Newsletter Only, fallback), and the HubSpot score threshold that counts as hot (default 80).

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery boardLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsA searchable RFP answer library your bid team drafts fromLinkedIn Ads budget pacing dashboard for every client account