Weekly Salesforce pipeline snapshot to Google Sheets and Gmail

By General Input

Every Monday at 8am ET, pull the next 90 days of open Salesforce pipeline, log a snapshot to Google Sheets, and email a clean summary to sales leadership.

Integrations

  • Salesforce
  • Google Sheets
  • Gmail

Type

Deterministic Code

Categories

  • Sales
  • Operations

Build a deterministic code workflow that runs every Monday at 8:00 AM America/New_York and produces a weekly pipeline snapshot for sales leadership.

Trigger: cron, weekly, Monday 08:00 ET.

Step 1. Salesforce SOQL Query against the Opportunity object. Pull all open opportunities (IsClosed = false) with CloseDate within the next 90 days from today. Select Id, Name, Amount, StageName, OwnerId, Owner.Name, AccountId, Account.Name, CloseDate, and LastActivityDate. Order by CloseDate ascending.

Step 2. In code, transform the result set: (a) compute total Amount and opportunity count bucketed by StageName, (b) compute total Amount and opportunity count bucketed by Owner.Name, (c) flag any opportunity where LastActivityDate is null or older than 14 days from the run date as stale.

Step 3. Google Sheets Append Values. Append one row per opportunity to the configured pipeline log spreadsheet and tab. Columns in order: run_date (today, ISO date), opportunity_id, opportunity_name, account_name, owner_name, stage, amount, close_date, last_activity_date, is_stale (true/false). This builds a week-over-week history.

Step 4. Build a clean HTML email body. Include: a header with the run date, a By Stage table (stage, deal count, total amount), a By Owner table (owner, deal count, total amount), and a Stale Deals section listing every flagged opportunity with name, owner, stage, amount, close date, and last activity date. Format amounts as USD currency.

Step 5. Gmail Send a Message. Send the email to the sales leadership distribution list (configurable recipients) with subject "Weekly pipeline snapshot" and the HTML body from step 4.

Inputs to expose as workflow configuration: the Google Sheet ID and tab name for the pipeline log, the recipient list for the email, the lookback days for stale flagging (default 14), and the close date window in days (default 90).

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to Loops