Microsoft Subscription Renewal Alerts Crate
What does the Microsoft Subscription Renewal Alerts Crate do?
Our Microsoft Subscription Renewal Alerts Crate monitors Microsoft 365 subscriptions and generates alerts when subscriptions approach expiration.
How the Crate works
If the organization variable
default_psais set to mail-only, the system will send email notifications to the address specified in theno_psa_mail_addressvariable.If a PSA is configured, the workflow creates a ticket only when no matching ticket exists, based on these criteria:
Ticket status is open
Summary matches the current alert
If no PSA is integrated, the workflow sends email notifications for each expiring license.
Workflow breakdown
The workflow begins with the BEGIN task which serves as the entry point and immediately transitions to retrieve configuration settings.
The get_ignored_skus task attempts to retrieve an organization variable called renewal_alerts_ignored_skus that contains a list of SKU IDs to exclude from renewal alerts. If the variable is successfully retrieved, it stores the list for later filtering. If the variable retrieval fails or the variable doesn't exist, the workflow continues with an empty list as the default, ensuring the process doesn't halt due to missing configuration.
The ms_get_expired_licenses task makes a Microsoft Graph API request to the "/directory/subscriptions" endpoint to retrieve all Microsoft 365 subscriptions for the organization. Upon successful retrieval, it processes the subscription data to identify subscriptions that are expiring soon by comparing their nextLifecycleDateTime against the current date and filtering out any subscriptions with "lockedout" status or SKU IDs that appear in the ignored SKUs list.
The Email_Only_Check task evaluates the organization's PSA configuration by checking if the "default_psa" organization variable is set to "mail_only". This determines whether the workflow should send email notifications or create PSA tickets for the expiring subscriptions.
If the organization is configured for mail-only notifications, the workflow proceeds to the send_mail_update task, which iterates through each expiring subscription and sends individual email notifications to the address specified in the "no_psa_mail_address" organization variable. Each email contains detailed information about the expiring subscription including the SKU part number, SKU ID, expiration date, OCP subscription ID, and total licenses.
If the organization is not configured for mail-only notifications, the workflow proceeds to the m365_subscription_expiring_create_psa_ticket task, which iterates through each expiring subscription and creates individual PSA tickets containing the subscription details for tracking and resolution by the MSP team.
Both the email and PSA ticket creation tasks process subscriptions with a concurrency of 1, ensuring they are handled sequentially rather than simultaneously.
If any task fails during execution, the workflow transitions to the failed task, which serves as a centralized error handling point before proceeding to completion.
The workflow concludes with the END task, which compiles a comprehensive automation log containing status codes, success indicators, error details, and warnings from all executed tasks, providing a complete audit trail of the workflow execution.
Crate prerequisites
The Microsoft Cloud Integration Bundle must be set up before unpacking this Crate.
To use ticket creation when no matching ticket is found in the workflow's result, your PSA must be successfully integrated with Rewst. PSAs that work with this Crate are:
Unpack the Microsoft Subscription Renewal Alerts Crate
Navigate to Crates > Crate Marketplace in the left side menu Rewst platform.
Search for
Microsoft Subscription Renewal Alerts.
Click on the Crate tile to begin unpacking.
Click Unpack Crate.
Click Continue.
Ensure that Enabled is toggled on for Cron Job under Configure Triggers. Note that you have the option under the accordion menus of both triggers to activate the Crate for all future organizations in addition to the current one. You may also set activation to certain tags, and set trigger criteria or integration overrides.
Click Unpack.
Test the Crate
To test this Crate, you'll need to adjust the cron trigger's schedule to a few minutes in the future, then adjust it back to your regular schedule after the test. Alternatively, you could wait until the regularly scheduled run occurs and check your result, which would not require you to update the cron trigger schedule.
Navigate to Automations > Workflows in the left side menu of your Rewst platform.
Search for
[REWST - CRATE] M365 Subscription Renewal Alerts.
Click on the workflow to view it in the Workflow Builder.

Adjust the cron trigger's schedule to five minutes from your current time. The workflow will run on its own. Check in your PSA's portal to ensure that the workflow is able to move new devices to their correct location as expected.
If using ticket creation for your PSA with this workflow, check in your PSA to confirm that tickets are being created when conditions are met.
Update the cron trigger schedule
The Crate runs on a cron trigger, and will execute the workflow to generate the ticket at the same time each day. You can adjust the chosen time for execution in the workflow itself. Edit a cron trigger in the workflow to change the timing of when it will routinely run.
Navigate to Automations > Workflows.
Search for
[REWST - CRATE] M365 Subscription Renewal Alerts.Click on the workflow to open it in the Workflow Builder.
Click
to open the edit trigger menu.

Update the timing of the cron trigger as desired in the fields under Trigger Parameters. Note that when entering the time into the Cron Schedule field, the correct format is minutes followed by hour. For example, 18 3, not 3 18.
Click Submit.
Organization variables associated with this Crate
Set variables when running Configure Organizational Variables Crate
default_psa
Selected default PSA
Yes
psa_default_ticket_impact
Default PSA configuration
Yes
psa_default_ticket_priority
Default PSA configuration
Yes
psa_default_ticket_source
Default PSA configuration
Yes
psa_default_ticket_status
Default PSA configuration
Yes
psa_default_ticket_urgency
Default PSA configuration
Yes
Set variables if default_PSA is set to email_only
no_psa_mail_address
Email address for subscription expiration notifications
Yes, if using email only
Additional optional configurations
psa_alert_ticket_type
Custom ticket type for alerts, if different from default
No
Last updated
Was this helpful?

