Check every closed-won deal's promises before handover to delivery
When a deal closes, this workflow reads the attached contract, proposal and order files, lists every promise made to the customer, flags gaps and conflicts, and marks the handover proceed, review or block.
Curated by Andrew Donato, Editor. Reviewed .
Get one setup like this every Thursday, by email.
Written for sales leaders running leaner teams.
Free. One email a week. Unsubscribe anytime.
Paste this into ChatGPT, Claude or your agent tool. See the prompt
- CS / Expansion
- advanced
- CS
- AE
- RevOps
- Category
- CS / Expansion
- Difficulty
- Advanced
- Est. cost
- Not stated by source; workflow hosting plus OpenAI usage for each document and each closed deal
Works with
What problem does this solve?
Promises made during the sale, such as deadlines, service levels and custom scope, live in PDFs and emails that the delivery team rarely reads before kickoff. Conflicting or missing commitments surface later as unhappy customers.
How is the agent set up?
WeblineIndia's n8n template polls Salesforce for updated opportunities and continues only when the stage is exactly Closed Won. It sets a handover status field to Processing, loads the opportunity's products, account and contact roles, then finds the files linked to the opportunity, downloads the latest versions, pulls the text out of PDFs and labels each file as contract, SOW, proposal, quote, email or other with keyword rules and a fixed authority weight. An OpenAI model reads each document with a published prompt and returns only commitments the document states outright, each with its owner, deadline and the source sentence. Code steps merge these into a commitment registry, mark incomplete items, flag possible conflicts where commitments in the same group carry different numbers or deadlines, and score risk with fixed thresholds. A second model pass reviews the registry, conflicts and evidence and recommends proceed, review or block, and a final rule set picks the outcome: block for critical risks or blocking issues, proceed only when the model says so and the calculated risk is low, review for everything else. The decision, risk level, timeline and next steps are written back to custom Salesforce fields. The author's notes are frank about the limits: scanned PDFs need OCR first, the exported risk prompt does not yet pass the evidence in and must be wired up, and no approval task or delivery hold is created.
What prompt does it use?
# Step 1: extract commitments (run once per document)
You are an AI contract commitment extraction engine.
Your job is to identify explicit contractual commitments from the supplied document.
DOCUMENT METADATA
Document Title: {{DOCUMENT_TITLE}}
Document Type: {{DOCUMENT_TYPE}}
DOCUMENT TEXT
--------------------
{{DOCUMENT_TEXT}}
--------------------
INSTRUCTIONS
1. Analyze ONLY the supplied document text.
2. Extract only commitments explicitly stated in the document.
3. Do not invent commitments.
4. Do not infer missing dates, responsibilities, quantities, or obligations.
5. If the document contains no explicit commitments, return an empty commitments array.
6. Identify the responsible party when explicitly stated.
7. Preserve important dates, percentages, deadlines, SLAs, quantities, and contractual obligations.
8. Do not treat general descriptive statements as commitments unless they create an obligation.
9. Return valid JSON only, with a commitments array where each item has commitment, category, responsible_party, deadline, details and source_text.
# Step 2: assess handover risk (run once per deal)
You are an enterprise sales-to-execution risk analyst.
Your job is to analyze a closed-won sales opportunity before it is handed over to the implementation and delivery team.
Analyze ONLY the information provided in the input: {{COMMITMENT_REGISTRY}}, {{CONFLICTS}}, {{RISK_REGISTER}}, {{CRM_EVIDENCE}} and {{DOCUMENT_EVIDENCE}}.
Do not invent or assume commitments, deadlines, owners, contractual obligations, customer requirements, delivery requirements, risks, conflicts or missing information.
For every material risk: identify the risk, explain why it matters, identify the affected commitment and the source evidence, determine severity (LOW, MEDIUM, HIGH or CRITICAL), say whether human review is required, and recommend an action.
The final recommendation must be one of PROCEED, REVIEW or BLOCK. Use BLOCK only for serious unresolved contractual, security, scope, delivery, or execution risks. Use REVIEW when human validation is required. Use PROCEED only when no material unresolved risk exists.
Return JSON only, with overall_assessment, overall_risk, recommendation, confidence, human_review_required, risks, key_findings, blocking_issues and review_items. Replace every {{PLACEHOLDER}} before running. Works with any capable LLM and runner.
Get 5 setups like this every week, free.
Real agent setups with prompts, sources and failure modes, in one short weekly email.
Free. One email a week. Unsubscribe anytime.
What tools does it use?
How do you set it up?
- Create or map the Salesforce custom fields for handover status, deal risk, decision timeline and next steps, and give the integration user read access to opportunity files.
- Import the template, connect Salesforce and OpenAI, and replace the Salesforce file-download hostname with your org's domain.
- When an opportunity moves to Closed Won, collect its products, account, contact roles and attached files, and extract text from the PDFs.
- Run the extraction prompt on each document to build one list of explicit commitments with owners, deadlines and source sentences.
- Score incomplete items and conflicting numbers or deadlines with fixed rules, then run the risk prompt to recommend proceed, review or block.
- Write the outcome back to Salesforce and review the first handovers with the delivery team before trusting the labels.
What results are reported?
No results are claimed; this is a published workflow template. Its notes describe the outcome as a proceed, review or block label with a risk summary, not a verified contract review.
What goes wrong
Where does this break?
- The exported risk prompt has no expression feeding it the evidence, so the second model pass needs wiring up before its assessment means anything (stated in the template notes).
- PDFs must contain selectable text; scanned contracts need OCR outside the workflow, and an opportunity with no linked files can end the run early.
- Updating an already-won opportunity, including the workflow's own status write, can start another handover, so add a retrigger guard before turning on polling.
- Review and block both currently write the same human-review value, and no approval task or delivery hold is created, so someone has to watch the field. (editor note)
- Document labels come from keywords, not legal review; treat the commitment list as a checklist for the kickoff, not as the contract of record. (editor note)
This is where most teams get stuck. Want us to handle the setup?
Source and credit
WeblineIndia, n8n workflow template · vendor
Source dated 2026-10-22 · last reviewed 2026-10-26. Summarized in our own words; see the source for details.