Groq-powered Gmail triage with HubSpot tickets and Slack alerts

By General Input

Every 15 minutes, Groq reads new Gmail messages, tags intent and urgency, opens HubSpot tickets for support, and pings Slack about hot sales leads.

Integrations

  • Groq
  • Gmail
  • HubSpot
  • Slack

Type

Agentic Task

Categories

  • Operations
  • Sales

Every 15 minutes, run a fast Gmail triage pass. The whole point is speed: Groq classifies each email in a fraction of a second so the loop can keep up with a live inbox and nothing waits around.

Trigger: cron, every 15 minutes.

Step 1 — pull new mail. Use Gmail's List Messages with the query "in:inbox is:unread newer_than:20m". The 20-minute window is intentionally wider than the 15-minute cadence so a message never falls through the crack between runs.

Step 2 — dedupe. Before doing any work on a message, check the Gmail message ID against the list of IDs already handled by previous runs and skip anything already seen. After you finish handling a message, record its ID so the next run won't touch it again. This rule is non-negotiable — the same email must never be processed twice.

Step 3 — classify with Groq. For each new message, call Groq's Create Chat Completion using llama-3.3-70b. Ask the model to return, in a single structured response: (a) intent, one of support, sales, vendor, internal, or spam; (b) urgency, one of low, medium, or high; and (c) a two-sentence draft reply when a quick response is appropriate, or an empty string when it isn't. Keep the prompt tight so the round trip stays snappy — this loop should feel instant.

Step 4 — route based on the classification.

If intent is "support": create a HubSpot ticket via Create Ticket. Use the Gmail subject as the ticket subject, and put a short summary of the email body plus the sender's address into the description. Set a sensible default pipeline stage.

If intent is "sales" AND urgency is "high": post a Slack alert via Send a Message to the sales channel. Tag the account owner (configurable — default to a channel-wide mention if no owner is set), include the sender, a one-line summary of what they want, and paste the AI-drafted two-sentence reply as a suggested response the human can copy, edit, and send.

For vendor, internal, spam, and lower-urgency sales messages, do nothing beyond recording the message ID as handled.

Latency matters throughout: prefer parallel classification for the batch of new messages, keep the Groq prompt short, and avoid extra tool calls when the classification is already enough to decide the route. If the batch is empty, exit quietly without any downstream calls.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationChase the paperwork every new client and vendor still owes