Weekly bank statement reconciliation agent

By General Input

Every Monday morning, an agent reads last week's bank statements from Google Drive, categorizes every transaction, flags anything unusual, and posts a summary to Slack.

Integrations

  • PDF.co
  • Google Drive
  • Google Sheets
  • Slack

Type

Agentic Task

Categories

  • Finance
  • Operations

Build me an agent workflow that reconciles last week's bank statements every Monday at 7am local time.

Trigger: cron, every Monday at 07:00.

Step 1. Use Google Drive 'List Files' on a designated 'Bank Statements' folder (folder ID is configurable) to find every PDF whose modifiedTime is within the last 7 days. Use a query like modifiedTime > 'YYYY-MM-DD' and '<folderId>' in parents and mimeType = 'application/pdf'. Collect the file IDs and download URLs.

Step 2. For each statement, decide whether it is a scanned image PDF or a digital text PDF. If it looks scanned, run PDF.co 'Make PDF Searchable' first to OCR it. Otherwise skip that step.

Step 3. Extract transactions. If a PDF.co Document Parser template ID is configured (make this a workflow parameter), call PDF.co 'Document Parser' with that template. If no template is configured, fall back to PDF.co 'Convert PDF to JSON with AI' and have the agent map the AI output into a normalized list of transactions with date, merchant, memo, and amount.

Step 4. For each transaction, the agent assigns a category based on merchant name and memo. Default categories: payroll, SaaS, travel, meals, marketing, refunds, transfers, taxes, and uncategorized. Make the category list configurable so users can add their own.

Step 5. Anomaly detection. The agent flags a transaction if any of these are true: it duplicates another transaction in the same week (same merchant and same amount), it is a round-number transfer above a configurable threshold (default $1000), the merchant has not appeared in any prior row of the ledger, or the amount is above a configurable single-charge limit. Each flagged transaction gets a short reason.

Step 6. Append every categorized transaction as a new row to a Google Sheets ledger using 'Append Values'. Columns: date, statement file name, merchant, memo, amount, category, flagged (yes/no), flag reason. The spreadsheet ID and sheet name are workflow parameters.

Step 7. Post a Slack summary to a configurable channel using 'Send a Message'. The message should include: number of statements processed, total transactions, totals per category for the week, and a bulleted list of flagged transactions with merchant, amount, and reason. Link the Google Sheet at the bottom.

The agent's value is the categorization judgement and anomaly detection, so let it reason over the transactions rather than hard-coding regex rules. If no new PDFs are found, post a short 'no new statements this week' message to Slack and exit cleanly.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats