Overview: This production-grade architecture replaces an 8-tool Western SaaS stack (HeyReach, Instantly, Claude Team, Apify, BlogSEO, Wispr, Loom) costing $550+/month with a unified open-weight and private cloud engine costing under $90/month.
| Component | Legacy Western SaaS Stack | ShanghAI Open-Stack Architecture | Monthly Cost |
|---|---|---|---|
| Orchestration | Zapier / Make Pro ($50+/mo) | Self-Hosted n8n / Dify (Hetzner VPS) | $10/mo |
| Intelligence Layer | Claude 3.5 Sonnet + ChatGPT ($160/mo) | Serverless DeepSeek-V3 / Qwen-2.5-72B | $5/mo (API usage) |
| Scraping & Signal Extraction | Apify ($49/mo) | Containerized Playwright + Residential Proxy Pool | $25/mo |
| Outbound Inboxes & Routing | HeyReach + Instantly ($196/mo) | 3 Custom Domains + 6 Google/MS Inboxes (Warmup Pool) | $50/mo |
| SEO & GEO Tracking | BlogSEO / GSC Integrations ($98/mo) | Python Cron + GLM-4-Air / DeepSeek to Git CMS | $0/mo (included in VPS) |
| Total Monthly Spend | $553+/month | The ShanghAI Blueprint | ~$90/month |
workflow.json)JSON
{
"name": "ShanghAI Zero-SaaS Lead Enricher & Classifier",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "lead-webhook",
"options": {}
},
"name": "1. Ingest Lead Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [250, 300]
},
{
"parameters": {
"method": "POST",
"url": "<http://playwright-service:3000/scrape>",
"bodyParametersUi": {
"parameter": [
{
"name": "target_url",
"value": "={{ $json.body.profile_url }}"
},
{
"name": "proxy",
"value": "<http://res-proxy.provider.com:8080>"
}
]
}
},
"name": "2. Playwright Headless Scrape",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [480, 300]
},
{
"parameters": {
"model": "deepseek-chat",
"messages": {
"values": [
{
"role": "system",
"content": "You are an elite B2B sales intelligence engine. Extract the ICP fit, main technical pain points, and current company tech stack. Always output strict JSON matching the schema."
},
{
"role": "user",
"content": "Analyze this scraped payload:\n{{ $json.body.clean_text }}"
}
]
},
"options": {
"temperature": 0.1,
"response_format": {
"type": "json_object"
}
}
},
"name": "3. DeepSeek-V3 Extraction & Scoring",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1.3,
"position": [720, 300],
"credentials": {
"openAiApi": {
"id": "deepseek-serverless-creds",
"name": "DeepSeek API / OpenAI-Compatible Endpoint"
}
}
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.body.icp_score }}",
"operation": "largerEqual",
"value2": 80
}
]
}
},
"name": "4. Intent Threshold Gate (Score >= 80)",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [950, 300]
},
{
"parameters": {
"operation": "send",
"toEmail": "={{ $('1. Ingest Lead Webhook').item.json.body.email }}",
"subject": "={{ $json.body.custom_subject }}",
"text": "={{ $json.body.personalized_body }}"
},
"name": "5. Dispatch via Dedicated Inbox Pool",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2,
"position": [1200, 200]
}
],
"connections": {
"1. Ingest Lead Webhook": {
"main": [[{ "node": "2. Playwright Headless Scrape", "type": "main", "index": 0 }]]
},
"2. Playwright Headless Scrape": {
"main": [[{ "node": "3. DeepSeek-V3 Extraction & Scoring", "type": "main", "index": 0 }]]
},
"3. DeepSeek-V3 Extraction & Scoring": {
"main": [[{ "node": "4. Intent Threshold Gate (Score >= 80)", "type": "main", "index": 0 }]]
},
"4. Intent Threshold Gate (Score >= 80)": {
"main": [
[{ "node": "5. Dispatch via Dedicated Inbox Pool", "type": "main", "index": 0 }]
]
}
}
}
Plaintext
<system_instruction>
You are an autonomous B2B growth engineer evaluating inbound and scraped prospect data.
Analyze the raw profile payload and output structured JSON only.
Rules:
1. Extract job title, exact company domain, and primary tech stack mentioned.
2. Evaluate ICP Fit score from 0 to 100 based on whether they manage software, data pipelines, or marketing infrastructure.
3. Identify 1 specific operational friction point (e.g., SaaS subscription bloat, data compliance, API rate limits).
4. If ICP Fit is >= 80, write a 2-sentence conversational cold opening mentioning their specific pain point.
Output Schema:
{
"full_name": "string",
"company": "string",
"icp_score": number,
"detected_pain_point": "string",
"custom_subject": "string",
"personalized_body": "string",
"qualifies_for_outreach": boolean
}
</system_instruction>
Plaintext
<system_instruction>
You are an inbound email routing engine. Classify the prospect's reply into one of four intent buckets:
- "POSITIVE_DEMO" (wants to book a call or learn more)
- "TECHNICAL_OBJECTION" (asking questions about security, hosting, pricing, or compliance)
- "OUT_OF_OFFICE" (auto-responder)
- "NEGATIVE_UNSUBSCRIBE" (not interested, remove from list)
Rules:
- If POSITIVE_DEMO: Generate instant calendar booking link payload.
- If TECHNICAL_OBJECTION: Draft a concise, technical 3-line reply addressing their specific objection without being salesy.
- If NEGATIVE_UNSUBSCRIBE: Flag status for immediate suppression list sync.
Output format must be valid JSON matching:
{
"category": "POSITIVE_DEMO" | "TECHNICAL_OBJECTION" | "OUT_OF_OFFICE" | "NEGATIVE_UNSUBSCRIBE",
"suggested_action": "push_to_crm" | "trigger_dynamic_reply" | "delay_follow_up" | "blacklist",
"draft_reply": "string | null"
}
</system_instruction>
Run this minimal container on your VPS to execute scraping tasks through your residential proxy pool without getting blocked:
JavaScript
// server.js (Node.js + Playwright)
const express = require('express');
const { chromium } = require('playwright');
const app = express();
app.use(express.json());
app.post('/scrape', async (req, res) => {
const { target_url, proxy } = req.body;
const browser = await chromium.launch({
headless: true,
proxy: proxy ? { server: proxy } : undefined
});
try {
const context = await browser.newContext({
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
});
const page = await context.newPage();
await page.goto(target_url, { waitUntil: 'domcontentloaded', timeout: 30000 });
// Extract main readable content and strip HTML noise
const clean_text = await page.evaluate(() => {
const elements = document.querySelectorAll('script, style, nav, footer, header');
elements.forEach(el => el.remove());
return document.body.innerText.replace(/\s+/g, ' ').trim();
});
await browser.close();
res.json({ status: 'success', clean_text });
} catch (error) {
await browser.close();
res.status(500).json({ status: 'error', message: error.message });
}
});
app.listen(3000, () => console.log('Scraper service live on port 3000'));
get[brand].com, [brand]engine.com).