# Class WorkflowRuntime OptimaJet.Workflow.MSSQL.Models.WorkflowRuntime Namespace: [OptimaJet.Workflow.MSSQL.Models](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.MSSQL.Models/) ```csharp public class WorkflowRuntime : DbObject ``` ## Type Hierarchy - [DbObject](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.DbPersistence/DbObject-TEntity/) - WorkflowRuntime Current type ## Constructors `public WorkflowRuntime(string schemaName, int commandTimeout)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemaName` | `String` | | | `commandTimeout` | `Int32` | | ## Methods `public Task MultiServerRuntimesExistAsync(SqlConnection connection)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetActiveMultiServerRuntimesCountAsync(SqlConnection connection, string currentRuntimeId)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `currentRuntimeId` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task UpdateStatusAsync(SqlConnection connection, WorkflowRuntimeModel status, Guid oldLock)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `status` | `WorkflowRuntimeModel` | | | `oldLock` | `Guid` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task UpdateRestorerAsync(SqlConnection connection, WorkflowRuntimeModel status, Guid oldLock)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `status` | `WorkflowRuntimeModel` | | | `oldLock` | `Guid` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetWorkflowRuntimeStatusAsync(SqlConnection connection, string runtimeId)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `runtimeId` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task SendRuntimeLastAliveSignalAsync(SqlConnection connection, string runtimeId, DateTime time)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `runtimeId` | `String` | | | `time` | `DateTime` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task UpdateNextTimeAsync(SqlConnection connection, string runtimeId, string nextTimeColumnName, DateTime time, SqlTransaction transaction = null)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `runtimeId` | `String` | | | `nextTimeColumnName` | `String` | | | `time` | `DateTime` | | | `transaction` | `SqlTransaction` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public Task GetMaxNextTimeAsync(SqlConnection connection, string runtimeId, string nextTimeColumnName)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `connection` | `SqlConnection` | | | `runtimeId` | `String` | | | `nextTimeColumnName` | `String` | | ### Returns | Type | Description | | --- | --- | | `Task` | | [Previous WorkflowForm](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.MSSQL.Models/WorkflowForm/) [Next WorkflowSync](https://api.workflowengine.io/sql-server/OptimaJet.Workflow.MSSQL.Models/WorkflowSync/)