π¬ Validate customs clearance documents with Claude AI, Google Drive and Slack
β‘ 67 views Β· π¬ Document Extraction & Analysis
Description
This workflow automates pre-dispatch customs document validation for international shipments. It ingests shipping document packages, extracts content from each file, uses Claude AI to cross-validate all documents for consistency, regulatory compliance, and HS code accuracy, then flags errors before goods are dispatched β preventing costly delays, fines, and rejected shipments at the border.
How it works
- Trigger β Webhook submission or watched Drive/S3 folder when new shipment docs are uploaded
- Register Shipment β Assigns shipment case ID, normalises metadata from payload
- Fetch Document Files β Downloads each document from Google Drive or URL
- Extract Text Content β Parses PDF/DOCX text from all documents
- Classify Document Types β Identifies invoice, packing list, bill of lading, COO, etc.
- Cross-Document Consistency Check β Detects mismatches across documents (values, weights, quantities)
- AI Compliance Validation β Claude AI validates each doc against destination country rules
- Aggregate Findings β Merges per-document results into a shipment-level report
- Route by Risk Level β Branches on CLEAR / HOLD / REJECT
- Notify Logistics Team β Slack alert with error summary and action items
- Email Exporter Report β Detailed validation report with fix instructions
- Update Shipment Tracker β Writes status back to Airtable / Google Sheets
- Create Compliance Ticket β Opens Jira issue for HOLD or REJECT shipments
- Return API Response β Structured JSON result to caller or TMS integration
Setup Steps
- Import workflow into n8n
- Configure credentials:
- Anthropic API β Claude AI for compliance validation
- Google Drive OAuth β Document intake and storage
- Google Sheets OAuth β Shipment compliance audit log
- Airtable β Shipment tracker CRM
- Slack OAuth β Logistics team alerts
- SendGrid / SMTP β Exporter notification emails
- Jira API β Compliance issue tracking
- Set your Google Drive intake folder ID
- Configure destination country rules in the AI prompt node
- Set your Airtable base and shipment table IDs
- Activate the workflow
Sample Webhook Payload
{
"shipmentId": "SHP-2025-00392",
"exporterEmail": "logistics@exportco.com",
"originCountry": "CN",
"destinationCountry": "AU",
"incoterms": "FOB",
"declaredValue": 48500,
"currency": "USD",
"goodsDescription": "Electronic Components",
"documents": [
{ "name": "Commercial Invoice", "type": "commercial_invoice", "driveFileId": "1aBcD" },
{ "name": "Packing List", "type": "packing_list", "driveFileId": "2eFgH" },
{ "name": "Bill of Lading", "type": "bill_of_lading", "driveFileId": "3iJkL" },
{ "name": "Certificate of Origin", "type": "certificate_of_origin", "driveFileId": "4mNoP" }
]
}
Documents Supported
- Commercial Invoice
- Packing List
- Bill of Lading (B/L) / Airway Bill (AWB)
- Certificate of Origin (COO / Form D / EUR.1)
- Customs Entry / Import Declaration
- Dangerous Goods Declaration (DGD)
- Phytosanitary / Health Certificate
- Insurance Certificate
- Letter of Credit (L/C)
- Export Licence / Permit
- Material Safety Data Sheet (MSDS)
- Fumigation Certificate
AI Validation Checks
- Field Completeness β All mandatory fields present and populated
- Cross-Document Consistency β Values, weights, quantities, HS codes match across docs
- HS Code Validation β Correct classification for declared goods and destination
- Incoterms Compliance β Terms correctly applied across invoice and B/L
- Valuation Rules β Customs value method correct, currency declared
- Country of Origin β COO criteria met, preferential rates applicable
- Restricted / Prohibited Goods β Flags potential dual-use, CITES, or embargoed items
- Sanction Screening β Party names checked against common red flags
- Date & Validity β Document dates consistent, certificates not expired
Features
- Multi-document cross-validation in a single run
- AI-powered HS code verification and suggestion
- Destination-countryβspecific compliance rules
- Automatic HOLD/REJECT routing for high-risk findings
- Detailed error report with fix instructions per field
- Full audit trail in Google Sheets
- Jira ticket creation for escalated compliance issues
Explore More Automation:
Contact us to design AI-powered lead nurturing, content engagement, and multi-platform reply workflows tailored to your growth strategy.
π Nodes Used
Send Email, Google Sheets, HTTP Request, Webhook, Google Drive, Google Drive Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File