Illustrative example. An advisory or accounting team requests an engagement letter, certificate of incorporation, tax registration, and director ID for a new client. Files arrive over weeks across email threads. Staff update spreadsheets by hand, forward PDFs to reviewers, and write manual reminders, leaving stale trackers and sensitive files scattered across mailboxes and chats.
Fixing that drift is a client onboarding document checklist automation problem. Attachment capture is the transport layer, covered in building a Gmail API intake queue for operational attachments. Downstream, teams need a deterministic checklist in their CRM or matter system that tracks received items, computes the missing-document list without guesswork, and assigns follow-ups without forwarding raw files.
Using public Gmail API, NIST Privacy Framework, and Microsoft Power Automate approvals documentation, this guide specifies an illustrative, made-up onboarding workflow—not a real firm or Insonl client. It covers operational design only, not legal, privacy, or regulatory advice; NIST’s Privacy Framework is voluntary and law-agnostic and does not guarantee compliance. Consult qualified counsel.
Separate checklist state from email threads
An email thread does not encode checklist state or automatically mark earlier files as superseded. When a client resends a cleaner scan two days later, nothing in the thread retires the old file or recalculates open items.
Store two tables in the CRM or matter database:
- Checklist template per engagement type: Lists each
item_code, accepted document class, required versus conditional status, freshness rules, and reviewer role. - Matter checklist item table: Stores one row per
(matter_id, item_code)with explicit status (missing,received_unverified,needs_reissue,verified, orwaived), current opaquedoc_id, superseding history, and next-action owner.
The missing-document list is a deterministic query—every required item in missing or needs_reissue—not a summary guessed from email threads.
Keep AI bounded: OCR or a classifier can inspect a quarantined copy to propose item_code, entity name, or issue date, or draft reminders from the missing list. Deterministic code must own the checklist diff, freshness check, and status transitions.
Detect inbound files with Gmail API push notifications
For Pub/Sub setup, MIME parsing, RFC 5322 deduplication, and quarantine storage, see our Gmail API intake queue guide. Four rules from Google’s push guide, REST references, and scopes policy shape onboarding intake:
- Watch one intake label, not partner mailboxes: Call
users.watchon a dedicated intake mailbox withlabelIds,labelFilterBehavior: "include", andtopicNameset to a pre-existing Cloud Pub/Sub topic in the same developer project where[email protected]holds publish rights. Domain-restricted sharing may require an organization policy exception for that service account. - Treat notifications as pointers, not payloads: Cloud Pub/Sub delivers
message.dataas Base64URL-encoded JSON with onlyemailAddressandhistoryId—never bodies or attachments. The worker callsusers.history.listwithstartHistoryIdto list mailbox changes,users.messages.getto fetch messages, andusers.messages.attachments.getfor separately stored attachment bytes. - Renew watches and recover stale cursors: Renew
users.watchat least every 7 days (Google recommends daily). Gmail caps push events at one per second per watched user and drops excess events; notifications can also be delayed or dropped. Pair push delivery with scheduledusers.history.listcatch-up, run a full resync if a stalestartHistoryIdreturns HTTP404, and avoid modifying watched labels inside the handler in ways that trigger loops. - Contain restricted OAuth scopes: Under Google’s Gmail API scopes policy,
gmail.readonlyandgmail.modifyare restricted scopes (unlike non-sensitivegmail.labelsor sensitivegmail.send). Outside Google’s internal-only app verification exception, applicable server-side storage or transmission of restricted-scope data requires OAuth verification and a security assessment; one dedicated intake address keeps those scopes off partner mailboxes.
Stop forwarding attachments with NIST Privacy Framework controls
Forwarding attachments multiplies unmanaged copies across mail, chats, and downloads. Using the NIST Privacy Framework (V1.0, NIST.CSWP.01162020; V1.1 Initial Public Draft NIST.CSWP.40.ipd, April 2025, aligning with CSF 2.0), the table maps four onboarding risks to selected V1.0 Core subcategories:
| Onboarding risk | NIST PF V1.0 Core subcategory | Operational control |
|---|---|---|
| Unmanaged copies across mail and chat | ID.IM-P8 (Inventory and Mapping): map systems, owners, data actions, and data elements |
Keep one data-flow map across intake mailbox, vault, CRM, approvals, and any extraction service. |
| Raw IDs or tax filings forwarded in emails or cards | CT.DP-P4 & CT.DP-P5 (Disassociated Processing): selective disclosure; substitute attribute references for values |
Store each file once in an access-controlled vault; pass only doc_id, status, and viewer URL to CRM and approvals. |
| Follow-up staff can also view raw ID files | PR.AC-P4 (Identity Management, Authentication, and Access Control): least privilege and separation of duties |
Grant ingestion write-only quarantine access, reviewers viewer access, and follow-up owners status access without raw downloads. |
| Logs or reminders expose personal fields | CT.DM-P8 (Data Processing Management) & PR.DS-P5 (Data Security): audit/log records determined, documented, implemented, and reviewed under policy with data minimization; data-leak protections |
Log matter_id, item_code, doc_id, outcome, and UTC timestamp—never raw ID text—review logs under policy, and block attachment forwarding. |
Replacing raw files with a doc_id and viewer URL (CT.DP-P5) is the structural fix. The CRM tracks status and references; the vault enforces access control (PR.AC-P4), retention schedules, and policy-driven destruction (CT.DM-P5).
Assign verification and follow-ups with Power Automate approvals
Once vaulted and linked, files need verification and missing-item follow-up. Microsoft’s Power Automate approvals (stored in Dataverse; standard licensing covers the Standard approvals connector) fits both within documented limits:
- Link to the viewer instead of attaching files: Populate
Item LinkandItem Link Description, and put non-sensitive metadata in MarkdownDetails. Leaving attachments empty avoids creating file copies through the approval—and avoids the connector rule where approvals with multiple attachments sharing the same filename cannot be created. - Use custom responses for structured transitions: Binary
Approve/Rejecthides failure reasons. Configure custom responses waiting on one responder (Verify Item,Request Reissue,Escalate,Waive with Note) so each choice updates the CRM cleanly. Per approvals known issues, custom responses sent to many users with Everyone must approve can fail onresultsfield size limits. - Plan group and guest routing: Assigning to a mail-enabled Microsoft 365 group or security group lets one member respond for the team (group approvals), but Teams notifications are not sent for group approvals and the group must allow external senders to receive email notifications. Assign named users when Teams cards are needed. Accepted B2B guest approvers need a valid Power Automate license and must act in the Power Automate portal because Outlook actionable emails are unsupported for guests (guest users guide); pending guests are removed from assignees, and creation fails if all assignees are pending.
- Split long-running approvals across two flows: Distinguish the 28-day approval wait (known issues)—after which a waiting flow fails, leaving an abandoned approval in the action center for manual deletion—from the 30-day cloud-flow run limit (flow limits). When reviews may exceed the shorter 28-day wait, use Microsoft’s two-flow Dataverse pattern on
Create an approval (v2): Flow 1 creates the request and exits, while Flow 2 reacts to Dataverse responses (using the Microsoft Dataverse connector directly requires the applicable Premium entitlement). If keepingCreate an approvalandWait for an approvalin one flow, place them close together or update Dataverse status before waiting to avoid stalling on fast responses, and useConditionorSwitchinstead ofdo until. - Keep the CRM authoritative: If a reviewer responds via email or the action center, Teams adaptive cards do not auto-update. Disabling the default email removes one source of stale card state, while action-center responses can still leave a Teams card out of date—so write every outcome back to the CRM.
Illustrative walkthrough: one advisory onboarding packet
(Illustrative, made-up example—not a real advisory firm, client, or Insonl engagement.)
An advisory firm opens matter MAT-2026-0194 from a corporate_advisory_standard template; below is illustrative application data stored by the onboarding service:
{
"matter_id": "MAT-2026-0194",
"checklist": [
{"item_code": "engagement_letter", "status": "verified", "doc_id": "doc_7f21a"},
{"item_code": "cert_of_incorporation", "status": "received_unverified", "doc_id": "doc_8c09e"},
{"item_code": "tax_registration", "status": "needs_reissue", "doc_id": "doc_8b44c", "reason": "cropped_page"},
{"item_code": "director_id", "status": "missing", "doc_id": null}
],
"missing_document_items": ["tax_registration", "director_id"],
"verification_request": {
"approval_id": "appr_0194_02",
"assigned_to": "[email protected]",
"custom_responses": ["Verify Item", "Request Reissue", "Escalate"],
"item_link": "https://vault.example-advisory.test/matters/MAT-2026-0194/docs/doc_8c09e"
}
}
- Vault-first capture: The client emails a certificate of incorporation to the intake address. Gmail push triggers
users.history.list,users.messages.get, andusers.messages.attachments.get; the worker writes the PDF once to the vault asdoc_8c09e, and a classifier proposescert_of_incorporation. The CRM setsreceived_unverifiedwithdoc_8c09eonly. - Reference-only verification: Flow 1 calls
Create an approval (v2)for the compliance group withItem Link, non-sensitive metadata inDetails, and Attachments left empty. A reviewer opensdoc_8c09ein the vault and picksVerify Item; Flow 2 checks that the approval ID anddoc_idstill match the active row, then setsverified. - Deterministic follow-up: A scheduled check reads
missing_document_items(tax_registrationflaggedcropped_page,director_idstillmissing) and assigns one coordinator follow-up for those two items. If a clearer tax file arrives mid-review, the CRM marks the old request superseded, the sender cancels it from Approvals → Sent, and the workflow opens a replacement request for the newdoc_id; Flow 2 applies a response only if its approval ID anddoc_idstill match the current item.
Next step
Before adding AI extraction or automated reminders, map the checklist state machine, vault boundaries, and CRM schema—the scope behind Insonl’s CRM solutions. Start with Insonl’s free AI workflow audit for a written workflow map, recommendations, and a fixed-scope estimate. The audit is free. Follow-on work is optional.
Sources
- Google Workspace Developers, Push Notifications — Gmail API: https://developers.google.com/workspace/gmail/api/guides/push
- Google Workspace Developers, Method: users.watch: https://developers.google.com/workspace/gmail/api/reference/rest/v1/users/watch
- Google Workspace Developers, Method: users.history.list: https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.history/list
- Google Workspace Developers, Method: users.messages.get: https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/get
- Google Workspace Developers, Method: users.messages.attachments.get: https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages.attachments/get
- Google Workspace Developers, Choose Gmail API scopes: https://developers.google.com/workspace/gmail/api/auth/scopes
- Google Cloud Platform Console Help, OAuth API Verification FAQs: https://support.google.com/cloud/answer/13463817?hl=en#internal-only
- NIST, Privacy Framework: https://www.nist.gov/privacy-framework
- NIST, NIST Privacy Framework: A Tool for Improving Privacy Through Enterprise Risk Management, Version 1.0 (NIST.CSWP.01162020): https://www.nist.gov/system/files/documents/2020/01/16/NIST Privacy Framework_V1.0.pdf
- NIST, NIST Privacy Framework V1.0 Core: https://www.nist.gov/system/files/documents/2021/05/05/NIST-Privacy-Framework-V1.0-Core-PDF.pdf
- NIST, NIST Privacy Framework Version 1.1: https://www.nist.gov/privacy-framework/new-projects/privacy-framework-version-11
- Microsoft Learn, Get started with Power Automate approvals: https://learn.microsoft.com/en-us/power-automate/get-started-approvals
- Microsoft Learn, Create and test an approval workflow with Power Automate: https://learn.microsoft.com/en-us/power-automate/modern-approvals
- Microsoft Learn, Request approvals from Microsoft 365 groups: https://learn.microsoft.com/en-us/power-automate/group-approvals
- Microsoft Learn, Support for guest users: https://learn.microsoft.com/en-us/power-automate/share-guest-users
- Microsoft Learn, Known issues — Power Automate approvals: https://learn.microsoft.com/en-us/power-automate/approvals-known-issues
- Microsoft Learn, Limits of automated, scheduled, and instant flows: https://learn.microsoft.com/en-us/power-automate/limits-and-config
- Microsoft Learn, Standard approvals — Connectors: https://learn.microsoft.com/en-us/connectors/approvals/
- Microsoft Learn, Microsoft Dataverse — Connectors: https://learn.microsoft.com/en-us/connectors/commondataserviceforapps/
- Insonl, CRM Solutions: https://insonl.com/services/enterprise/crm-solutions
- Insonl, Gmail API Intake Queue for Operational Attachments: https://insonl.com/journal/gmail-intake-queue-operational-attachments
- Insonl, Free AI Workflow Audit: https://insonl.com/ai
