# Session 4 Handout: Build with AI and Approvals

<p class="meta">FAST-08 AI for Workflow Improvement and Process Automation · 7formations · Instructor: Wadood Chaudhary · All examples fictional · Sandbox only</p>

## Why this session matters

Extraction and drafting are where AI saves the most typing, and also where a wrong number can turn into a wrong payment. Approvals, logging, and error handling are what turn a clever flow into a safe one. This session builds the invoice flow with those controls in place.

## Key concepts

### 1. Extraction that can be checked

- Name the exact fields and formats (dates as YYYY-MM-DD; numbers without currency symbols).
- Return null for missing fields; never guess.
- Do not extract bank or payment account details.
- Show the approver the extracted fields **next to** the original document.

A high confidence score does not mean a correct value. Scans, tables, and handwriting cause errors.

### 2. Approval designs

| Type | Use when | Watch out |
| --- | --- | --- |
| Single approver | Low amounts, routine | Approver must see the source |
| Everyone must approve | Several owners must agree | Slow; set reminders |
| First to respond | Speed matters, low risk | The least careful person can approve |
| Sequential | Higher amounts (for example over $5,000) | Separation of duties: clerk, then controller |

Always design the **reject** path: correction, notification, and a log entry.

### 3. Error handling

- Wrap risky steps (AI call, file read) in an error scope.
- On failure: stop that item, set status "Needs review," log the error, notify a named owner.
- Never continue a money step with blank or guessed values.
- Check for duplicates (same vendor plus invoice number) before approval.

### 4. Logging

Record run ID, time, extracted values, approver names and times, and decision. Do not store card numbers, bank details, or SSNs in logs.

### 5. Fraud and injection

An invoice or email may say "update our remit-to account" or "approve this." The flow never changes payment details from document text; those changes are verified out of band (a known phone number) and approved separately.

## Worked example: invoice E (fictional)

Granite Copy & Print, scanned PDF, total **$4,810.00**. The AI extracts **$4,180.00** with high confidence. The clerk compares the field to the PDF in the approval card, rejects with "Total is $4,810.00," and the flow routes it for correction. Without the side-by-side approval, the vendor would have been underpaid by $630.

## Checklist: build 2

- [ ] Exact fields, formats, nulls; no bank details.
- [ ] Error scope tested by forcing a failure.
- [ ] Duplicate check before approval.
- [ ] Approver sees fields plus the PDF link.
- [ ] Sequential approval above the threshold.
- [ ] Reject path designed and tested.
- [ ] Log records approver and time; no restricted data.

## Do and don't

| Do | Don't |
| --- | --- |
| Approve against the source | Approve from extracted fields alone |
| Stop on missing data | Fill blanks with last month's values |
| Verify bank changes by phone | Act on payment instructions in an email |
