# Class WorkflowRuntimeBulkApi OptimaJet.Workflow.Core.Runtime.WorkflowRuntimeBulkApi Runtime extension API for creating process instances in bulk. Namespace: [OptimaJet.Workflow.Core.Runtime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/) ```csharp public static class WorkflowRuntimeBulkApi ``` ## Methods `public static void BulkCreateInstance(this WorkflowRuntime runtime, BulkCreateInstancePrams createInstanceParameters, BulkOperationOptions options = null)` Creates the process instances described by one bulk request and runs any initial execution required by their scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `BulkCreateInstancePrams` | The bulk request that defines the process scheme, IDs, and parameters. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | `public static void BulkCreateInstance(this WorkflowRuntime runtime, List createInstanceParameters, BulkOperationOptions options = null)` Creates the process instances described by multiple bulk requests and runs any initial execution required by their schemes. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `List` | The collection of bulk requests to process. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | `public static Task BulkCreateInstanceAsync(this WorkflowRuntime runtime, BulkCreateInstancePrams createInstanceParameters, BulkOperationOptions options = null)` Asynchronously creates the process instances described by one bulk request and runs any initial execution required by their scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `BulkCreateInstancePrams` | The bulk request that defines the process scheme, IDs, and parameters. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous bulk create operation. | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | `public static Task BulkCreateInstanceAsync(this WorkflowRuntime runtime, List createInstanceParameters, BulkOperationOptions options = null)` Asynchronously creates the process instances described by multiple bulk requests and runs any initial execution required by their schemes. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `List` | The collection of bulk requests to process. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous bulk create operation. | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | `public static Task BulkCreateInstanceAsync(this WorkflowRuntime runtime, BulkCreateInstancePrams createInstanceParameters, CancellationToken token, BulkOperationOptions options = null)` Asynchronously creates the process instances described by one bulk request and runs any initial execution required by their scheme. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `BulkCreateInstancePrams` | The bulk request that defines the process scheme, IDs, and parameters. | | `token` | `CancellationToken` | A token used to observe cancellation requests. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous bulk create operation. | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | `public static Task BulkCreateInstanceAsync(this WorkflowRuntime runtime, List createInstanceParameters, CancellationToken token, BulkOperationOptions options = null)` Asynchronously creates the process instances described by multiple bulk requests and runs any initial execution required by their schemes. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The runtime used to execute the bulk operation. | | `createInstanceParameters` | `List` | The collection of bulk requests to process. | | `token` | `CancellationToken` | A token used to observe cancellation requests. | | `options` | `BulkOperationOptions` | Optional bulk options. If [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null), parallelism defaults to [Environment.ProcessorCount](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). | ### Returns | Type | Description | | --- | --- | | `Task` | A task that represents the asynchronous bulk create operation. | ### Exceptions | Type | Description | | --- | --- | | `NotSupportedException` | Thrown if the current persistence provider does not support bulk operations. | [Previous WorkflowRuntime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntime/) [Next WorkflowRuntimeConfigurationExtension](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/WorkflowRuntimeConfigurationExtension/)