Share via


Gather SharePoint 2013 Workflow troubleshooting data with ShowScopeDebugInfo

Important

SharePoint 2013 workflow has been turned off on all newly created tenants since April 2, 2024. It will be removed from all existing tenants on April 2, 2026. See SharePoint 2013 workflow retirement for more information.

The ShowScopeDebugInfo() function provides an easier way to troubleshoot common problems that affect SharePoint 2013 Workflows, and also provide additional information to Support agents who help you to resolve Workflow problems.

How to run the ShowScopeDebugInfo() function

  1. On the site that's experiencing the Workflow problem, select Settings (the gear icon), and then select Site Settings > Workflow Settings > Workflow Health.

    • You can also access Workflow Health from a URL. For example: https://<contoso>.sharepoint.com/sites/<test>/_layouts/15/WorkflowServiceHealth.aspx. (In this example, replace contoso with your domain, and test with the name of the SharePoint site.)
  2. Open the Developer tools from a web browser (Edge or Google Chrome is recommended).

    • For Microsoft Edge, press the F12 key.
    • For Google Chrome, press Shift+Ctrl+J.
  3. Select Console.

  4. Enter the following function name: ShowScopeDebugInfo(), and then press Enter. The command executes a JavaScript function to print the data in the background.

    • Note: The Workflow Service Health page must be refreshed to get updated data from ShowScopeDebugInfo. The information that's generated by ShowScopeDebugInfo isn't returned in real time. There's a slight delay before the results are updated.

Sample output:

{
  "SupportDocument": "https://go.microsoft.com/fwlink/?linkid=847765",
  "ScopePath": "/spo/ec63b09b-9748-47ba-9018-beeadd405204/f19089ae-d6c6-4feb-be0b-ff4de40a04fc/88890858-ae38-407a-b1e7-152c7cff6fe5",
  "WorkflowEndpoint": "spo-dm3-001.workflow.windows.net",
  "WorkflowAppId": "i:0i.t|ms.sp.ext|5958c314-3699-407a-b142-2d459b5161c4@72f988bf-86f1-41af-91ab-2d7cd011db47",
  "IsThrottled": false,
  "ThrottledUntil": "",
  "ActiveMessageCount": "965436",
  "StatusDetails": "MaxTopicSize",
  "ScopeSizeInBytes": "6447069028",
  "MaxScopeSizeInBytes": "6442450944",
  "CorrelationFilterCount": "1851",
  "MaxCorrelationFilterCount": "100000",
  "ScopeUsageInfoAggregatedByWorkflow": [
    {
      "workflowName": "87effe93-5c6a-474d-8a72-0ef451ff0100",
      "workflowDisplayName": "ANewWF",
      "sizeInBytes": 0,
      "correlationFilterCount": 0
    },
    {
      "workflowName": "df26aa85-85a7-4466-a273-1775c9da38bb",
      "workflowDisplayName": "Neat2013ListWorkflow",
      "sizeInBytes": 52591272,
      "correlationFilterCount": 1827
    },
    {
      "workflowName": "fc7a63c5-ff72-42e5-87fd-3f2944f8a6ef",
      "workflowDisplayName": "Spec_Document_Approval",
      "sizeInBytes": 277327,
      "correlationFilterCount": 24
    }
  ]
}

How to read the results

Label Definition
SupportDocument SharePoint 2013 Workflow public documentation to help workflow authors avoid common problematic Workflow designs and common errors.
ScopePath Required information to engage SharePoint 2013 Workflow feature owners.
WorkflowEndpoint Required information to engage SharePoint 2013 Workflow feature owners.
WorkflowAppId Required information to engage SharePoint 2013 Workflow feature owners.
IsThrottled Indicates whether the Azure Workflow Service is throttling the current SharePoint site's SharePoint 2013 Workflows. Throttling is per SharePoint site, and is evaluated every 10 minutes. If all the SharePoint 2013 Workflow instances exceed the dynamic throttling limit, the Azure Workflow Service throttles all SharePoint 2013 Workflow instances for a minimum of five minutes, and Workflow Instances resume during the next 10-minute processing window.
ThrottledUntil If IsThrottled is true, then ThrottledUntil contains a UTC date and time to indicate when the throttling will expire.
ActiveMessageCount Represents the ServiceBus Subscription ActiveMessageCount. As SharePoint 2013 Workflow instances are initiated, Messages are queued in Azure ServiceBus and these Messages are processed by the Azure Workflow Service backend. If SharePoint 2013 Workflow instances are processing slowly, it's frequently due to throttling and/or a large Azure ServiceBus queue, as indicated by the ActiveMessageCount.
StatusDetails Indicates the reason the current SharePoint site's SharePoint 2013 Workflows aren't progressing and why it isn't possible to start SharePoint 2013 Workflow instances manually or automatically. Currently, MaxTopicSize and MaxCorrelationFilter are included to indicate which limit was exceeded.
ScopeSizeInBytes Represents a SharePoint site's SharePoint 2013 Workflow storage in the Azure Workflow Service. The Azure Workflow Service uses Azure Service Bus and Azure SQL to enable SharePoint 2013 Workflows. Each SharePoint site is allocated 6 GB. The Azure Workflow Service is the cloud version of the on-premises Workflow Manager. If ScopeSizeInBytes exceeded MaxScopeSizeInBytes, the StatusDetails indicates MaxTopicSize. It means that the limit was exceeded, and SharePoint 2013 Workflow instances won't start when they're triggered manually or by creating and editing data in SharePoint Online. It's possible to figure out which SharePoint 2013 Workflow is using the most space by examining ScopeUsageInfoAggregatedByWorkflow. ScopeUsageInfoAggregatedByWorkflow isn't returned in real time but is relatively up-to-date. Each SharePoint 2013 Workflow contains sizeInBytes and could be used as a guide for identifying which SharePoint 2013 Workflow to remove from a SharePoint List or Library. By removing a SharePoint 2013 Workflow from a List or Library's Workflow Settings page, a cleanup process is initiated. After that process finishes, the SharePoint site's Workflow will resume processing. The StatusDetails column no longer contains MaxTopicSize or ScopeSizeInBytes. It's smaller than MaxScopeSizeInBytes. It's possible to start SharePoint 2013 Workflows.
MaxScopeSizeInBytes Represents the maximum storage that's allocated in Azure Workflow Service for the current SharePoint site.
CorrelationFilterCount Represents the Azure Workflow Service current usage of Azure ServiceBus Correlation Filters. When a simple SharePoint 2013 Workflow is started manually or by creating or editing data in SharePoint Online, two Correlation Filters are used per Workflow instance. As a SharePoint 2013 Workflow becomes more complex, more correlation filters are used. Actions such as Wait for Field to Change or Wait for Change in List completely consume correlation filters.

MaxCorrelationFilterCount represents the maximum Correlation Filter limit at 100,000. If the simplest SharePoint 2013 Workflow is created, this means there's a maximum of 50,000 active Workflow instances per SharePoint site. However, it's unlikely you can reach 50,000 Workflow instances, because most Workflows use more than the default two correlation filters that are necessary to start a Workflow instance. After a Workflow instance finishes, the correlation filter count is decreased. This makes room for more Workflow instances.

If CorrelationFilterCount is greater than MaxCorrelationFilterCount, the StatusDetails contains MaxCorrelationFilter. It won't be possible to start Workflow instances. The same behavior described in ScopeSizeInBytes happens when CorrelationFilterCount exceeds MaxCorrelationFilterCount. Also, the same solution is possible. Use the ScopeUsageInfoAggregatedByWorkflow and find the Workflow with the highest correlationFilterCount and consider removing it from the SharePoint List or Library, using the Workflow Settings page. If a SharePoint 2013 Workflow is deleted using SharePoint Designer, it deletes the Workflow logic and the Workflow needs to be recreated. It's best to remove the Workflow using the Workflows Settings page, and then adjust the Workflow logic based on the recommendations that found here.
MaxCorrelationFilterCount Represents the Correlation Filter count that's allocated in Azure Workflow Service for the current SharePoint site.
ScopeUsageInfoAggregatedByWorkflow Contains the current SharePoint site's SharePoint 2013 Workflows. Each Workflow contains the following data: workflowName, workflowDisplayName, sizeInBytes, and correlationFilterCount. The data in ScopeUsageInfoAggregatedByWorkflow isn't updated in real time. It's a snapshot that's frequently updated.
  • workflowName maps to the WorkflowSubscription.Id.
  • workflowDisplayName maps to WorkflowSubscription.Name. This name is the SharePoint 2013 Workflow's name in the SharePoint UX. This name can differ from the one that's in SharePoint Designer.
  • sizeInBytes is the Workflows storage usage. It's aggregated into ScopeSizeInBytes.
  • correlationFilterCount is the Workflows Correlation Filter usage. It's aggregated into CorrelationFilterCount.