This is a smart, AI-powered Receivables Agent that automates AR (accounts receivable) chasers — reading invoice data from Google Sheets, drafting polite-but-firm reminder emails, posting a summary to Slack, and updating the sheet — using Zapier AI Agents and the OpenAI API.
| Component | Description |
|---|---|
| Trigger | On-demand (manual run) or schedule daily in Zapier |
| Apps | Google Sheets, Gmail, Slack, ChatGPT (OpenAI) |
| Outcome | Drafts chaser emails, updates sheet audit fields, posts Slack summary |
| Safety | Drafts only (no auto-send), rate-limited via Controls |
The Agent:
- Reads AR rows from Google Sheets
- Computes days past due and bucket
- Renders tailored messages with ChatGPT
- Creates Gmail drafts (never sends)
- Updates audit fields in the sheet
- Posts a concise Slack summary
Receivables columns: invoice_id | customer_name | customer_email | amount_gbp issue_date | due_date | terms_days | status last_contacted_at | promise_to_pay_date | notes | last_email_subject
bash Copy code
Controls (key/value): DRY_RUN, TRUE MAX_EMAILS_PER_RUN, 20 MIN_AMOUNT_GBP, 100 MIN_DAYS_OVERDUE, 3 SUMMARY_SLACK_CHANNEL, #finance-updates REPLY_TO, [email protected]
makefile Copy code
Email_Templates: template_name, bucket, min_days_overdue, subject, body
yaml Copy code
- Google Sheets → Lookup Spreadsheet Rows (Advanced)
- Gmail → Create Draft
- Slack → Send Channel Message
- ChatGPT (OpenAI) → Conversation
Paste the full instructions from docs/AGENT_INSTRUCTIONS.md.
The Agent reads Controls dynamically (DRY_RUN, thresholds, Slack channel, etc).
From Activity → New run, type:
Run receivables chase now
The transcript shows read → compose → draft → update → summary.
- Subject/body tailored by overdue bucket and amount
- UK spelling & tone; notes (e.g., disputes/promises) reflected in copy
- Reply-To comes from
REPLY_TOin Controls - Drafts only — you review before sending
After each draft:
status→ Draft createdlast_contacted_at→ todaylast_email_subject→ subject used
Example message:
Receivables Agent Run — 29 Sep 2025
Drafts created: 7 (capped at 20)
Oldest overdue: 92 days
Total chased: £41,550
Guardrails: DRY_RUN=TRUE · MIN £100 · MIN 3 days
- Read Controls
- Fetch Receivables rows
- Compute
days_past_dueand choose template by bucket - Use ChatGPT to render subject/body
- Create Gmail draft (never send)
- Update status / last_contacted_at / last_email_subject
- Post Slack summary
receivables-agent-zapier/ ├─ data/ # Sample CSVs ├─ docs/ │ ├─ screenshots/ # All PNGs referenced below │ ├─ AGENT_INSTRUCTIONS.md # Full Zapier agent prompt │ ├─ ARCHITECTURE.md # Flow & design notes │ ├─ SETUP.md # Setup guide │ └─ TROUBLESHOOTING.md # Common fixes ├─ demo.gif # Short demo of a run └─ README.md
yaml Copy code
- DRY_RUN (
TRUE) → drafts only - MAX_EMAILS_PER_RUN → rate limit
- MIN_AMOUNT_GBP / MIN_DAYS_OVERDUE → materiality filters
- Optional: add Google Drive → Export PDF for statement attachments
- Screenshots not rendering? Ensure paths like
docs/screenshots/02-app-connections.png(case-sensitive). - Agent skipped items? Check
MIN_DAYS_OVERDUE, promises in future, or recentlast_contacted_at. - Wrong Google account? Reconnect in App Connections and re-select on each tool.
MIT — free to reuse & adapt.
Marjaana Peeters — Finance-AI & Automation
📍 London, UK
🔗 GitHub: marjaanah-stack · LinkedIn: www.linkedin.com/in/marjaana-peeters-0442a4








