🤝 Send weekly Salesforce sales behavior coaching reports with Groq and Gmail

⚡ 94 views · 🤝 CRM & Sales Operations

Description

Quick overview

This scheduled workflow pulls last week’s Salesforce opportunities, tasks, and events for a specific rep, computes activity and pipeline health metrics, uses Groq (LLM) to generate coaching insights, creates a QuickChart performance chart URL, and emails a weekly behavioral report via Gmail.

How it works

  1. Runs weekly on a schedule.
  2. Retrieves a target Salesforce user and queries that user’s opportunities with activity in the last week.
  3. Builds an Opportunity ID list, then pulls related Salesforce Tasks and Events and merges them into a single activity stream alongside the opportunities.
  4. Calculates per-opportunity engagement metrics (touches, calls, emails, follow-ups, meetings) and the days since last activity based on activity subjects and dates.
  5. Aggregates the opportunity metrics into per-rep totals including revenue, won/lost deals, and a stale-deal count based on activity gaps.
  6. Generates a QuickChart URL visualizing weekly activity versus outcomes and sends the rep metrics to Groq to produce structured coaching insights.
  7. Combines the chart and AI insights and sends an HTML weekly coaching email through Gmail.

Setup

  1. Connect Salesforce OAuth2 credentials and set the Salesforce User ID used by the workflow to identify the rep.
  2. Verify or adjust the Salesforce opportunity query filters (for example LAST_WEEK and OwnerId) to match your reporting needs.
  3. Connect Groq API credentials for the LLM and keep the structured output schema as-is (or update it if you change the email fields).
  4. Connect Gmail OAuth2 credentials and set the email recipients and sender settings in the Gmail node.
  5. Ensure your Salesforce Task/Event subjects follow predictable keywords (call, email, follow-up, demo/meeting) or update the classifier logic to match your activity naming conventions.

Additional info

How To Customize Nodes

Add‑ons

Use Case Examples

Troubleshooting Guide

IssuePossible CauseSolution
No opportunities foundIncorrect Salesforce User IDEnsure the Get user node is successfully retrieving your recent Salesforce items.
Chart image is brokenInvalid Chart ConfigurationCheck the Generate Performance Chart URL node for any syntax errors in the JSON config sent to QuickChart.
AI node returns errorGroq API Rate LimitIncrease the delay between runs or switch to a different Groq model in the LLM Model node.
Email fails to sendGmail OAuth expiredRe-authenticate your Gmail credentials in the n8n settings.

Need Help?

Analyzing sales behavior is a complex task that requires clean data and precise AI prompting. If you need help refining your Salesforce SOQL queries, adjusting the behavioral metrics or integrating this report into a larger sales dashboard, our n8n workflow development experts are ready to assist.

Contact WeblineIndia to help you build, customize or scale your sales automation and AI coaching tools today!

đź”— Nodes Used

Salesforce, Gmail, Schedule Trigger, Basic LLM Chain, Structured Output Parser, Groq Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup