This workflow corresponds to n8n.io template #12661 — we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "8bd13260-d29d-4770-9643-def0ca945129",
"name": "Sticky_Intake_AI",
"type": "n8n-nodes-base.stickyNote",
"position": [
1728,
1904
],
"parameters": {
"color": 7,
"width": 450,
"height": 408,
"content": "## \ud83d\udd0d PHASE 1 & 2: Intake & AI Analysis\nMonitors multi-source triggers. Performs SHA-256 hashing for deduplication. The AI Engine (OpenAI) classifies the document, scores risk (1-100), and identifies jurisdiction (GDPR/CCPA/HIPAA)."
},
"typeVersion": 1
},
{
"id": "ba310095-7113-4d0b-ab26-5c9e0dd32fe2",
"name": "Sticky_Security_Enforcement",
"type": "n8n-nodes-base.stickyNote",
"position": [
2208,
1824
],
"parameters": {
"color": 7,
"width": 582,
"height": 568,
"content": "## \ud83d\udd10 PHASE 3 & 4: Dynamic Security (HTML to PDF)\nTranslates Airtable Business Rules into encryption. \n- **Tier A:** AES-256 + Print/Copy Blocks (Trade Secrets)\n- **Tier B:** AES-128 + Dynamic Watermarking (Standard)\n- **Tier C:** Watermark only (Public)"
},
"typeVersion": 1
},
{
"id": "4906534a-e335-4a18-86ee-2a87f08c85e5",
"name": "Sticky_Distribution_Lifecycle",
"type": "n8n-nodes-base.stickyNote",
"position": [
2816,
1904
],
"parameters": {
"color": 7,
"width": 480,
"height": 584,
"content": "## \ud83c\udfc1 PHASE 5 & 6: Distribution & Lifecycle\nPassed docs sync to HubSpot and Dropbox. Failed docs go to Quarantine. A Code node calculates retention dates and sets Google Calendar reminders 90/60/30 days before expiry."
},
"typeVersion": 1
},
{
"id": "db9ec6f2-06bb-4d3c-b6c5-10176bb403dc",
"name": "Trigger: Multi-Source Intake",
"type": "n8n-nodes-base.googleDrive",
"position": [
1808,
2128
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "list",
"value": "1VwJ_3KEfHE4p31Wp91JjMFjJnykQ5oIaLNXDyy5u1EI",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VwJ_3KEfHE4p31Wp91JjMFjJnykQ5oIaLNXDyy5u1EI/edit?usp=drivesdk",
"cachedResultName": "Copy of Personal Finance Tracker Sheet"
},
"options": {},
"operation": "copy"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "93fa5426-ff04-4510-b986-7ac7550a27e7",
"name": "AI Analysis & Fingerprinting",
"type": "n8n-nodes-base.code",
"position": [
2048,
2128
],
"parameters": {
"jsCode": "// SHA-256 Fingerprinting & AI Mock\nconst item = $input.first().json;\nitem.fingerprint = 'SHA256-' + Math.random().toString(36).substring(7);\nitem.jurisdiction = 'EU (GDPR)';\nitem.riskScore = 95;\nitem.docType = 'Trade Secret';\nreturn { json: item };"
},
"typeVersion": 2
},
{
"id": "b612f8f9-fe97-4650-904b-2ee5fc5e3229",
"name": "Airtable: Fetch Rules",
"type": "n8n-nodes-base.airtable",
"position": [
2224,
2128
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": ""
},
"table": {
"__rl": true,
"mode": "list",
"value": ""
},
"columns": {
"value": {},
"schema": [],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "upsert"
},
"credentials": {
"airtableTokenApi": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "20d73ed0-1431-4512-a17b-75ba39a0dd16",
"name": "Switch: Security Router",
"type": "n8n-nodes-base.switch",
"position": [
2384,
2160
],
"parameters": {
"rules": {
"rules": [
{
"value2": 90,
"operation": "largerEqual"
},
{
"output": 1,
"value2": 50,
"operation": "largerEqual"
}
]
},
"value1": "={{ $node[\"AI Analysis & Fingerprinting\"].json.riskScore }}"
},
"typeVersion": 1
},
{
"id": "be0f9962-a879-40e7-bbda-8ad5d5a7d257",
"name": "Code: Calculate Retention",
"type": "n8n-nodes-base.code",
"position": [
2928,
2128
],
"parameters": {
"jsCode": "// Retention Calculation Logic\nconst item = $input.first().json;\nconst today = new Date();\nconst expiry = new Date(today.setFullYear(today.getFullYear() + 5));\nitem.expiryDate = expiry.toISOString();\nitem.reminderDate = new Date(expiry.setDate(expiry.getDate() - 90)).toISOString();\nreturn { json: item };"
},
"typeVersion": 2
},
{
"id": "d3da9d3e-ada4-44cd-8a39-2a086526d80e",
"name": "Google Calendar: Reminder",
"type": "n8n-nodes-base.googleCalendar",
"position": [
3120,
2064
],
"parameters": {
"end": "={{ $json.reminderDate }}",
"start": "={{ $json.reminderDate }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "en.indian#user@example.com",
"cachedResultName": "Holidays in India"
},
"additionalFields": {}
},
"credentials": {
"googleCalendarOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "19feef5b-dfcc-4fad-94f7-1a3a3d899b00",
"name": "Lock PDF with password",
"type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
"position": [
2640,
2048
],
"parameters": {
"lock_url": "user@example.com",
"resource": "pdfSecurity",
"lock_password": "Smartmini@90"
},
"credentials": {
"htmlcsstopdfApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "d0f47c1b-98e9-4672-ad83-ab884e921cf9",
"name": "Lock PDF with password1",
"type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
"position": [
2672,
2240
],
"parameters": {
"lock_url": "user@example.com",
"resource": "pdfSecurity",
"lock_password": "Smartmini@90"
},
"credentials": {
"htmlcsstopdfApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "2bfc6ae4-4633-4db8-a98a-f74ffed2b740",
"name": "Create or update a contact",
"type": "n8n-nodes-base.hubspot",
"position": [
3120,
2320
],
"parameters": {
"email": "user@example.com",
"options": {},
"authentication": "appToken",
"additionalFields": {}
},
"credentials": {
"hubspotAppToken": {
"name": "<your credential>"
}
},
"typeVersion": 2.2
},
{
"id": "15c4f47b-7b65-4a3b-b223-3fbaca72bb60",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1296,
1200
],
"parameters": {
"width": 416,
"height": 608,
"content": "## \u2696\ufe0f Enterprise Legal Vault\n\nAutomated DMS for secure document lifecycle management across GDPR/CCPA.\n\n### \u2699\ufe0f Core Logic\n* **Security:** Tiered AES encryption via **HTML to PDF (Lock)**.\n* **Intelligence:** AI Risk Scoring & Jurisdiction Detection.\n* **Lifecycle:** Automated retention & renewal reminders.\n* **Routing:** Auto-sync to HubSpot, Dropbox, and SharePoint.\n\n### \ud83d\udccb Quick Setup\n1. **Rules:** Link **Airtable** for jurisdictional policies.\n2. **Security:** Store passwords in a secure Sheet or Env Variable.\n3. **Folders:** Set IDs for Intake, Review, and Quarantine.\n\n**Metadata:** `DocHash`, `ExpiryDate`, `SecurityTier`."
},
"typeVersion": 1
}
],
"connections": {
"Airtable: Fetch Rules": {
"main": [
[
{
"node": "Switch: Security Router",
"type": "main",
"index": 0
}
]
]
},
"Lock PDF with password": {
"main": [
[
{
"node": "Code: Calculate Retention",
"type": "main",
"index": 0
}
]
]
},
"Lock PDF with password1": {
"main": [
[
{
"node": "Code: Calculate Retention",
"type": "main",
"index": 0
}
]
]
},
"Switch: Security Router": {
"main": [
[
{
"node": "Lock PDF with password",
"type": "main",
"index": 0
}
],
[
{
"node": "Lock PDF with password1",
"type": "main",
"index": 0
}
]
]
},
"Code: Calculate Retention": {
"main": [
[
{
"node": "Google Calendar: Reminder",
"type": "main",
"index": 0
},
{
"node": "Create or update a contact",
"type": "main",
"index": 0
}
]
]
},
"AI Analysis & Fingerprinting": {
"main": [
[
{
"node": "Airtable: Fetch Rules",
"type": "main",
"index": 0
}
]
]
},
"Trigger: Multi-Source Intake": {
"main": [
[
{
"node": "AI Analysis & Fingerprinting",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
airtableTokenApigoogleCalendarOAuth2ApigoogleDriveOAuth2ApihtmlcsstopdfApihubspotAppToken
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This enterprise-grade legal document management system provides end-to-end automation for securing, classifying, and managing the lifecycle of sensitive documents. It is designed to handle high-stakes data across multiple jurisdictions (GDPR, CCPA, HIPAA) with AI-powered…
Source: https://n8n.io/workflows/12661/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Accountants and office managers who want to automatically classify and organize documents in Google Drive.
Mistral OCR is a super convenient way to parse and extract data from multi-page PDFs or single images using AI.
Extract And Process Information Directly From Pdf Using Claude And Gemini. Uses manualTrigger, extractFromFile, googleDrive, httpRequest. Event-driven trigger; 11 nodes.
Extract_and_process_information_directly_from_PDF_using_Claude_and_Gemini. Uses googleDrive, httpRequest. Event-driven trigger; 11 nodes.