Agents: CRM Automation
The Agent is the automation engine inside AB Sales Management Service — the part that fills in gaps on your leads and sends the first-touch email so you don't have to. It runs on a 5-minute timer, only on leads (not customers, contacts, or opportunities), and only when you've enabled it. Manage it from the Agents tab inside the CRM section.
What the Agent does, in three stages
Each tick, the Agent walks up to 10 leads per organization and runs as many of the three stages as apply to each lead. Stages are gated on what's missing — the Agent never overwrites information you've already entered.
Stage 1: Find the website
- Runs on leads that have a Name but no Website.
- First tries the lead's email domain (if it's a corporate email, not gmail/yahoo/outlook). Fast and free.
- Falls back to Gemini with Google Search grounding, prompted with everything we know about the lead (industry, phone, email domain, notes).
- Whatever URL comes back must respond 2xx AND the page text must mention the company name. AI confidence alone isn't trusted — this is what keeps hallucinated URLs out.
- If verified, the URL is saved on the lead. If not, the attempt is logged and the lead waits 24 hours before retry.
Stage 2: Research the website
- Runs on leads that now have a Website but no Email.
- Fetches the homepage, strips it to plain text, asks Gemini for the best contact email + a short company description + the contact name.
- The email is sanitized down to a bare address (no memo text, no angle brackets). Noise mailboxes like
jobs@,no-reply@,press@are skipped. - If a real contact email is found, it's saved on the lead. Company description goes into the Notes area for context.
Stage 3: Send a template email
- Runs on leads in Information filled status (Name + Website + Email all present) that have never been auto-emailed.
- Gates: organization has mail config + has not hit its daily email cap + the lead isn't opted out.
- Picks the template configured for the org, runs
{{LeadName}}-style placeholder substitution, sends via Microsoft Graph from the configured shared mailbox or user principal. - On success, the lead's status moves to Contacted and a Teams card lands in the org's CRM notification channel with what was sent.
The post-send Teams card
Every automated send drops an Adaptive Card into the configured CRM channel showing the lead name, contact, template used, and timestamp. Two action buttons sit at the bottom:
- Stop automating this lead — flips the lead's automation opt-out flag. The Agent will never touch that lead again at any stage. The card audits who clicked and when.
- Mark as bad lead — same effect plus moves status to Disqualified.
The card is the canonical “we're emailing this person right now” signal — if you spot one mid-stream and don't want it, you have a single click to stop the next pass cold.
Pausing the whole Agent
- From the Agents tab, set a Paused until timestamp.
- The Agent will skip the entire organization until that time passes — useful before a holiday, during a product incident, or while you migrate templates.
- Auto-resume is silent: the next 5-minute tick after the pause expires picks the org back up. No re-enable click needed.
Per-lead opt-out
- Set the Automation opt-out flag on a lead (from the lead detail panel, or via the post-send Teams card) to permanently exclude it from all three stages.
- The flag records who set it and when, so it shows up in change history.
- You can unset the flag later if circumstances change.
Tips
- Start with the Agent disabled, manually email a few leads to validate the template, then enable. The first “wait, this template has a typo” happens to everyone.
- The daily email cap is a hard limit per organization — set it low at first (5–10) and raise once you trust the system.
- The Notes field on a lead feeds into the AI research prompt. Putting context there ("found at trade show X", "headquarters in Osaka") gives the Agent better anchors.
- If a lead keeps getting skipped, click into its detail panel — the audit log records the exact reason from the last attempt ("page didn't mention company name", "no-mail-config", "daily-cap-reached", etc.).
The Agent is meant to do the typing, not the thinking. The verified-URL bar, the noise-mailbox filter, the per-lead opt-out, the post-send Teams card — they all exist so you stay in the loop on the few things that matter while the boring work happens automatically.