Save emailed compliance attachments into audit-ready archive folder
Each attachment emailed to you is saved into your compliance archive folder with a clear, dated file name, so reviewers can find evidence quickly.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- IT · Security compliance
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder
Set it up with the CLI
- Add it. Copies the folder into
zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy save-emailed-compliance-attachments-into-audit-ready-archive-folder - Check it. Its recent runs, with status and errors.
npx zap-pack logs save-emailed-compliance-attachments-into-audit-ready-archive-folder
zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/google-drive.tsThe
google-driveaccount it uses - connections/microsoft-outlook.tsThe
microsoft-outlookaccount it uses - triggers/new-attachment.tsWhat starts it:
microsoft-outlooknew_attachment - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new attachment arrives in the connected Outlook inbox (
microsoft-outlook,new_attachment). - Code step: builds the file name from the email's date, sender and subject plus the original attachment name, with characters that Drive or Windows dislike replaced. If the attachment has no name, the file is named from the date and sender only.
- Google Drive searches the archive folder for a file with that exact name. If one exists, the run stops and uploads nothing.
- Google Drive uploads the attachment to the archive folder under the built name.
The Zap never overwrites or deletes a file already in the archive.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
REPLACE_ARCHIVE_FOLDER_ID |
The Google Drive folder that is the audit-ready archive. Its ID is the long ID at the end of the folder's URL |
Review these defaults with them: keep FILENAME_PREFIX in config.ts empty for real use, and MAX_FILENAME_LENGTH in workflow.ts (180) unless a reviewer needs shorter names.
Also ask:
- Which mailbox should be watched: the user's own inbox (the default, with the trigger's shared inbox field left empty), or a shared inbox? A shared inbox needs its address in the trigger's Shared Inbox field.
- Should only attachments from one folder count? The trigger can be limited to a Parent Folder.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/save-emailed-compliance-attachments-into-audit-ready-archive-folder, replace each REPLACE_… value as this file says, then run npx zap-pack deploy save-emailed-compliance-attachments-into-audit-ready-archive-folder, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
google-driveto the user's Google Drive connection for the account that owns the archive folder, andmicrosoft-outlookto the Outlook connection for the mailbox whose attachments should be archived. The trigger readsmicrosoft-outlook. No other app needs a connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/new-attachment.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Before testing, connect a Microsoft Outlook account and a test or integration Google Drive account, and create a test folder named [install-test] Compliance archive. Point the archive folder at that test folder for the draft run.
Run a draft test with a sample like this:
{
"attachment_name": "vendor-soc2-report.pdf",
"attachment_url": "https://example.com/vendor-soc2-report.pdf",
"sender": "auditor@example.com",
"subject": "Q3 evidence",
"date": "2026-10-29T09:00:00Z"
}
Expected: one file named 2026-10-29 auditor@example.com - Q3 evidence - vendor-soc2-report.pdf in the test folder. Running the same sample again should upload nothing and return reason: "duplicate".
If run-status tools aren't available, check the test folder in Google Drive directly. Then publish, confirm the trigger is active, and tell the user the Zap is live. Ask the user to delete the test file and the test folder; the agent doesn't delete them.
Notes
- Dedupe works by file name in the archive folder, not by email message ID. Two different emails with the same date, sender, subject and attachment name count as duplicates.
- The email metadata (sender, subject, date) is only in the file name. The Google Drive upload action has no description field, so it isn't stored as file metadata.
- The Outlook payload field names (
attachment_name,attachment_url,sender,subject,date) are not yet checked against a live sample. Match them to the trigger's real output before publishing. - To extend it: add a spreadsheet or table row for each saved file as an audit log, or send an internal alert when an attachment matches high-risk criteria.