Clean bounced emails from HubSpot and alert your team in Slack

By General Input

When Customer.io reports a hard bounce or spam complaint, mark the contact as invalid in HubSpot and post a real-time summary to your marketing-ops channel.

Integrations

  • Customer.io
  • HubSpot
  • Slack Bot

Type

Agentic Task

Categories

  • Marketing
  • Operations

Build me an agent workflow that protects email deliverability by reacting in real time to Customer.io bounce and spam complaint events. The agent should clean up the matching HubSpot contact and alert our marketing-ops team in Slack.

Trigger: a Customer.io Reporting Webhook. I will configure the webhook in Customer.io to send `email_bounced` and `email_spammed` events to the workflow's webhook URL. Each request body will include the recipient email, delivery id, message id, the reason text, and a flag indicating whether the bounce is hard, soft, or a spam complaint.

Step 1: Parse the incoming webhook payload and pull out the recipient email, delivery id, message id, the raw bounce reason, and the bounce category (hard vs soft vs spam complaint).

Step 2: Classify the failure into one of: mailbox does not exist, domain rejected, policy or content block, spam complaint, or transient soft bounce. If it is a soft bounce, stop and do nothing. Only continue for hard bounces and spam complaints.

Step 3: Look up the contact in HubSpot using the Get Contact operation with the recipient email as the lookup property. If no contact is found, skip step 4 and still post a Slack alert noting that no CRM record was found.

Step 4: Call HubSpot Update Contact on the matched record. Set `hs_email_optout` to true and also set a custom property `email_status` to `invalid`. Append the bounce reason and the failure category to a notes-style property (for example `email_bounce_reason`) so the marketing team can see why the contact was deactivated.

Step 5: Send a Slack message via the Slack Bot integration's Send a Message operation to the `#marketing-ops` channel. The message should include: the affected email address, the failure category and a one-line plain-English diagnosis of the likely cause, a link or reference to the HubSpot contact if one was updated, the Customer.io delivery id and message id for traceability, and today's running bounce count so the team can see if there is a spike.

The agent's value is in interpreting the bounce reason text and deciding whether the contact should be deactivated (clearly dead mailbox, domain reject, or spam complaint) versus left alone (transient or ambiguous soft bounce). Be conservative: when in doubt, do not deactivate the contact, and flag it in Slack as needing human review.

Integrations to use: Customer.io as the webhook trigger source (no Customer.io action operations are called), HubSpot for Get Contact and Update Contact, and Slack Bot for Send a Message.

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