πŸ”¬ 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

  1. Trigger β€” Webhook submission or watched Drive/S3 folder when new shipment docs are uploaded
  2. Register Shipment β€” Assigns shipment case ID, normalises metadata from payload
  3. Fetch Document Files β€” Downloads each document from Google Drive or URL
  4. Extract Text Content β€” Parses PDF/DOCX text from all documents
  5. Classify Document Types β€” Identifies invoice, packing list, bill of lading, COO, etc.
  6. Cross-Document Consistency Check β€” Detects mismatches across documents (values, weights, quantities)
  7. AI Compliance Validation β€” Claude AI validates each doc against destination country rules
  8. Aggregate Findings β€” Merges per-document results into a shipment-level report
  9. Route by Risk Level β€” Branches on CLEAR / HOLD / REJECT
  10. Notify Logistics Team β€” Slack alert with error summary and action items
  11. Email Exporter Report β€” Detailed validation report with fix instructions
  12. Update Shipment Tracker β€” Writes status back to Airtable / Google Sheets
  13. Create Compliance Ticket β€” Opens Jira issue for HOLD or REJECT shipments
  14. Return API Response β€” Structured JSON result to caller or TMS integration

Setup Steps

  1. Import workflow into n8n
  2. 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
  3. Set your Google Drive intake folder ID
  4. Configure destination country rules in the AI prompt node
  5. Set your Airtable base and shipment table IDs
  6. 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

AI Validation Checks

Features

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

πŸ“– Importing guide Β· πŸ”‘ Credential setup