Route inbound email leads into HubSpot with Slack alerts

Every 15 minutes during business hours, sort new inbound emails, sync sales inquiries to HubSpot, ping Slack on urgent ones, and stage a suggested reply.

Agentic Task
NylasHubSpotSlackSalesOperationsEmail AutomationLead EnrichmentNotifications & Alerts
PromptCreate

Build an agent workflow that triages my inbound email inbox and routes sales leads into HubSpot with a Slack alert on the urgent ones.

Trigger: run on a cron every 15 minutes during business hours (Monday to Friday, 8am to 6pm in my local timezone).

On each run, use the Nylas List Messages operation to pull unread inbound messages received since the last run. Pass a provider-native search filter through search_query_native so it works for both Gmail (Gmail search operators like is:unread newer_than:1h -in:sent) and Microsoft Outlook (KQL like isRead:false received>=<timestamp>) out of the same workflow. Limit to the most recent 50 messages per run to stay under rate limits.

For each message, classify the intent as one of: sales_inquiry, support_request, vendor_pitch, newsletter, or noise. Also extract the sender's display name, their company (from the email domain or signature), and a one-sentence summary of the core ask. Skip anything classified as newsletter, vendor_pitch, or noise. Do not process it further.

For messages classified as sales_inquiry: call HubSpot Search Contacts by email to see if the sender already exists. If no contact is found, call HubSpot Create Contact with their email, first name, last name, company, and lifecycle stage set to lead. Then call HubSpot Create Note associated with that contact, containing the email excerpt (first ~500 chars), the detected intent, and the extracted core ask.

For anything you judge urgent or high value (an obvious buying signal, a decision-maker at a target-size company, a time-sensitive question, or an existing HubSpot contact in an open deal), call Slack Send a Message to post a short summary to a channel called #sales-inbox. Include the sender, company, intent, one-line summary, and a link back to the original email thread. Do not post low-signal messages to Slack.

For every sales_inquiry (urgent or not), use Nylas Create Draft to stage a suggested first reply in my mailbox. Address it to the sender, keep it short (3 to 5 sentences), match a friendly professional tone, acknowledge their ask, propose a next step (a 20-minute call or a scoped answer), and sign off with my name. Do not send the draft. Leave it in Drafts so I can review and send manually.

Track which message IDs have already been processed so the next run does not re-triage the same email. A simple in-workflow state or timestamp checkpoint on last processed received_at is fine.

Integrations to use: Nylas (List Messages, Create Draft), HubSpot (Search Contacts, Create Contact, Create Note), Slack (Send a Message). Do not use any other services.

Additional information

What does this prompt do?
  • Reads new inbound emails every 15 minutes during your working hours across Gmail or Outlook.
  • Classifies each message as sales inquiry, support request, vendor pitch, newsletter, or noise, and ignores the noise.
  • Logs sales leads into HubSpot, creating the contact if it does not exist yet, and attaches a note with the email excerpt and detected intent.
  • Alerts your sales channel in Slack when something looks urgent or high value, with a link back to the original thread.
  • Stages a suggested first reply as a draft in your mailbox so you can review and edit before sending.
What do I need to use this?
  • A Nylas account connected to your Gmail or Microsoft Outlook mailbox.
  • A HubSpot login with permission to search contacts, create contacts, and add notes.
  • A Slack workspace and a sales channel you want the alerts posted in.
How can I customize it?
  • Change how often it runs and which hours count as business hours.
  • Adjust which sender types or keywords count as urgent or high value.
  • Tweak the tone, signature, and template used for the suggested draft reply.
  • Pick which HubSpot properties get filled in when a brand new contact is created.

Frequently asked questions

Does this work with both Gmail and Outlook?
Yes. Nylas connects to either Gmail or Microsoft Outlook, so the same workflow runs across both without needing separate versions.
Will it send emails on my behalf without me seeing them?
No. The suggested reply is saved as a draft in your mailbox. You still open, edit, and send it yourself.
What happens if the sender is already a contact in HubSpot?
We look up the contact by email first. If they exist, we skip the create step and just attach the note to the existing record.
How does it decide what counts as urgent?
The agent uses the intent it detected and cues in the email itself. You can tune the definition in plain language, for example prioritizing large companies, decision-makers, or specific keywords.
Will it spam my Slack channel with newsletters and receipts?
No. Anything classified as newsletter, transactional, or noise is filtered out. Only sales inquiries and urgent messages make it to Slack.

Stop letting good leads sit in your inbox.

Connect Nylas, HubSpot, and Slack once. Every 15 minutes we sort your inbox, log new leads in your CRM, and get a reply ready for you to send.