Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Files & Cloud Storage

Files & Cloud Storage

Reconcile and approve CSV imports with Google Sheets, Drive, and Gmail

When you run it, it manages files using Gmail, Google Drive, Google Sheets.

What it does

## Reconcile an export before producing an import file ### How it works Download a CSV from Drive and compare it with Master. Separate new records, unchanged records, conflicting values, and invalid rows. Duplicate source IDs are all rejected. Invalid or conflicting batches stop for correction under a new batch ID; they are never partially exported. A clean batch waits for approval in Imports. After approval, read Master again. If it changed, mark the proposal stale instead of exporting it. Otherwise create a CSV containing only the new records in a private Drive folder. The source CSV and Master are not modified. ### Setup Run the demo first; its approval is simulated. Create Imports with these headers: case_key, payload_hash, proposal_hash, status, created_at, expires_at, summary, decision, reviewed_hash, reviewer, comment, output_file_id, draft_id. Create Master with record_id, email, due_date, amount. Upload a UTF-8 CSV with the same four headers. Connect Sheets, Gmail, and Drive with file creation access. Set spreadsheetId, outputFolderId, reportTo, and reviewerEmail, then disable demoMode. In Imports, enter approve, reject, or revise, copy proposal_hash to reviewed_hash, and fill reviewer with the configured email. Restrict sheet and folder access to trusted reviewers. ### Recovery Use a new batch ID after correcting a rejected file. Existing completed IDs stop; pending cases resume review. Output names include the proposal hash, allowing serial retries to reuse an existing file. Sheets does not provide a transactional lock: never run the same batch concurrently.

The steps

  1. Try complete demo
  2. Load fictional input
  3. Submit a case
  4. Configure workflow
  5. Use demo data
  6. Read case register
  7. Download source CSV
  8. Parse source CSV
  9. Read master
  10. Build proposal
  11. Already completed
  12. Existing case result
  13. Prepare register
  14. Demo review only

45 steps in total.

Similar automations