配置文档库保留策略求助:触发工作流通知管理员归档/删除文档
Hey Henry, let's walk through how to set up this workflow that triggers from your document library's retention policy and sends admins a notification for archiving/deletion after x days. I'll focus on the most common Microsoft 365 scenario (SharePoint Online/OneDrive) since it's the standard for this use case, with notes for on-prem if needed:
- Start by confirming your document library has a retention label/policy configured to trigger after x days. Head to the Compliance Center > Data lifecycle management > Retention policies to create or edit your policy:
- Set the trigger condition to "Content is [x] days old" (or match your specific retention rule)
- Make sure to check the option to "Start a workflow when the retention policy triggers"—this is the critical link between the policy and your notification workflow.
Power Automate integrates seamlessly with Microsoft 365 retention policies, so this is the easiest path:
- Open Power Automate and create an Automated cloud flow. Choose the trigger:
When a retention label is applied to an item(this fires exactly when your retention policy kicks in). - Add a Get file properties action to pull key details about the document (filename, location, creation date)—this makes your notification actionable.
- Next, add a Send email (V2) action targeted at your admin team. Customize the email with these essential details:
- Subject: Action Required: Archive/Delete Expired Document
- Body:
Hi Team,
The following document has reached its x-day retention period and needs your attention:
- Document Name:
@{outputs('Get_file_properties')?['body/{FilenameWithExtension}']} - Location:
@{outputs('Get_file_properties')?['body/{Link}']} - Created Date:
@{outputs('Get_file_properties')?['body/Created']}
Please complete archiving or deletion by [your desired deadline]. If no action is taken, the system will [add automatic action here if configured, e.g., "automatically archive the document to the archive library on [date]"].
- Document Name:
- (Optional) For automated follow-up: Add a Delay action (set to your admin grace period) followed by either
Move file(to an archive library) orDelete fileto handle unattended cases.
- Return to your retention policy in the Compliance Center. Under the "Workflow" section, select the Power Automate flow you just created. Save the policy to activate the connection.
- Grab a test document, manually apply your retention label, or adjust its creation date to x days in the past. Wait for the policy trigger (you can also test the flow directly in Power Automate) and verify the admin team receives the notification with all correct details.
Pro tip: If you're working with SharePoint Server on-prem, use SharePoint Designer to build a workflow with the trigger "When an item's retention status changes"—the core logic (pull file details, send email) stays the same, just the tooling differs.
内容的提问来源于stack exchange,提问作者Henry B




