AsyncOperationBase table

The AsyncOperationBase table is used to store system jobs. System jobs represent asynchronous extensions, such as:

  • Asynchronous, registered workflows and plug-ins.
  • Background operations, such as bulk, deletion jobs, bulk import, and rollup operations.

For a list of asynchronous operation types, see OperationType Choices/Options.

Once an event takes place and all immediate extensions are executed, the system then converts the context data for any asynchronous extensions into a structured format that is stored in an AsyncOperation record.

For example, an asynchronous, registered workflow could be a process that automatically sends an email to a customer once their order is placed. The workflow follows up with another email when the order is shipped. In such an asynchronous, registered workflow, the platform saves the context of the asynchronous workflow as a record in the AsyncOperationBase table. A process log WorkflowLog is recorded in the WorkflowLogBase table to maintain logs for the workflow execution.

These records would include information, such as:

  • ID of the workflow

  • ID of the plug-in triggering the workflow

  • Status of the workflow execution

This table includes all default, activity columns such as name, description, type, operation type, and more.

For a full list of the columns in this table, see System Job (AsyncOperation) table/entity reference.

From 2021, the data portion of async operations moved from being stored in Dataverse database capacity to being stored in Dataverse file capacity. This results in async operations data size being partially attributed to Dataverse database capacity and partially to Dataverse file capacity. By moving to Dataverse file capacity, cost is reduced as Dataverse file capacity is charged at a lower rate than Dataverse database capacity. Additionally, Dataverse file capacity improves overall performance as queries against the Async Operation table are more performant.

Causes of growth

The AsyncOperationBase table growth directly depends on the number of customizations that the customer's environment relies on. The more asynchronous workflows and plug-ins result in more records being stored in the AsyncOperationBase table to track execution of these operations.

If your organization has heavy use of workflows or plug-ins, expect the AsyncOperationBase table to be one of the largest consumers of data capacity.

If the size of AsyncOperationBase continues to grow over time, verify that the automatic deletion option on asynchronous registrations is set (see how to set this option for workflows and plug-ins in the appendix). This results in all successfully completed jobs being deleted as soon as they're complete, and keeping size of the table in check.

Some common factors that contribute to the growth of the AsyncOperationBase table in Dynamics 365 include:

  • Heavy use of workflows or business process flows: If an organization has heavy use of workflows or business process flows, the AsyncOperationBase table grows over time and eventually becomes large enough to cause performance issues.

  • Asynchronous plug-in registrations on large entities: If there are asynchronous plug-in registrations on large entities, such as attachments, the data portion of async operations can grow quickly, leading to a large AsyncOperationBase table.

  • Size of the data portion of async operations: The size of the data portion of async operations can also contribute to the growth of the AsyncOperationBase table.

Table cleanup

You need to test these deletion actions first in a sandbox environment. To alleviate operational capacity pressure, it may make more sense for you to increase the amount of storage space you have with your Microsoft Dynamics 365 subscription, instead of reducing the amount of storage space used.

Warning

To reduce the capacity consumption of the AsyncOperationBase table, delete custom metadata related to async jobs. When AsyncOperation entities are deleted, the corresponding files records are also deleted.

These records aren't available after deletion. Proceed with caution when performing bulk delete operations.

Before you delete any data in this table:

  • Review your customizations on your workflows and plug-ins running on delete operations.

  • Review cascade delete behaviors to make sure that no data gets unintendedly deleted in the process.

  • Test these actions in a sandbox environment before proceeding with the final delete operation.

All environments are configured with out-of-box bulk delete jobs to delete successfully completed workflow system jobs that are older than 30 days.

To reduce extra capacity associated with the AsyncOperationBase table, consider configuring workflow system jobs older than 7 days to be deleted using bulk delete jobs.

Diagnostic queries

Use Diagnostic queries to help diagnose problems jobs related to AsyncOperationBase.

Use the following queries to diagnose problems related to AsyncOperationBase file storage.

System job status

To access the System Jobs page, use the following steps.

  1. Sign in to the Power Platform admin center.
  2. Select Environments in the navigation pane > select your environment > select Settings on the command bar.
  3. Select Audit and logs > System jobs.

System jobs have the following status:

  • Completed - The job no longer executes any step, and providing three possible status reasons:

    • Succeeded - The job did what was expected.

    • Failed - There was a failure while processing the job.

    • Canceled - The job won't be executed.

  • Running - The job is being processed or executed or an action is taking place and there are three possible status reason values:

    • In Progress - The job is currently executing.

    • Pausing - A pause operation was triggered.

    • Cancelling - Administrator triggered the cancel option.

  • Pending: - When the system job hasn't met the conditions to be automatically triggered, or there was a failure evaluating the conditions. There are two status reasons on the pending scenario:

    • Waiting - Indicates the system job is in a waiting status.

    • Waiting for Resources - Indicates the system job is waiting for a resource.

Note

Jobs that are running or pending shouldn't be automatically cleaned. Instead, a manual action to cancel should be triggered.

Customers can configure other bulk delete jobs to delete AsyncOperationBase records.

Set up bulk delete jobs

To set up bulk delete jobs, see the following lists.

Delete completed, system jobs that are older than seven days

  1. Sign in to the Power Platform admin center.

  2. Select Environments in the navigation pane > select your environment > select Settings on the command bar.

  3. Select Data management > Bulk deletion > New.

  4. The Bulk Deletion Wizard is displayed. Select Next.

  5. The Define Search Criteria page is displayed. To bulk delete AsyncOperationBase records, complete the following steps:

    1. In the Look for field, select System Jobs.

    2. Enter the following criteria:

      Group Setting Criteria Selected values
      AND Status Equals Completed
      AND Completed On Older Than X Days 7

      Always start with a narrow condition that limits deleted records (older than 3 years), then move to progressively wider delete criteria (older than 3 months) and then to wider delete criteria (older than 7 days).
      AND System Job Type Does Not Equal Bulk Email
      Import File Parse
      Workflow
  6. Select Preview Records to view the records that will be deleted from the specified search criteria to make sure that no data gets unintendedly deleted in the process. Then select Next.

  7. On the Select Options page, select the Run this job after every option, and then select 7 days. Then select Next.

  8. On the Review and Submit Bulk Deletion Details page, select Submit.

For more information on how to configure bulk delete jobs for AsyncOperationBase table, see Cleaning up records from the AsyncOperationBase / WorkflowLogBase table.

Delete completed, system jobs that are for workflows

  1. Sign in to the Power Platform admin center.

  2. Select Environments in the navigation pane > select your environment > select Settings on the command bar.

  3. Select Data management > Bulk deletion > New.

  4. The Bulk Deletion Wizard is displayed. Select Next.

  5. The Define Search Criteria page is displayed. To bulk delete AsyncOperationBase records, complete the following steps:

    1. In the Look for field, select System Jobs.

    2. Enter the following criteria:

      Group Setting Criteria Selected values
      AND Status Reason Equals Succeeded
      AND Status Equals Completed
      AND System Job Type Equals Workflow
  6. Select Preview Records to view the records that will be deleted from the specified search criteria to make sure that no data gets unintendedly deleted in the process. Then select Next.

  7. On the Select Options page, select the Run this job after every option, and then select 7 days. Then select Next.

  8. On the Review and Submit Bulk Deletion Details page, select Submit.

Appendix

To learn more about how to set workflow and plug-in jobs, refer to the following sections.

Set option to delete successfully completed asynchronous workflow jobs

For asynchronous workflows, we recommend selecting the Automatically delete completed workflow jobs (to save disk space) option in the workflow editor. This allows the system to delete workflow logs for successful executions to save space.

Set Workflow Job Retention to automatically delete completed workflow jobs.

Set option to delete successfully completed asynchronous plug-in jobs

  1. Install Microsoft Power Platform CLI

  2. Download and launch Plug-in Registration Tool

  3. For custom Plug-ins, select Register New Step. The Register New Step screen is displayed.

  4. Complete the following steps:

    1. In Event Pipeline Stage area, select Post Operation.
    2. In the Execution Mode area, select Asynchronous.
    3. Select the Delete AsyncOperation if Status Code = Successful option.

Set Delete AsyncOperation if Status Code = Successful

See also