Alert Slack on large Salesforce opportunities using n8n
low complexityCost: $0-24/moRecommended
Prerequisites
Prerequisites
- n8n instance (cloud or self-hosted)
- Salesforce Connected App with OAuth credentials (Consumer Key + Secret)
- Slack app with Bot Token (
chat:writescope)
Step 1: Create a Salesforce Connected App
In Salesforce Setup, navigate to App Manager and click New Connected App:
- Enable OAuth Settings: checked
- Callback URL: your n8n OAuth callback URL (e.g.,
https://your-n8n.app.n8n.cloud/rest/oauth2-credential/callback) - OAuth Scopes:
Full access (full)or at minimumapiandrefresh_token
Save and copy the Consumer Key and Consumer Secret.
Step 2: Add Salesforce Trigger
Add a Salesforce Trigger node:
- Credential: Create a new Salesforce OAuth2 credential using the Connected App keys
- Event: Opportunity Created
This polls Salesforce for new Opportunities on your configured interval.
Step 3: Filter by amount
Add an IF node:
- Condition:
{{ $json.Amount }}greater than50000
Only opportunities over $50K proceed to the next step.
Configurable threshold
Store the threshold in workflow static data so you can change it without editing the IF node: $getWorkflowStaticData('global').dealThreshold || 50000.
Step 4: Fetch Account details
Add a Salesforce node to get the Account name:
- Operation: Get
- Object: Account
- Record ID:
{{ $('Salesforce Trigger').first().json.AccountId }}
Step 5: Send Slack alert
Add a Slack node:
- Channel:
#executive-dealsor#sales-leadership - Message Type: Block Kit
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":dart: *New Large Opportunity Created*\n*{{ $('Salesforce Trigger').first().json.Name }}*\nAmount: *${{ parseFloat($('Salesforce Trigger').first().json.Amount).toLocaleString() }}*\nStage: {{ $('Salesforce Trigger').first().json.StageName }}\nOwner: {{ $('Salesforce Trigger').first().json.Owner.Name }}\nAccount: {{ $('Get Account').first().json.Name }}"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "<https://your-org.lightning.force.com/lightning/r/Opportunity/{{ $('Salesforce Trigger').first().json.Id }}/view|View in Salesforce>"
}
]
}
]
}Replace your-org with your Salesforce domain.
Step 6: Activate
- Test by creating an Opportunity over $50K in Salesforce
- Verify the Slack alert appears with correct deal details
- Toggle the workflow to Active
Cost
- n8n Cloud: Each trigger poll counts as 1 execution. Deals under $50K stop at the IF node but still count as 1 execution.
- Self-hosted: Free, unlimited executions.
Need help implementing this?
We build and optimize automation systems for mid-market businesses. Let's discuss the right approach for your team.