Create a subflow to get license consumption
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- IT Asset Management
Create a subflow to add license consumption data to the Subscription Consumption Summaries [sam_saas_consumption_summary] table.
Before you begin
This subflow is applicable to any integration that uses the SaaS license connection framework, including custom integrations.
Role required: flow_designer or admin
Procedure
-
Navigate to All > Process Automation > Flow Designer.
The Flow Designer launches in a new tab.
-
On the Flow Designer home page, click New and then
select Subflow.
The Subflow Properties dialog box opens.
-
On the dialog box, fill in the following fields.
Table 1. Subflow Properties dialog box Field Value Subflow Name Name of the subflow. For example, Download License Consumption. Description Description of the subflow. Application Application scope to which you want the subflow to apply. Set this field to Software Asset Management - SaaS License Management Integrations. Note: If you save the subflow in the Software Asset Management - SaaS License Management Integrations application scope, it's included with your Software Asset Management subscription. If you save the subflow in any other application scope, you may be charged for ServiceNow® Integration Hub transactions. If you're publishing your custom spoke application on the ServiceNow Store, select your custom application scope instead.Accessible From Application scope from which the subflow is accessible. Set this field to All application scopes. Category Subflow category. Leave this field empty. Protection Read-only protections for your subflow. Set this field to None. Sublow Annotation Message that appears under the subflow title in the subflow picker. Leave this field empty. Run As Option to specify whether the flow runs as a system user or user who initiates the session. Set this field to User who initiates session. Run with role(s) Roles with which this subflow runs. -
Click Submit.
The Flow Designer creates the draft subflow and then redirects you to the subflow configuration page.
-
From the subflow configuration page, add an integration profile input.
- Under INPUTS & OUTPUTS, click the plus icon (+) to add an input for your subflow.
- In the Inputs section, click the plus icon (+).
-
When prompted, enter the following information for your integration
profile input.
Table 2. Inputs Label Name Type Mandatory Integration profile integration_profile Reference.Integration Profile Yes - Click Done.
-
Add a data stream action for getting license consumption data.
- Under ACTIONS, click the plus icon (+) and then select Action to add a new action.
- When prompted, select the Global spoke from the list of INSTALLED SPOKES.
- From the list of Default actions, select Get <saas-application> Consumption.
- Click Done.
-
Add an Upsert Consumption action as a child of the Get <saas-application>
Consumption action.
The Upsert Consumption action uploads license consumption data to the Consumption Summary table on your ServiceNow instance.
- Under the Get <saas-application> Consumption action, click the plus icon (+) and then select Action.
- When prompted, select Software Asset Management from the list of INSTALLED SPOKES.
-
From the list of Default actions, select Upsert
Consumption.
The Upsert Consumption action inputs appear.
-
From the Product [Software Product] list, search for and select the
software product that you are connecting to with your integration.
This value must be a reference to the Software Product (samp_sw_product) table. If the product does not exist in the table, add a custom software product.
-
Use values from the Data panel to fill in the remaining action
inputs.
Your request to the SaaS API may not return data for all inputs. Fill in the inputs that are applicable to your integration.
Table 3. Upsert Consumption action inputs Field Value Version Version of the SaaS application. Edition Edition of the SaaS application, such as Standard or Enterprise. Unit of consumption Unit of measure for the software units that can be consumed. Total units Total number of software units that you have purchased across all active entitlements for the software product. Units consumed Total number of software units that your users have consumed. Contract start Start date of your contract. Contract end End date of your contract. - Click Done.
-
Verify that your subflow is working properly by clicking
Test.
View the test results and system logs for details about any errors in your subflow. You can view system logs by navigating to System Logs > System Log > All in your ServiceNow instance.
-
After verifying that the subflow is working as expected, click
Publish.
Tip: You can still edit the subflow after it's published.
What to do next
View analytics such as subscription usage, cost, and compliance of your SaaS applications on SaaS overview dashboard in workspace.