# Proof of Delivery AI Verification

**Category:** Logistics  
**Tools:** Google Drive, OpenAI, Google Sheets  
**Nodes:** 13  
**Built by:** Forgent Systems

Drivers send a delivery photo on WhatsApp. AI vision checks it for a signature, package and readability, then saves it to Drive, logs it in a sheet and confirms, or asks for a clearer photo.

![Workflow](preview.webp)

## How it works

1. A WhatsApp image arrives through the webhook.
2. The image is downloaded and analyzed by AI vision.
3. The POD is checked for required conditions.
4. Valid PODs are stored in Drive and logged, and a confirmation is sent.
5. Unclear images trigger a request for a new photo.

## Use cases

- Last-mile delivery fleets
- Courier companies
- B2B distribution

## Data setup

**Google Sheets** (tab: columns)

- **POD Tracking → Sheet1**: `phone`, `customer_name`, `invoice_number`, `invoice_date`, `signature_present`, `stamp_present`, `is_valid_pod`, `status`, `pod_image_url`, `created_at`

## Setup

1. In n8n open **Workflows → Import from File** and choose `workflow.json`.
2. Connect these credentials:
   - Google Drive account
   - Google Sheets account
   - Http Basic Auth account
   - OpenAI account
   - Twilio account
3. Point the Sheets / Airtable / Drive / Slack nodes at your own resources (structure above).
4. Replace placeholder emails, phone numbers and `YOUR-FORM-ID` links with your own.
5. Times use the America/New_York timezone and dates use MM/DD/YYYY. Adjust if needed.
6. Run a test execution, then activate.

## Nodes

- **Download POD Image** — `n8n-nodes-base.httpRequest`
- **Analyze POD Image** — `@n8n/n8n-nodes-langchain.agent`
- **GPT-4 Vision Model** — `@n8n/n8n-nodes-langchain.lmChatOpenAi`
- **POD Data Parser** — `@n8n/n8n-nodes-langchain.outputParserStructured`
- **Save POD to Google Drive** — `n8n-nodes-base.googleDrive`
- **Merge POD Data** — `n8n-nodes-base.merge`
- **Validate POD Conditions** — `n8n-nodes-base.if`
- **Send message to Request Clear POD** — `n8n-nodes-base.twilio`
- **Send POD Confirmation** — `n8n-nodes-base.twilio`
- **Save POD Record** — `n8n-nodes-base.googleSheets`
- **Sticky Note2** — `n8n-nodes-base.stickyNote`
- **Sticky Note** — `n8n-nodes-base.stickyNote`
- **POD WhatsApp Webhook Trigger** — `n8n-nodes-base.webhook`
