Send a Slack alert when a Salesforce deal changes stage using Claude Cowork
Prerequisites
- Claude Desktop with Cowork enabled
- Salesforce instance URL, username, and access token (or Connected App credentials)
- Slack workspace with a channel for deal alerts
- 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 Claude to do, and it uses its built-in tools to call the Salesforce REST API directly, check for stage changes, and post alerts to Slack. This is the fastest way to get deal stage alerts working with zero code.
Step 1: Get your Salesforce API credentials
You need a Salesforce access token for API calls. The simplest option for a single-user setup:
- In Salesforce, go to Setup → Apps → App Manager → New Connected App
- Enable OAuth with scopes
apiandrefresh_token - Use the OAuth flow or generate a session token from Setup → Security → Session Settings
Store your instance URL (e.g., https://yourorg.my.salesforce.com) and access token where Claude can access them — either as environment variables or directly in the task description.
Step 2: Create the Cowork task
Open Claude Desktop and go to the Cowork tab. Click + New task.
Fill in the task:
Title: Alert Slack when Salesforce deals change stage
Description:
You are a sales ops assistant. Your job is to check for Salesforce opportunity stage changes and post alerts to Slack.
Steps:
1. Query the Salesforce REST API for recently modified opportunities:
GET https://yourorg.my.salesforce.com/services/data/v59.0/query?q=SELECT+Id,Name,Amount,StageName,LastModifiedDate+FROM+Opportunity+WHERE+LastModifiedDate>LAST_N_HOURS:1+AND+StageName!=null
Auth: Bearer YOUR_ACCESS_TOKEN
2. For each opportunity returned, post a Slack message to #sales-pipeline:
POST https://slack.com/api/chat.postMessage
Auth: Bearer YOUR_SLACK_BOT_TOKEN
Body: {"channel": "C0123456789", "text": "Deal updated", "blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "🔄 *Deal Stage Changed*\n*DEAL_NAME* is in *STAGE_NAME*\nAmount: $AMOUNT"}}]}
3. Print a summary of how many alerts were sent.
Important: Only alert on opportunities that were modified in the last hour to avoid duplicate alerts.Replace yourorg, YOUR_ACCESS_TOKEN, YOUR_SLACK_BOT_TOKEN, and the channel ID with your real values.
Instead of putting credentials in the task description, store them as shell environment variables (SALESFORCE_ACCESS_TOKEN, SLACK_BOT_TOKEN) and reference them in your description as "use the value from the SALESFORCE_ACCESS_TOKEN environment variable." Claude can read env vars when running bash commands.
Step 3: Set the schedule
Frequency: Every hour (or every 30 minutes for fast-moving pipelines)
Cowork will execute the task on this cadence and show you the output each time.
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
Before trusting the schedule, click Run now in Cowork to test it. Claude will:
- Call the Salesforce REST API with the SOQL query
- Parse the returned opportunities
- Post a Slack message for each one
- Print a run summary
A successful run looks like:
Queried Salesforce: 3 opportunities modified in the last hour.
Acme Corp — Enterprise License → Negotiation/Review ($125,000) ✓
GlobalTech — Platform Deal → Closed Won ($89,000) ✓
Startup Inc — Starter Plan → Discovery ($12,000) ✓
Done. Posted 3 alerts to #sales-pipeline.Step 5: Refine the task description
After the first few runs, review the alerts. If they're too noisy, add filters to the task description:
"Only alert on opportunities where StageName is one of: Negotiation/Review, Closed Won, Closed Lost. Skip all other stage changes."
"Include the Account name and Opportunity owner in each alert."
Cowork's task description is your prompt — the more specific you are, the better Claude performs.
When to use this approach
- You want stage alerts working today without writing or deploying any code
- Your pipeline has fewer than 100 stage changes per day and hourly batching is acceptable
- You're testing which alerts matter before building a permanent Flow or n8n workflow
- You want natural-language control over filtering and formatting
When to switch approaches
- You need alerts to fire instantly when a stage changes → use Salesforce Record-Triggered Flows
- You need 24/7 reliability without keeping a laptop open → use the Agent Skill with cron
- You want visual workflow editing and easy maintenance → use n8n
Use Salesforce Flows for high-priority transitions (Closed Won, Closed Lost) that need instant alerts. Use Cowork for a broader hourly digest of all stage movements. The two approaches complement each other — Flows are 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.