Edit

Share via


Use Dataverse background operations

Define Microsoft Dataverse requests as custom APIs to run them in the background. Custom APIs allow you to define custom messages and implement business logic through plug-ins. Background operations eliminate the need for a persistent connection during execution and allow you to take advantage of asynchronous processing.

Tip

This article provides example scenarios and a generalized example architecture to illustrate how to use background operations in Dataverse. The architecture example can be modified for many different scenarios and industries.

Architecture diagram

Architecture diagram illustrating the workflow for executing background operations in Microsoft Dataverse.

Workflow

To run a request as a background operation in Microsoft Dataverse, define the operation as a custom API. Custom APIs allow you to define custom messages and implement business logic through plug-ins. By configuring the operation as a custom API, you use background processing to handle requests asynchronously and eliminate the need to maintain a persistent connection during execution.

Background operations in Dataverse employ:

  • Asynchronous processing: Background operations let Dataverse process requests without making the client wait for completion, enhancing efficiency for long-running tasks.

  • Notification methods: On completion of a background operation, you receive notifications by:

    • Including a callback URL with your request.
    • Subscribing to the OnBackgroundOperationComplete event.
  • Error handling: If an error occurs during the execution of a background operation, Dataverse employs a retry mechanism. The system retries the failed request up to three times, using an exponential backoff strategy.

Makers

The following steps describe the workflow that's shown in the example architecture diagram:

  1. Trigger a background operation using Microsoft Dataverse in Power Automate.
  2. Schedule the operation via recurrence triggers.
  3. Use the Perform a Background Operation action (Premium) in Dataverse to handle the operation asynchronously.
  4. Call the OnBackgroundOperationComplete event action from Power Automate or the API to receive the completion.

When using Dataverse background operations to execute requests asynchronously, the two-minute execution time-out applies to any plug-ins invoked during the process.

Components

Background operations: Background operations are used to send requests that Dataverse processes asynchronously.

Custom APIs: Custom API are used as business events to enable creating new integration capabilities such as exposing a new type of trigger event in the Microsoft Dataverse connector. Custom APIs perform bulk data processing and bulk delete actions.

Power Platform environment: Contains the Power Platform resources.

Power Apps: Power Apps is used to implement the user experience of the solution. A canvas app can trigger a cloud flow that performs a background operation.

Scenario details

Dataverse background operations allow asynchronous processing of tasks, a more efficient way to handle long-running or resource-intensive processes without affecting the user experience.

Potential use case

Dataverse background operations are particularly useful for scenarios that require long-running processes or operations that can be executed without user interaction. Use cases include analysis of large datasets, scheduled data cleanup, and batch processing of records.

Bulk data processing

The scenario: A marketing firm needs to process large datasets to analyze customer behavior and segment audiences. You implement background operations to handle data aggregation and analysis tasks, allowing marketers to access insights without waiting for processing to complete.

Scheduled data cleanup

The scenario: Your organization wants to maintain data hygiene by regularly archiving or deleting outdated records from Dataverse. You implement background operations to identify and manage obsolete data, ensuring the system remains efficient and storage costs are controlled.

Considerations

These considerations implement the pillars of Power Platform Well-Architected, a set of guiding tenets that improve the quality of a workload. Learn more in Microsoft Power Platform Well-Architected.

Performance Efficiency

Background jobs can scale with increasing workloads without compromising performance or reliability.

Reliability

Anticipate potential failures by incorporating comprehensive error-handling mechanisms. Manage transient faults using retry policies with exponential backoff. Learn more in Implement retries with exponential backoff.

Contributors

Microsoft maintains this article. The following contributors wrote this article.

Principal authors: