Salesforce + Slack contract intake with risk alerts
Contract intake breaks in the same boring ways. Someone forwards a PDF, it gets saved “somewhere,” a few key dates live in a calendar invite, and the next renewal sneaks up anyway.
This Salesforce Slack intake setup hits sales ops first, because pipeline hygiene depends on it. But legal ops and procurement feel the chaos too. The outcome is simple: clean contract records in Salesforce, fast risk alerts in Slack, and fewer missed renewals.
Below, you’ll see how the workflow captures contract fields, scores risk, prevents duplicates, and posts the right alerts so review happens before a deal goes sideways.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Salesforce + Slack contract intake with risk alerts
flowchart LR
subgraph sg0["Drive File Intake Flow"]
direction LR
n0@{ icon: "mdi:message-outline", form: "rounded", label: "Email Contract Intake", pos: "b", h: 48 }
n1@{ icon: "mdi:play-circle", form: "rounded", label: "Drive File Intake", pos: "b", h: 48 }
n2@{ icon: "mdi:play-circle", form: "rounded", label: "Hourly CRM Poll", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/salesforce.svg' width='40' height='40' /></div><br/>Fetch Salesforce Deals"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Combine Intake Streams"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/postgres.svg' width='40' height='40' /></div><br/>Detect Duplicate Record"]
n6@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Is Contract New", pos: "b", h: 48 }
n7@{ icon: "mdi:cog", form: "rounded", label: "AI Extract Contract Fields", pos: "b", h: 48 }
n8@{ icon: "mdi:cog", form: "rounded", label: "AI Contract Risk Review", pos: "b", h: 48 }
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/postgres.svg' width='40' height='40' /></div><br/>Retrieve Template Clauses"]
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Score Contract Logic"]
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/postgres.svg' width='40' height='40' /></div><br/>Store Contract Record"]
n12@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Require Legal Review", pos: "b", h: 48 }
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/slack.svg' width='40' height='40' /></div><br/>Alert Legal Channel"]
n14["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/salesforce.svg' width='40' height='40' /></div><br/>Update CRM Opportunity"]
n6 --> n7
n5 --> n6
n3 --> n4
n2 --> n3
n12 --> n13
n1 --> n4
n9 --> n10
n4 --> n5
n0 --> n4
n10 --> n11
n8 --> n10
n11 --> n12
n11 --> n14
n7 --> n8
n7 --> n9
end
subgraph sg1["Daily Deadline Flow"]
direction LR
n15@{ icon: "mdi:play-circle", form: "rounded", label: "Daily Deadline Trigger", pos: "b", h: 48 }
n16["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/postgres.svg' width='40' height='40' /></div><br/>Fetch Upcoming Alerts"]
n17["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/slack.svg' width='40' height='40' /></div><br/>Post Daily Summary"]
n15 --> n16
n16 --> n17
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n1,n2,n15 trigger
class n6,n12 decision
class n5,n9,n11,n16 database
class n10 code
classDef customIcon fill:none,stroke:none
class n3,n4,n5,n9,n10,n11,n13,n14,n16,n17 customIcon
The Problem: Contract Intake Is Scattered and Easy to Miss
When contracts arrive through three different channels (email attachments, a shared drive folder, and “it’s in Salesforce notes somewhere”), nothing stays consistent. The same agreement gets uploaded twice, the term dates are copied wrong, and the “final” PDF is actually a redline. Meanwhile, stakeholders want an answer now: Is this risky? Does it match our approved language? What’s the renewal date? Without a single intake path, you end up running a manual mini-project for every contract, and that mental load is honestly what slows teams down the most.
It adds up fast. Here’s where it breaks down in real life.
- Key fields like effective date, termination terms, and renewal notice periods are retyped from PDFs, which means errors are inevitable.
- Duplicates creep in because “contract intake” is really five separate inboxes and folders.
- Risk review happens too late, after the opportunity is already marked “Commit” in Salesforce.
- Renewal tracking becomes a spreadsheet side quest, so missed reminders turn into churn or surprise auto-renewals.
The Solution: AI Contract Intake That Syncs to Salesforce and Alerts in Slack
This workflow centralizes contract intake across the places contracts actually show up: your email inbox, a Google Drive folder, and your CRM pipeline. When a new contract or amendment appears, n8n pulls the file, checks your database to avoid duplicates, then uses AI-powered PDF extraction to capture the important fields (the stuff people normally skim for). Next, it performs a structured risk review, compares key clauses against your approved templates, and applies a risk score using your own logic. Finally, it stores one clean contract record in Postgres, syncs the right details back into Salesforce, and posts a Slack alert when legal review is required. No chasing. No “did anyone see this PDF?”
The workflow starts with intake triggers (IMAP email, Google Drive, and a scheduled Salesforce poll). From there, it merges those streams, extracts and scores the contract, then routes alerts to Slack and updates the opportunity in Salesforce. A daily scheduled check posts upcoming deadlines so renewals do not quietly expire.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you process 10 contracts a week. Manually, it’s easy to spend about 30 minutes pulling the PDF from email or Drive, another 45 minutes copying key dates and terms into Salesforce, plus 15 minutes posting context to Slack and chasing approvals, so roughly 1.5 to 2 hours each. With this workflow, intake is basically instant, extraction and scoring runs in the background, and legal only gets pinged when the risk score requires it. You still review the contract, but you stop doing the same setup work 10 times a week.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Salesforce for opportunity/account contract sync
- Slack to alert legal and stakeholders fast
- Postgres database (create tables for contracts, clauses, alerts)
- Email inbox (IMAP) to capture contract attachments
- Google Drive for shared-folder contract intake
- PDF Vector community node (install from n8n community nodes)
Skill level: Intermediate. You’ll connect accounts, set environment variables, and map a few fields to match your Salesforce schema.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A contract arrives through email, Drive, or Salesforce. IMAP watches an inbox for attachments, Google Drive watches a folder, and Salesforce gets polled on a schedule so new deals don’t fall through the cracks.
All intake streams get combined and deduped. n8n merges the different sources into one path, then checks Postgres to see if the contract already exists (same file, same identifier, or matching metadata), so you don’t create a mess upstream.
AI extracts contract fields and performs risk review. The PDF is read and analyzed to pull key terms and dates, then the workflow retrieves approved template clauses from Postgres and runs scoring logic to flag deviations and risk factors.
Records and alerts go where teams already work. A clean contract record is stored in Postgres, the Salesforce opportunity is updated with the fields your pipeline depends on, and Slack receives an alert if the contract crosses your “needs legal review” threshold. A daily scheduled run also posts upcoming deadlines so renewals stay visible.
You can easily modify the risk thresholds to change when Slack alerts fire based on contract type, value, or region. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Trigger Type
Set up the three intake triggers that start the workflow: email, Google Drive, and scheduled CRM polling.
- Open Email Contract Intake and set Mailbox to
INBOX. - In Email Contract Intake, set Custom Email Config to
[YOUR_EMAIL]and keep the polling set to every minute. - Open Drive File Intake and set Folder ID to
[YOUR_ID]. - In Drive File Intake, keep Events set to
file:createdandfile:updated. - Open Hourly CRM Poll and set Unit to
hourswith Value1. - Open Daily Deadline Trigger and set Unit to
dayswith Value1.
Step 2: Connect Salesforce and Intake Merging
Configure Salesforce retrieval and merge all inbound sources into a single stream.
- Open Fetch Salesforce Deals and set Resource to
opportunityand Operation togetAll. - Set the Filters in Fetch Salesforce Deals to
stage: Contract ReviewandlastModified: {{$now.minus({hours: 1}).toISO()}}. - Open Combine Intake Streams and set Mode to
multiplex. - Confirm Drive File Intake, Email Contract Intake, and Fetch Salesforce Deals all connect into Combine Intake Streams.
Step 3: Prevent Duplicates and Route New Contracts
Check for duplicate contract hashes and route only new contracts for AI extraction.
- Open Detect Duplicate Record and confirm Query is set to
SELECT contract_id FROM contracts WHERE hash = '{{ $json.fileHash }}' LIMIT 1. - Open Is Contract New and confirm the condition checks Value 1 as
{{$json.contract_id}}with OperationisEmpty. - Ensure the execution flow matches: Combine Intake Streams → Detect Duplicate Record → Is Contract New → AI Extract Contract Fields.
Step 4: Set Up AI Extraction and Risk Analysis
Extract structured contract fields, perform AI risk analysis, and fetch template clauses in parallel.
- Open AI Extract Contract Fields and keep Operation set to
extract, Input Type tofile, and Binary Property Name todata. - Verify the Prompt and Schema fields in AI Extract Contract Fields match the provided extraction logic.
- Open AI Contract Risk Review and keep Operation set to
ask, Input Type tofile, and Binary Property Name todata. - Open Retrieve Template Clauses and set Query to
SELECT template_id, clauses FROM contract_templates WHERE contract_type = '{{ $json.contractType }}' AND active = true. - Confirm parallel execution: AI Extract Contract Fields outputs to both AI Contract Risk Review and Retrieve Template Clauses in parallel.
Step 5: Score and Store Contract Records
Combine AI outputs and CRM data, compute risk, and store the resulting contract record.
- Open Score Contract Logic and keep the full JavaScript Code block as provided (it references AI Extract Contract Fields, AI Contract Risk Review, Retrieve Template Clauses, and Fetch Salesforce Deals).
- Open Store Contract Record and set Table to
contracts. - Set Columns in Store Contract Record to
contract_id,type,parties,value,effective_date,expiration_date,risk_score,risk_level,approval_level,extracted_data,risk_analysis,alerts,crm_data,created_at,status. - Set Values in Store Contract Record to
={{ $json.contractAnalysis.contractId }},={{ $json.contractAnalysis.type }},={{ JSON.stringify($json.contractAnalysis.parties) }},={{ $json.contractAnalysis.value }},={{ $json.contractAnalysis.effectiveDate }},={{ $json.contractAnalysis.expirationDate }},={{ $json.riskAssessment.overallScore }},={{ $json.riskAssessment.riskLevel }},={{ $json.approvalRouting.level }},={{ JSON.stringify($json.fullExtraction) }},={{ JSON.stringify($json.riskAssessment) }},={{ JSON.stringify($json.alerts) }},={{ JSON.stringify($json.crmAlignment) }},={{ $now.toISO() }},pending_approval.
Step 6: Configure Review Routing and CRM Updates
Route high-risk contracts to legal and update CRM opportunities in parallel.
- Open Require Legal Review and set conditions to check
{{$json.riskAssessment.riskLevel}}equalsHighOR{{$json.riskAssessment.missingClauses.length > 0}}is true, with Combine Operation set toany. - Open Alert Legal Channel and set Channel to
[YOUR_ID]and keep the alert message text as provided. - Open Update CRM Opportunity and set Opportunity ID to
{{$json.crmAlignment.opportunityId}}. - In Update CRM Opportunity, set custom fields:
Contract_ID__cto{{$json.contractAnalysis.contractId}},Contract_Status__ctoUnder Review,Contract_Expiration__cto{{$json.contractAnalysis.expirationDate}}, andContract_Risk_Score__cto{{$json.riskAssessment.overallScore}}. - Confirm parallel execution: Store Contract Record outputs to both Require Legal Review and Update CRM Opportunity in parallel.
Step 7: Configure Daily Alert Summary
Pull upcoming deadlines and post a daily summary into Slack.
- Open Fetch Upcoming Alerts and confirm Query is set to
SELECT c.*, json_array_elements(c.alerts) as alert FROM contracts c WHERE c.status = 'active' AND (alert->>'date')::date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL '30 days'. - Open Post Daily Summary and keep Text set to
=📅 Daily Contract Alert Summary\n\nYou have {{ $items.length }} upcoming contract deadlines:\n\n{{ $items.map(item => `• ${item.json.alert.type}: ${item.json.alert.description || item.json.contract_id} - Due ${item.json.alert.date} (${item.json.alert.daysRemaining} days)`).join('\n') }}. - Set Channel in Post Daily Summary to
[YOUR_ID]and keep Authentication asoAuth2.
Step 8: Test and Activate Your Workflow
Run end-to-end tests for each intake path and confirm outputs before activating.
- Use Execute Workflow to test: drop a PDF into the Drive File Intake folder and confirm it flows through Combine Intake Streams, Detect Duplicate Record, and AI Extract Contract Fields.
- Trigger Email Contract Intake by sending a contract email and confirm it joins the same pipeline.
- Verify successful execution by checking: a new row in the contracts table from Store Contract Record, Slack alerts from Alert Legal Channel when risk is high, and CRM updates from Update CRM Opportunity.
- Manually run Daily Deadline Trigger to confirm Post Daily Summary posts a Slack summary.
- Once validated, toggle the workflow to Active for production use.
Common Gotchas
- Salesforce credentials can expire or need specific permissions. If things break, check your connected app access and user permission sets in Salesforce setup first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 60 minutes if your accounts and database are ready.
No. You’ll mostly connect tools and map fields. You may tweak a small scoring script if you want custom risk logic.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in AI extraction costs from your PDF/LLM provider.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but plan the field mapping first. You can keep the same intake and extraction nodes, then change the “Update CRM Opportunity” mapping to write into your vendor object (or a dedicated custom object) in Salesforce. Common customizations include a different risk matrix for data processing terms, a new Slack channel for procurement, and separate deadline rules for auto-renewing vendor agreements.
Usually it’s expired OAuth or a user permission issue. Reconnect Salesforce in n8n, then confirm the integration user can read opportunities and write to the specific fields you’re updating. If it only fails on certain records, check validation rules or required fields on that object. Rate limits can also bite if you poll too aggressively.
A lot, and the real limit is your infrastructure. On n8n Cloud, your monthly execution cap depends on your plan. If you self-host, there’s no hard execution limit, but you’ll want a decent VPS and a database that’s indexed well. AI PDF extraction is the usual bottleneck, so teams often batch low-priority contracts during off-hours.
Often, yes. This workflow isn’t just “send a file from A to B”; it merges multiple intake sources, dedupes records, runs AI extraction, applies risk logic, then conditionally routes alerts and updates Salesforce. n8n is well suited for that kind of branching without turning your automation into a pile of separate Zaps or scenarios. Zapier or Make can still work if you keep it very simple, like one intake channel and a basic Slack message. If you’re unsure, Talk to an automation expert and get a second opinion.
Once this is running, contract intake stops being a daily fire drill. The workflow handles the repetitive cleanup and routing so your team can focus on decisions, not copy-paste.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.