Triage inbound sales emails into HubSpot deals and Slack

By General Input

Every five minutes during business hours, real prospect inquiries get logged in HubSpot, acknowledged from your inbox, and posted to your sales channel.

Integrations

  • AgentMail
  • HubSpot
  • Slack Bot

Type

Agentic Task

Categories

  • Sales

Build me an inbound sales lead triage agent on top of AgentMail, HubSpot, and Slack.

Trigger: cron, every 5 minutes from 8am to 7pm on weekdays in my local time zone. Keep track of the last run timestamp so each run only looks at messages received since then.

Each run, do the following:

1. Call AgentMail List Messages on my sales inbox, filtered to messages received since the last run. For every new message, call AgentMail Get Message to load the full thread, sender, subject, and body.

2. For each message, use LLM judgement on the sender domain and the body to decide if it is a real prospect inquiry. Skip newsletters, marketing blasts, vendor pitches, cold outbound, auto-replies, out-of-office, delivery failures, and anything that is clearly not a first-touch buyer message. Be conservative: when in doubt, skip the auto-reply and let a human look at it. Only proceed for messages that look like a genuine human asking about our product or service.

3. For qualifying messages, extract: prospect name, company, email address, and a one or two sentence summary of their stated need.

4. Upsert the contact in HubSpot using Batch Upsert Contacts keyed on email, with first name, last name, email, and company. Then call HubSpot Create Deal in the New Leads pipeline (let me pick the pipeline and stage at setup time), with the deal name set to "<Company> – inbound inquiry" and the inquiry summary plus a quote of the original message saved on the deal so it shows up in deal notes. Associate the deal with the contact (and the company if HubSpot has one).

5. Post a Slack message via Slack Bot Send a Message to the #sales-leads channel (configurable). The message should include: prospect name and company, the one-sentence summary of what they want, the sender's email address, a deep link to the AgentMail thread, and a deep link to the new HubSpot deal.

6. Send a short personalized acknowledgement using AgentMail Reply To Message on the same thread, written in a warm, plain, human tone (two or three sentences) that references what they actually asked about and tells them a real person on the team will follow up shortly. Only send this reply for messages that look like a genuine first-touch human inquiry. Never reply to auto-responders, out-of-office, no-reply senders, or anything you classified as not-a-lead.

Idempotency: keep a record of which message ids have already been processed so a retry or overlapping run does not double-create deals or send duplicate acknowledgements.

Make the inbox address, the HubSpot pipeline and stage, the Slack channel, the business-hours window, and the acknowledgement template all configurable at setup time.

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