# Interface IBulkApi OptimaJet.Workflow.Core.Runtime.Bulk.IBulkApi Provides an API for executing [WorkflowRuntime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) operations in bulk mode. Namespace: [OptimaJet.Workflow.Core.Runtime.Bulk](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/) ```csharp public interface IBulkApi ``` ## Properties `int DefaultMaxDegreeOfParallelism { get; set; }` Gets or sets the default value used for the `maxDegreeOfParallelism` argument in Bulk API methods. `bool DefaultThrowOnError { get; set; }` Gets or sets the default value used for the `throwOnError` argument in Bulk API methods. ## Methods `Task>> CreateInstanceAsync(IEnumerable createInstanceParams, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.CreateInstanceAsync(CreateInstanceParams, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `createInstanceParams` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `createInstanceParams` | `IEnumerable` | A collection of [CreateInstanceParams](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CreateInstanceParams/) values describing the process instances to create. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [CreateInstanceParams.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/CreateInstanceParams/). | `Task>> CreateInstanceAsync(IEnumerable processIds, string schemaCode, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.CreateInstanceAsync(string, Guid, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `IEnumerable` | A collection of process IDs for which instances are created. | | `schemaCode` | `String` | Schema code used when creating instances. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>> GetProcessInstanceAndFillProcessParametersAsync(IEnumerable processIds, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetProcessInstanceAndFillProcessParametersAsync(Guid)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `IEnumerable` | A collection of process IDs for which process instances are obtained and filled. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is the [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/) of each requested process. | `Task>> GetProcessInstancesTreeAsync(IEnumerable rootProcessIds, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetProcessInstancesTreeAsync(Guid, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `rootProcessIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `rootProcessIds` | `IEnumerable` | A collection of root process IDs for which instance trees are obtained. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `rootProcessIds`. | `Task>> GetProcessInstancesTreeAsync(IEnumerable processInstances, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetProcessInstancesTreeAsync(ProcessInstance, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processInstances` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstances` | `IEnumerable` | A collection of process instances for which trees are obtained. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). | `Task>>> GetAvailableCommandsAsync(IEnumerable processInstances, IEnumerable identityIds, string? commandNameFilter = null, string? mainIdentityId = null, CultureInfo? culture = null, bool conditionCheck = false, EventHandler>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetAvailableCommandsAsync(ProcessInstance, IEnumerable, string, string, CultureInfo, bool, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processInstances` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstances` | `IEnumerable` | A collection of process instances for which commands are queried. | | `identityIds` | `IEnumerable` | The workflow participant identities used to build the initial command list. | | `commandNameFilter` | `String` | Returns only the named command when provided. | | `mainIdentityId` | `String` | The main workflow participant identity used for priority rule checks. | | `culture` | `CultureInfo` | Culture used for localizing command names and parameters. | | `conditionCheck` | `Boolean` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), commands with failed condition checks are excluded. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). | `Task>>> GetAvailableCommandsAsync(IEnumerable processInstances, string identityId, EventHandler>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetAvailableCommandsAsync(ProcessInstance, IEnumerable, string, string, CultureInfo, bool, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processInstances` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstances` | `IEnumerable` | A collection of process instances for which commands are queried. | | `identityId` | `String` | The workflow participant identity used to build the initial command list. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [ProcessInstance.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstance/). | `Task>>> GetAvailableCommandsAsync(IEnumerable processIds, IEnumerable identityIds, string? commandNameFilter = null, string? mainIdentityId = null, CultureInfo? culture = null, bool conditionCheck = false, EventHandler>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable, string, string, CultureInfo, bool, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `IEnumerable` | A collection of process IDs for which commands are queried. | | `identityIds` | `IEnumerable` | The workflow participant identities used to build the initial command list. | | `commandNameFilter` | `String` | Returns only the named command when provided. | | `mainIdentityId` | `String` | The main workflow participant identity used for priority rule checks. | | `culture` | `CultureInfo` | Culture used for localizing command names and parameters. | | `conditionCheck` | `Boolean` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), commands with failed condition checks are excluded. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>>> GetAvailableCommandsAsync(IEnumerable processIds, string identityId, EventHandler>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable, string, string, CultureInfo, bool, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `IEnumerable` | A collection of process IDs for which commands are queried. | | `identityId` | `String` | The workflow participant identity used to build the initial command list. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>>> GetAvailableCommandsAsync(IEnumerable processIds, string identityId, CultureInfo culture, EventHandler>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable, string, string, CultureInfo, bool, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `IEnumerable` | A collection of process IDs for which commands are queried. | | `identityId` | `String` | The workflow participant identity used to build the initial command list. | | `culture` | `CultureInfo` | Culture used for localizing command names and parameters. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>> ExecuteCommandAsync(IEnumerable commands, string identityId, string impersonatedIdentityId, bool checkRestrictions = false, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.ExecuteCommandAsync(WorkflowCommand, string, string, CancellationToken, bool)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each command in `commands`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `commands` | `IEnumerable` | A collection of commands to execute. | | `identityId` | `String` | The workflow participant identity that initiates command execution. | | `impersonatedIdentityId` | `String` | The workflow participant identity on whose behalf the commands are executed. | | `checkRestrictions` | `Boolean` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), actor-restriction checks are enforced for each transition. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [WorkflowCommand.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowCommand/). | `Task>> ExecuteCommandWithRestrictionCheckAsync(IEnumerable commands, string identityId, string impersonatedIdentityId, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand, string, string, CancellationToken)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each command in `commands`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `commands` | `IEnumerable` | A collection of commands to execute. | | `identityId` | `String` | The workflow participant identity that initiates command execution. | | `impersonatedIdentityId` | `String` | The workflow participant identity on whose behalf the commands are executed. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is [WorkflowCommand.ProcessId](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowCommand/). | `Task>> UpdateSchemeIfObsoleteAsync(List processIds, bool ignoreAutoSchemeUpdate, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.UpdateSchemeIfObsoleteAsync(Guid, bool)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `List` | A collection of process IDs for which schema updates are performed. | | `ignoreAutoSchemeUpdate` | `Boolean` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), ignores auto-scheme update behavior. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>> UpdateSchemeIfObsoleteAsync(List processIds, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.UpdateSchemeIfObsoleteAsync(Guid)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `List` | A collection of process IDs for which schema updates are performed. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>> DeleteInstanceAsync(List processIds, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.DeleteInstanceAsync(Guid)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `List` | A collection of process IDs for which instances are deleted. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | `Task>> IsProcessExistsAsync(List processIds, EventHandler>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default)` Executes [WorkflowRuntime.IsProcessExistsAsync(Guid)](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) for each `processIds` item. ### Parameters | Name | Type | Description | | --- | --- | --- | | `processIds` | `List` | A collection of process IDs to check for existence. | | `taskFinalizedHandler` | `EventHandler` | Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in [BulkTaskFinalizedEventArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/BulkTaskFinalizedEventArgs-TId-TResult/). | | `maxDegreeOfParallelism` | `Nullable` | Maximum number of tasks that may execute concurrently while running this bulk call. | | `throwOnError` | `Nullable` | When [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool), after all tasks are completed, an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) is thrown if at least one task has failed. | | `cancellationToken` | `CancellationToken` | Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue. | ### Returns | Type | Description | | --- | --- | | `Task` | A dictionary of final task states and results. The key is each corresponding item from `processIds`. | [Previous Empty](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Bulk/Empty/) [Next Calendar](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime.Calendars/Calendar/)