Contract Scraper → CRM + Upsell Signal Engine (L4)
Self-hosted n8n workflow extracts line items from every closed-won PDF (OCR + image + text into Opus), runs a deterministic JS auditor, escalates only low-confidence cases to a human, then writes structured plan data to Salesforce. ~45 min saved per renewal. Built by Egan at Sendoso, shown on the GTM AI Podcast.
The steps
- 01
Ingest PDFs three ways for the model
Tool: Self-hosted service
For every closed-won contract: extract raw text + run OCR + render to PNG. Send all three to the model. Opus reads the image, the text, the OCR, accuracy goes up dramatically vs any single input.
- 02
Use a deterministic JS auditor, not just AI
Tool: n8n + JavaScript
Hard rules catch hallucinations cheaply. Example: if licenses = unlimited then seat_count must be null. If contract_value ≠ sum(line_items), flag. Anti-pattern called out in episode: stuffing PDFs into an agent and hoping.
- 03
Loop low-confidence cases back through with context
Tool: n8n
When the auditor finds a mismatch, push the error message + scraped data back to the agent: "X doesn't reconcile with Y, re-evaluate." Only if it still fails does it route to a human.
- 04
Human-in-loop only on the residual
Tool: Slack notification
Last audit before Salesforce write happens with a human, but only on the ~5% the auditor couldn't resolve. Push validated structured data into Salesforce custom fields.
- 05
Layer upsell signals on top
Tool: Salesforce + agent
Once contract terms are structured, an agent watches calls + product usage. "Mentioned HRIS hub on the call 2 weeks ago, not in their plan" → tee up for AM. This is where NRR moves.
Tools in this playbook
- Self-hosted service
- n8n + JavaScript
- n8n
- Slack notification
- Salesforce + agent
Next playbooks
Unfamiliar terms are defined in the AI and Revenue Dictionary. Related frameworks live in the framework library.
