Scan for large Salesforce deals using Claude Cowork
Prerequisites
- Claude Desktop with Cowork enabled
- Salesforce Connected App credentials (Consumer Key, Consumer Secret, and a Security Token)
- Slack Incoming Webhook URL or Bot Token
- A computer that stays awake during business hours (or a dedicated machine running Claude Desktop)
Overview
Claude Cowork lets you define a recurring task in plain English and have Claude execute it on a schedule — no script or skill file required. You describe what you want, and Claude uses its built-in tools to query the Salesforce API, filter results, and post a digest to Slack. This is the fastest way to get large-deal alerts working with zero code.
Step 1: Get your Salesforce API credentials
You need a Connected App for API access. In Salesforce Setup, go to App Manager → New Connected App:
- Enable OAuth Settings: checked
- OAuth Scopes:
api,refresh_token
After saving, copy the Consumer Key and Consumer Secret. You'll also need your Security Token (found under My Settings → Personal → Reset My Security Token).
Store these as environment variables: SF_CLIENT_ID, SF_CLIENT_SECRET, SF_USERNAME, SF_PASSWORD, SF_SECURITY_TOKEN.
Step 2: Create the Cowork task
Open Claude Desktop and go to the Cowork tab. Click + New task.
Title: Alert Slack on large Salesforce opportunities
Description:
You are a sales ops assistant. Your job is to find large Salesforce opportunities created today and post a summary to Slack.
Steps:
1. Authenticate with Salesforce using the OAuth2 password grant:
POST https://login.salesforce.com/services/oauth2/token
grant_type=password
client_id=$SF_CLIENT_ID
client_secret=$SF_CLIENT_SECRET
username=$SF_USERNAME
password=$SF_PASSWORD + $SF_SECURITY_TOKEN
2. Run this SOQL query using the access token and instance URL from the auth response:
SELECT Id, Name, Amount, StageName, Account.Name, Owner.Name, CreatedDate
FROM Opportunity
WHERE CreatedDate = TODAY AND Amount >= 50000
3. If no results, print "No large opportunities today" and stop.
4. Format a single Slack digest message with all results:
:dart: *Large Opportunities Created Today*
For each opportunity, include: Name, Amount, Stage, Owner, Account, and a link to the record.
5. Post the digest to Slack:
POST https://hooks.slack.com/services/YOUR_WEBHOOK_URL
Body: {"text": "<formatted digest>"}
Use environment variables for all credentials — never hardcode them.Replace YOUR_WEBHOOK_URL with your Slack Incoming Webhook URL.
Store Salesforce and Slack credentials as shell environment variables. Reference them in your task description as "use the value from the SF_CLIENT_ID environment variable." Claude can read env vars when running bash commands.
Step 3: Set the schedule
Frequency: Daily at 5:00 PM (local time)
A single end-of-day digest keeps your leadership channel clean while still surfacing every large deal that entered the pipeline.
Scheduled Cowork tasks only execute while Claude Desktop is open and your computer is awake. If you close the app or your laptop sleeps, tasks are skipped until the next scheduled interval. For 24/7 coverage, use the Agent Skill approach with cron or GitHub Actions instead.
Step 4: Run manually first
Click Run now in Cowork to test. Claude will:
- Authenticate with Salesforce
- Run the SOQL query for today's large opportunities
- Format the digest
- Post to Slack
A successful run looks like:
Authenticated with Salesforce (instance: https://your-org.my.salesforce.com)
Found 3 opportunities over $50K created today.
Posted digest to Slack:
- Acme Corp Platform License — $75,000 (Prospecting, owned by Jane Smith)
- GlobalTech Enterprise Deal — $120,000 (Qualification, owned by Mike Chen)
- Stark Industries Renewal — $52,000 (Proposal, owned by Sarah Lee)
Done.Step 5: Refine the task description
After the first few runs, adjust the description based on what you see:
- Raise or lower the threshold
- Add fields like Close Date or Probability
- Filter out certain record types or stages
- Change the Slack channel per deal size
Cowork's task description is your prompt — the more specific you are, the better Claude performs.
When to use this approach
- You want alerts working today without writing or deploying any code
- A single daily digest is enough — you don't need real-time notifications
- You're evaluating thresholds before committing to a Flow or n8n workflow
- You want to combine alerting with light analysis (e.g., "flag any deal where close date is less than 30 days out")
When to switch approaches
- You need real-time alerts as soon as opportunities are created → use Salesforce Flow
- You need the workflow to run 24/7 reliably → use the Agent Skill with cron
- You want to build routing logic (different channels per deal size) without editing prompts → use n8n
Use a Record-Triggered Flow for instant alerts on truly massive deals ($100K+). Use Cowork for a daily $50K+ digest that gives leadership a full picture. The two approaches complement each other — Flow is instant, Cowork is flexible.
Need help implementing this?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.