Different Exectuion Strategies in Asynchronous Step

When we configure the Asynchronous Step in Async Strategy field we can choose the execution strategy we want.

Async Configuration Async Configuration

  • Multi Queueable

Allows multiple Queueable jobs to be enqueued at the same time. It’s useful when you have multiple independent tasks that you want to execute asynchronously in parallel. The jobs will be executed in the order they are enqueued, but the order of completion may vary depending on how long each jobs takes to run.

  • Direct

Refers to running code synchronously within the current execution context. This means that the code is executed immediately and in the same transaction as the parent code. Direct execution is useful when you need to perform simple, lightweight operations that do not require additional processing time or resources.

  • Future

Future methods in Apex allow you to run code asynchronously in a separate thread, outside the current execution context. This is useful when you need to perform long-running or resource-intensive operations, such as making a callout to an external API or performing a large database query. Future methods are queued for execution and will run as soon as resources are available.

  • Queueable

Queueable Apex jobs allow you to execute long-running code asynchronously in a separate transaction, outside the current execution context. Queueable jobs can be chained together in a specific order, allowing for more complex asynchronous processing workflows.

  • Batch

Batch Apex allows you to process large amounts of data in small, manageable chunks, asynchronously and in the background.Batch Apex is useful when you need to perform complex processing on a large volume of data, such as data manipulation, data migration, or data cleanup.

  • Custom

Custom execution in Apex refers to any type of code execution that is not covered by the standard Apex execution contexts. Custom execution may involve external APIs, custom web services, or other complex processing requirements.