diff --git a/src/clients/Elsa.Api.Client/Activities/FlowSwitch.cs b/src/clients/Elsa.Api.Client/Activities/FlowSwitch.cs
index 587a5df5f..f9d89c58a 100644
--- a/src/clients/Elsa.Api.Client/Activities/FlowSwitch.cs
+++ b/src/clients/Elsa.Api.Client/Activities/FlowSwitch.cs
@@ -1,5 +1,5 @@
using Elsa.Api.Client.Extensions;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Activities;
diff --git a/src/clients/Elsa.Api.Client/Activities/Flowchart.cs b/src/clients/Elsa.Api.Client/Activities/Flowchart.cs
index 5490db9a4..e474e09b4 100644
--- a/src/clients/Elsa.Api.Client/Activities/Flowchart.cs
+++ b/src/clients/Elsa.Api.Client/Activities/Flowchart.cs
@@ -1,5 +1,5 @@
using Elsa.Api.Client.Extensions;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Activities;
diff --git a/src/clients/Elsa.Api.Client/Converters/VersionOptionsJsonConverter.cs b/src/clients/Elsa.Api.Client/Converters/VersionOptionsJsonConverter.cs
index 50634870a..0da7b64ff 100644
--- a/src/clients/Elsa.Api.Client/Converters/VersionOptionsJsonConverter.cs
+++ b/src/clients/Elsa.Api.Client/Converters/VersionOptionsJsonConverter.cs
@@ -1,6 +1,6 @@
using System.Text.Json;
using System.Text.Json.Serialization;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Converters;
diff --git a/src/clients/Elsa.Api.Client/Converters/VersionOptionsTypeConverter.cs b/src/clients/Elsa.Api.Client/Converters/VersionOptionsTypeConverter.cs
index 014890b00..16945d9b4 100644
--- a/src/clients/Elsa.Api.Client/Converters/VersionOptionsTypeConverter.cs
+++ b/src/clients/Elsa.Api.Client/Converters/VersionOptionsTypeConverter.cs
@@ -1,6 +1,6 @@
using System.ComponentModel;
using System.Globalization;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Converters;
diff --git a/src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj b/src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj
index f79c51f80..667330231 100644
--- a/src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj
+++ b/src/clients/Elsa.Api.Client/Elsa.Api.Client.csproj
@@ -18,4 +18,8 @@
+
+
+
+
diff --git a/src/clients/Elsa.Api.Client/Extensions/ActivityExtensions.cs b/src/clients/Elsa.Api.Client/Extensions/ActivityExtensions.cs
index 966f87f8e..28ae5090f 100644
--- a/src/clients/Elsa.Api.Client/Extensions/ActivityExtensions.cs
+++ b/src/clients/Elsa.Api.Client/Extensions/ActivityExtensions.cs
@@ -1,5 +1,5 @@
using Elsa.Api.Client.Activities;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Extensions;
diff --git a/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs b/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs
index fe88c1fce..a68601026 100644
--- a/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs
+++ b/src/clients/Elsa.Api.Client/Extensions/DependencyInjectionExtensions.cs
@@ -10,6 +10,7 @@ using Elsa.Api.Client.Resources.StorageDrivers.Contracts;
using Elsa.Api.Client.Resources.VariableTypes.Contracts;
using Elsa.Api.Client.Resources.WorkflowActivationStrategies.Contracts;
using Elsa.Api.Client.Resources.WorkflowDefinitions.Contracts;
+using Elsa.Api.Client.Resources.WorkflowInstances.Contracts;
using Elsa.Api.Client.Services;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
@@ -34,6 +35,7 @@ public static class DependencyInjectionExtensions
services.AddActivityTypeService();
services.AddApi(CreateRefitSettings);
+ services.AddApi(CreateRefitSettings);
services.AddApi(CreateRefitSettings);
services.AddApi(CreateRefitSettings);
services.AddApi(CreateRefitSettings);
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Contracts/IWorkflowDefinitionsApi.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Contracts/IWorkflowDefinitionsApi.cs
index f7dded57b..19344d47b 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Contracts/IWorkflowDefinitionsApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Contracts/IWorkflowDefinitionsApi.cs
@@ -1,4 +1,6 @@
using Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+using Elsa.Api.Client.Resources.ActivityDescriptors.Requests;
+using Elsa.Api.Client.Resources.ActivityDescriptors.Responses;
using Refit;
namespace Elsa.Api.Client.Resources.ActivityDescriptors.Contracts;
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityKind.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/ActivityKind.cs
similarity index 90%
rename from src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityKind.cs
rename to src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/ActivityKind.cs
index 1049d01c3..dc45a7be4 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityKind.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/ActivityKind.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+namespace Elsa.Api.Client.Resources.ActivityDescriptors.Enums;
///
/// Represents the kind of an activity, which affects how it is executed.
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/PortType.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/PortType.cs
similarity index 79%
rename from src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/PortType.cs
rename to src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/PortType.cs
index 673ede776..75527953b 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/PortType.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Enums/PortType.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+namespace Elsa.Api.Client.Resources.ActivityDescriptors.Enums;
///
/// The type of a port.
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityDescriptor.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityDescriptor.cs
index f43558eb9..f928b21f5 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityDescriptor.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ActivityDescriptor.cs
@@ -1,3 +1,5 @@
+using Elsa.Api.Client.Resources.ActivityDescriptors.Enums;
+
namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
///
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/Port.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/Port.cs
index c668e0e0b..554fef72a 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/Port.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/Port.cs
@@ -1,3 +1,5 @@
+using Elsa.Api.Client.Resources.ActivityDescriptors.Enums;
+
namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
///
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsRequest.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Requests/ListActivityDescriptorsRequest.cs
similarity index 66%
rename from src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Requests/ListActivityDescriptorsRequest.cs
index 9ec5c43fc..3ba3f5f96 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Requests/ListActivityDescriptorsRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+namespace Elsa.Api.Client.Resources.ActivityDescriptors.Requests;
///
/// Represents a request to list activity descriptors.
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsResponse.cs b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Responses/ListActivityDescriptorsResponse.cs
similarity index 71%
rename from src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Responses/ListActivityDescriptorsResponse.cs
index cc9073541..bda899258 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Models/ListActivityDescriptorsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityDescriptors/Responses/ListActivityDescriptorsResponse.cs
@@ -1,4 +1,6 @@
-namespace Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+using Elsa.Api.Client.Resources.ActivityDescriptors.Models;
+
+namespace Elsa.Api.Client.Resources.ActivityDescriptors.Responses;
///
/// Represents a response from listing activity descriptors.
diff --git a/src/clients/Elsa.Api.Client/Resources/Identity/Contracts/ILoginApi.cs b/src/clients/Elsa.Api.Client/Resources/Identity/Contracts/ILoginApi.cs
index 7653eaad0..2f14df7dc 100644
--- a/src/clients/Elsa.Api.Client/Resources/Identity/Contracts/ILoginApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/Identity/Contracts/ILoginApi.cs
@@ -1,4 +1,5 @@
-using Elsa.Api.Client.Resources.Identity.Models;
+using Elsa.Api.Client.Resources.Identity.Requests;
+using Elsa.Api.Client.Resources.Identity.Responses;
using Refit;
namespace Elsa.Api.Client.Resources.Identity.Contracts;
diff --git a/src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginRequest.cs b/src/clients/Elsa.Api.Client/Resources/Identity/Requests/LoginRequest.cs
similarity index 80%
rename from src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/Identity/Requests/LoginRequest.cs
index 8fddf3288..60b3e8c3d 100644
--- a/src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/Identity/Requests/LoginRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.Identity.Models;
+namespace Elsa.Api.Client.Resources.Identity.Requests;
///
/// Represents a request to log in.
diff --git a/src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginResponse.cs b/src/clients/Elsa.Api.Client/Resources/Identity/Responses/LoginResponse.cs
similarity index 73%
rename from src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/Identity/Responses/LoginResponse.cs
index 4b3d91434..d4d332f31 100644
--- a/src/clients/Elsa.Api.Client/Resources/Identity/Models/LoginResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/Identity/Responses/LoginResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.Identity.Models;
+namespace Elsa.Api.Client.Resources.Identity.Responses;
///
/// The response of logging in.
diff --git a/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Contracts/IStorageDriversApi.cs b/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Contracts/IStorageDriversApi.cs
index f672b2ad5..f988b5e9d 100644
--- a/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Contracts/IStorageDriversApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Contracts/IStorageDriversApi.cs
@@ -1,4 +1,5 @@
using Elsa.Api.Client.Resources.StorageDrivers.Models;
+using Elsa.Api.Client.Resources.StorageDrivers.Responses;
using Refit;
namespace Elsa.Api.Client.Resources.StorageDrivers.Contracts;
diff --git a/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Models/ListStorageDriversResponse.cs b/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Responses/ListStorageDriversResponse.cs
similarity index 64%
rename from src/clients/Elsa.Api.Client/Resources/StorageDrivers/Models/ListStorageDriversResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/StorageDrivers/Responses/ListStorageDriversResponse.cs
index c07bf9c8a..6608c2a03 100644
--- a/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Models/ListStorageDriversResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/StorageDrivers/Responses/ListStorageDriversResponse.cs
@@ -1,4 +1,6 @@
-namespace Elsa.Api.Client.Resources.StorageDrivers.Models;
+using Elsa.Api.Client.Resources.StorageDrivers.Models;
+
+namespace Elsa.Api.Client.Resources.StorageDrivers.Responses;
///
/// The response containing the storage drivers.
diff --git a/src/clients/Elsa.Api.Client/Resources/VariableTypes/Contracts/IStorageDriversApi.cs b/src/clients/Elsa.Api.Client/Resources/VariableTypes/Contracts/IStorageDriversApi.cs
index c4faef71a..9f71be088 100644
--- a/src/clients/Elsa.Api.Client/Resources/VariableTypes/Contracts/IStorageDriversApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/VariableTypes/Contracts/IStorageDriversApi.cs
@@ -1,4 +1,5 @@
using Elsa.Api.Client.Resources.VariableTypes.Models;
+using Elsa.Api.Client.Resources.VariableTypes.Responses;
using Refit;
namespace Elsa.Api.Client.Resources.VariableTypes.Contracts;
diff --git a/src/clients/Elsa.Api.Client/Resources/VariableTypes/Models/ListVariableTypesResponse.cs b/src/clients/Elsa.Api.Client/Resources/VariableTypes/Responses/ListVariableTypesResponse.cs
similarity index 65%
rename from src/clients/Elsa.Api.Client/Resources/VariableTypes/Models/ListVariableTypesResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/VariableTypes/Responses/ListVariableTypesResponse.cs
index afd6cd9d8..3992675cf 100644
--- a/src/clients/Elsa.Api.Client/Resources/VariableTypes/Models/ListVariableTypesResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/VariableTypes/Responses/ListVariableTypesResponse.cs
@@ -1,4 +1,6 @@
-namespace Elsa.Api.Client.Resources.VariableTypes.Models;
+using Elsa.Api.Client.Resources.VariableTypes.Models;
+
+namespace Elsa.Api.Client.Resources.VariableTypes.Responses;
///
/// A response containing a list of variable types.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowActivationStrategies/Contracts/IStorageDriversApi.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowActivationStrategies/Contracts/IStorageDriversApi.cs
index 07161ca9c..7717310a4 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowActivationStrategies/Contracts/IStorageDriversApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowActivationStrategies/Contracts/IStorageDriversApi.cs
@@ -1,5 +1,5 @@
-using Elsa.Api.Client.Models;
using Elsa.Api.Client.Resources.WorkflowActivationStrategies.Models;
+using Elsa.Api.Client.Shared.Models;
using Refit;
namespace Elsa.Api.Client.Resources.WorkflowActivationStrategies.Contracts;
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Contracts/IWorkflowDefinitionsApi.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Contracts/IWorkflowDefinitionsApi.cs
index 80bc0d1bb..463258a64 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Contracts/IWorkflowDefinitionsApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Contracts/IWorkflowDefinitionsApi.cs
@@ -1,6 +1,8 @@
using System.Net.Mime;
-using Elsa.Api.Client.Models;
using Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+using Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
+using Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
+using Elsa.Api.Client.Shared.Models;
using JetBrains.Annotations;
using Refit;
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/OrderByWorkflowDefinition.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Enums/OrderByWorkflowDefinition.cs
similarity index 87%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/OrderByWorkflowDefinition.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Enums/OrderByWorkflowDefinition.cs
index 8042e6de7..912dadb52 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/OrderByWorkflowDefinition.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Enums/OrderByWorkflowDefinition.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Enums;
///
/// Defines the order by options for workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinition.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinition.cs
index 54c50f728..13aff1255 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinition.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinition.cs
@@ -1,5 +1,5 @@
using Elsa.Api.Client.Activities;
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Shared.Models;
namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinitionModel.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinitionModel.cs
index 45b1dbebc..5b1fd2a01 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinitionModel.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/WorkflowDefinitionModel.cs
@@ -6,62 +6,28 @@ namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
///
/// Represents a serializable workflow definition.
///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-///
-/// The type of IWorkflowActivationStrategy to apply when new instances are requested to be created.
-///
[PublicAPI]
-public record WorkflowDefinitionModel(
- string Id,
- string DefinitionId,
- string? Name,
- string? Description,
- DateTimeOffset CreatedAt,
- int Version,
- Version? ToolVersion,
- ICollection? Variables,
- ICollection? Inputs,
- ICollection? Outputs,
- ICollection? Outcomes,
- IDictionary? CustomProperties,
- bool IsReadonly,
- bool IsLatest,
- bool IsPublished,
- WorkflowOptions? Options,
- Activity? Root
-)
+public class WorkflowDefinitionModel
{
- ///
- public WorkflowDefinitionModel() : this(
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!,
- default!)
- {
- }
+ public string Id { get; set; } = default!;
+ public string DefinitionId { get; set; } = default!;
+ public string? Name { get; set; }
+ public string? Description { get; set; }
+ public DateTimeOffset CreatedAt { get; set; }
+ public int Version { get; set; }
+ public Version? ToolVersion { get; set; }
+ public ICollection? Variables { get; set; }
+ public ICollection? Inputs { get; set; }
+ public ICollection? Outputs { get; set; }
+ public ICollection? Outcomes { get; set; }
+ public IDictionary? CustomProperties { get; set; }
+ public bool IsReadonly { get; set; }
+ public bool IsLatest { get; set; }
+ public bool IsPublished { get; set; }
+
+ /// The type of IWorkflowActivationStrategy to apply when new instances are requested to be created.
+ public WorkflowOptions? Options { get; set; }
+
+ ///
+ public Activity? Root { get; set; }
}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkDeleteWorkflowDefinitionsRequest.cs
similarity index 90%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkDeleteWorkflowDefinitionsRequest.cs
index ada15c150..8cf7dade2 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkDeleteWorkflowDefinitionsRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
///
/// A request to delete many workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkPublishWorkflowDefinitionsRequest.cs
similarity index 91%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkPublishWorkflowDefinitionsRequest.cs
index 527761704..d692a177c 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkPublishWorkflowDefinitionsRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
///
/// A request to publish many workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkRetractWorkflowDefinitionsRequest.cs
similarity index 91%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkRetractWorkflowDefinitionsRequest.cs
index fdd270aa1..7273c4dff 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/BulkRetractWorkflowDefinitionsRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
///
/// A request to retract many workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetWorkflowDefinitionRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/GetWorkflowDefinitionRequest.cs
similarity index 83%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetWorkflowDefinitionRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/GetWorkflowDefinitionRequest.cs
index b1c0a5cfd..573df976e 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetWorkflowDefinitionRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/GetWorkflowDefinitionRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
///
/// Represents a request to get a workflow definition.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/RetractWorkflowDefinitionRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/RetractWorkflowDefinitionRequest.cs
similarity index 65%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/RetractWorkflowDefinitionRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/RetractWorkflowDefinitionRequest.cs
index 5714b01c5..d0e9e2de7 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/RetractWorkflowDefinitionRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/RetractWorkflowDefinitionRequest.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests;
///
/// Request to retract a workflow definition.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/SaveWorkflowDefinitionRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/SaveWorkflowDefinitionRequest.cs
similarity index 78%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/SaveWorkflowDefinitionRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/SaveWorkflowDefinitionRequest.cs
index 980c0423c..de4b73972 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/SaveWorkflowDefinitionRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Requests/SaveWorkflowDefinitionRequest.cs
@@ -1,4 +1,6 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models
+using Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Requests
{
///
/// Represents a request to save a workflow definition.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkDeleteWorkflowDefinitionsResponse.cs
similarity index 78%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkDeleteWorkflowDefinitionsResponse.cs
index d6b31ddf4..ad018ae0a 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkDeleteWorkflowDefinitionsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkDeleteWorkflowDefinitionsResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// The response from a request to delete workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkPublishWorkflowDefinitionsResponse.cs
similarity index 79%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkPublishWorkflowDefinitionsResponse.cs
index e52d7eccb..ed77df362 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkPublishWorkflowDefinitionsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkPublishWorkflowDefinitionsResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// The response from a request to publish workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkRetractWorkflowDefinitionsResponse.cs
similarity index 79%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkRetractWorkflowDefinitionsResponse.cs
index 5a8638a0c..1f646e29c 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/BulkRetractWorkflowDefinitionsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/BulkRetractWorkflowDefinitionsResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// The response from a request to publish workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/CountWorkflowDefinitionsResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/CountWorkflowDefinitionsResponse.cs
similarity index 69%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/CountWorkflowDefinitionsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/CountWorkflowDefinitionsResponse.cs
index c19a98856..3f4bec00b 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/CountWorkflowDefinitionsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/CountWorkflowDefinitionsResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// A response containing the number of workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetIsNameUniqueResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/GetIsNameUniqueResponse.cs
similarity index 79%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetIsNameUniqueResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/GetIsNameUniqueResponse.cs
index c7f4ff548..4f1232b15 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/GetIsNameUniqueResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/GetIsNameUniqueResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// A response containing a value indicating whether a workflow definition name is unique.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsRequest.cs
similarity index 75%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsRequest.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsRequest.cs
index 16c508f77..9f928d19d 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsRequest.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsRequest.cs
@@ -1,7 +1,8 @@
-using Elsa.Api.Client.Models;
+using Elsa.Api.Client.Resources.WorkflowDefinitions.Enums;
+using Elsa.Api.Client.Shared.Models;
using Refit;
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// Represents a request to list workflow definitions.
@@ -19,10 +20,16 @@ public class ListWorkflowDefinitionsRequest
public int? PageSize { get; set; }
///
- /// The IDs of the workflow definitions to filter by.
+ /// The definition IDs of the workflow definitions to filter by.
///
[Query(CollectionFormat.Multi)]
public ICollection? DefinitionIds { get; set; }
+
+ ///
+ /// The IDs of the workflow definitions to filter by.
+ ///
+ [Query(CollectionFormat.Multi)]
+ public ICollection? Ids { get; set; }
///
/// The name of the workflow materializer to filter by.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsResponse.cs
similarity index 72%
rename from src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsResponse.cs
rename to src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsResponse.cs
index ebe1514a0..f967304e9 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Models/ListWorkflowDefinitionsResponse.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowDefinitions/Responses/ListWorkflowDefinitionsResponse.cs
@@ -1,4 +1,6 @@
-namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+using Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
+
+namespace Elsa.Api.Client.Resources.WorkflowDefinitions.Responses;
///
/// Represents a response from listing workflow definitions.
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs
index b48290b7c..d41dcd773 100644
--- a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs
@@ -1,3 +1,8 @@
+using Elsa.Api.Client.Resources.WorkflowInstances.Models;
+using Elsa.Api.Client.Resources.WorkflowInstances.Requests;
+using Elsa.Api.Client.Shared.Models;
+using Refit;
+
namespace Elsa.Api.Client.Resources.WorkflowInstances.Contracts;
///
@@ -5,4 +10,25 @@ namespace Elsa.Api.Client.Resources.WorkflowInstances.Contracts;
///
public interface IWorkflowInstancesApi
{
+ ///
+ /// Returns a list of workflow instances.
+ ///
+ [Get("/workflow-instances")]
+ Task> ListAsync(ListWorkflowInstancesRequest request, CancellationToken cancellationToken = default);
+
+ ///
+ /// Deletes a workflow instance.
+ ///
+ /// The ID of the workflow instance to delete.
+ /// The cancellation token.
+ [Delete("/workflow-instances/{id}")]
+ Task DeleteAsync(string id, CancellationToken cancellationToken = default);
+
+ ///
+ /// Deletes a list of workflow instances.
+ ///
+ /// The request containing the IDs of the workflow instances to delete.
+ /// The cancellation token.
+ [Post("/bulk-actions/delete/workflow-instances/by-id")]
+ Task BulkDeleteAsync(BulkDeleteWorkflowInstancesRequest request, CancellationToken cancellationToken);
}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/OrderByWorkflowInstance.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/OrderByWorkflowInstance.cs
new file mode 100644
index 000000000..fd4056af2
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/OrderByWorkflowInstance.cs
@@ -0,0 +1,27 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+
+///
+/// Defines the order by options for workflow instances.
+///
+public enum OrderByWorkflowInstance
+{
+ ///
+ /// Order by the date the workflow instance was created.
+ ///
+ Created,
+
+ ///
+ /// Order by the date the workflow instance was last executed.
+ ///
+ LastExecuted,
+
+ ///
+ /// Order by the date the workflow instance was finished.
+ ///
+ Finished,
+
+ ///
+ /// Order by the name of the workflow instance.
+ ///
+ Name
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowStatus.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowStatus.cs
new file mode 100644
index 000000000..893211856
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowStatus.cs
@@ -0,0 +1,17 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+
+///
+/// Represents the current workflow status.
+///
+public enum WorkflowStatus
+{
+ ///
+ /// The workflow is running (although it may be waiting for external stimuli).
+ ///
+ Running,
+
+ ///
+ /// The workflow completed and is no longer running.
+ ///
+ Finished
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowSubStatus.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowSubStatus.cs
new file mode 100644
index 000000000..392655150
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Enums/WorkflowSubStatus.cs
@@ -0,0 +1,32 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+
+///
+/// Represents the workflow sub-status.
+///
+public enum WorkflowSubStatus
+{
+ ///
+ /// The workflow is currently executing.
+ ///
+ Executing,
+
+ ///
+ /// The workflow is currently suspended and waiting for external stimuli to resume.
+ ///
+ Suspended,
+
+ ///
+ /// The workflow completed successfully.
+ ///
+ Finished,
+
+ ///
+ /// The workflow was cancelled.
+ ///
+ Cancelled,
+
+ ///
+ /// The workflow has faulted.
+ ///
+ Faulted,
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityExecutionContextState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityExecutionContextState.cs
new file mode 100644
index 000000000..e6822074f
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ActivityExecutionContextState.cs
@@ -0,0 +1,37 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// A serializable shape of an ActivityExecutionContext.
+///
+public class ActivityExecutionContextState
+{
+ ///
+ /// The ID of the activity instance.
+ ///
+ public string Id { get; set; } = default!;
+
+ ///
+ /// The ID of the parent of the activity instance.
+ ///
+ public string? ParentContextId { get; set; }
+
+ ///
+ /// The node ID of the scheduled activity.
+ ///
+ public string ScheduledActivityNodeId { get; set; } = default!;
+
+ ///
+ /// The node ID of the activity that owns the scheduled activity.
+ ///
+ public string? OwnerActivityNodeId { get; set; }
+
+ ///
+ /// A bag of properties.
+ ///
+ public IDictionary Properties { get; set; } = new Dictionary();
+
+ ///
+ /// The evaluated values of the activity's properties.
+ ///
+ public IDictionary? ActivityState { get; set; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/Bookmark.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/Bookmark.cs
new file mode 100644
index 000000000..085193157
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/Bookmark.cs
@@ -0,0 +1,34 @@
+using System.Text.Json.Serialization;
+using JetBrains.Annotations;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// A bookmark represents a location in a workflow where the workflow can be resumed at a later time.
+///
+/// The ID of the bookmark.
+/// The name of the bookmark.
+/// The hash of the bookmark.
+/// The data associated with the bookmark.
+/// The ID of the activity node associated with the bookmark.
+/// The ID of the activity instance associated with the bookmark.
+/// Whether or not the bookmark should be automatically burned.
+/// The name of the method on the activity class to invoke when the bookmark is resumed.
+[PublicAPI]
+public record Bookmark(
+ string Id,
+ string Name,
+ string Hash,
+ object? Payload,
+ string ActivityNodeId,
+ string ActivityInstanceId,
+ bool AutoBurn = true,
+ string? CallbackMethodName = default
+)
+{
+ ///
+ [JsonConstructor]
+ public Bookmark() : this("", "", "", null, "", "")
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/CompletionCallbackState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/CompletionCallbackState.cs
new file mode 100644
index 000000000..a8bf32840
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/CompletionCallbackState.cs
@@ -0,0 +1,12 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+public class CompletionCallbackState
+{
+ public CompletionCallbackState()
+ {
+ }
+
+ public string OwnerInstanceId { get; init; } = default!;
+ public string ChildNodeId { get; init; } = default!;
+ public string? MethodName { get; init; } = default!;
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs
new file mode 100644
index 000000000..282fb8316
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs
@@ -0,0 +1,18 @@
+using System.Text.Json.Serialization;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// A simplified, serializable model representing an exception.
+///
+public record ExceptionState(Type Type, string Message, string? StackTrace, ExceptionState? InnerException)
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ [JsonConstructor]
+ public ExceptionState() : this(default!, default!, default, default)
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/PersistentVariableState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/PersistentVariableState.cs
new file mode 100644
index 000000000..e9b9a43f0
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/PersistentVariableState.cs
@@ -0,0 +1,14 @@
+using System.Text.Json.Serialization;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+public class PersistentVariableState
+{
+ [JsonConstructor]
+ public PersistentVariableState()
+ {
+ }
+
+ public string Name { get; set; } = default!;
+ public string StorageDriverId { get; set; } = default!;
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowFaultState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowFaultState.cs
new file mode 100644
index 000000000..0feba0908
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowFaultState.cs
@@ -0,0 +1,22 @@
+using System.Text.Json.Serialization;
+using JetBrains.Annotations;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// Holds information about a workflow fault.
+///
+/// The exception that occurred
+/// A description about the fault. Usually the exception message, if there waa an exception.
+/// The ID of the activity that caused the workflow to fault.
+[PublicAPI]
+public record WorkflowFaultState(ExceptionState? Exception, string Message, string? FaultedActivityId)
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ [JsonConstructor]
+ public WorkflowFaultState() : this(default, default!, default)
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstance.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstance.cs
new file mode 100644
index 000000000..d20c1500f
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstance.cs
@@ -0,0 +1,75 @@
+using Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+using Elsa.Api.Client.Shared.Models;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// Represents a workflow instance.
+///
+public class WorkflowInstance : Entity
+{
+ ///
+ /// The ID of the workflow definition.
+ ///
+ public string DefinitionId { get; set; } = default!;
+
+ ///
+ /// The version ID of the workflow definition.
+ ///
+ public string DefinitionVersionId { get; set; } = default!;
+
+ ///
+ /// The version of the workflow definition.
+ ///
+ public int Version { get; set; }
+
+ ///
+ /// The state of the workflow instance.
+ ///
+ public WorkflowState WorkflowState { get; set; } = default!;
+
+ ///
+ /// The status of the workflow instance.
+ ///
+ public WorkflowStatus Status { get; set; }
+
+ ///
+ /// The sub-status of the workflow instance.
+ ///
+ public WorkflowSubStatus SubStatus { get; set; }
+
+ ///
+ /// The ID of the workflow instance.
+ ///
+ public string? CorrelationId { get; set; }
+
+ ///
+ /// The name of the workflow instance.
+ ///
+ public string? Name { get; set; }
+
+ ///
+ /// The timestamp when the workflow instance was created.
+ ///
+ public DateTimeOffset CreatedAt { get; set; }
+
+ ///
+ /// The timestamp when the workflow instance was last executed.
+ ///
+ public DateTimeOffset? LastExecutedAt { get; set; }
+
+ ///
+ /// The timestamp when the workflow instance was finished.
+ ///
+ public DateTimeOffset? FinishedAt { get; set; }
+
+ ///
+ /// The timestamp when the workflow instance was cancelled.
+ ///
+ public DateTimeOffset? CancelledAt { get; set; }
+
+ ///
+ /// The timestamp when the workflow instance was faulted.
+ ///
+ public DateTimeOffset? FaultedAt { get; set; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstanceSummary.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstanceSummary.cs
new file mode 100644
index 000000000..100a8439c
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowInstanceSummary.cs
@@ -0,0 +1,50 @@
+using Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+using JetBrains.Annotations;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// Represents a summary view of a .
+///
+[PublicAPI]
+public record WorkflowInstanceSummary
+{
+ /// The ID of the workflow instance.
+ public string Id { get; set; } = default!;
+
+ /// The ID of the workflow definition.
+ public string DefinitionId { get; set; } = default!;
+
+ /// The version ID of the workflow definition.
+ public string DefinitionVersionId { get; set; } = default!;
+
+ /// The version of the workflow definition.
+ public int Version { get; set; }
+
+ /// The status of the workflow instance.
+ public WorkflowStatus Status { get; set; }
+
+ /// The sub-status of the workflow instance.
+ public WorkflowSubStatus SubStatus { get; set; }
+
+ /// The ID of the workflow instance.
+ public string? CorrelationId { get; set; }
+
+ /// The name of the workflow instance.
+ public string? Name { get; set; }
+
+ /// The timestamp when the workflow instance was created.
+ public DateTimeOffset CreatedAt { get; set; }
+
+ /// The timestamp when the workflow instance was last executed.
+ public DateTimeOffset? LastExecutedAt { get; set; }
+
+ /// The timestamp when the workflow instance was finished.
+ public DateTimeOffset? FinishedAt { get; set; }
+
+ /// The timestamp when the workflow instance was cancelled.
+ public DateTimeOffset? CancelledAt { get; set; }
+
+ /// The timestamp when the workflow instance was faulted.
+ public DateTimeOffset? FaultedAt { get; set; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs
new file mode 100644
index 000000000..da7e9858d
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/WorkflowState.cs
@@ -0,0 +1,75 @@
+using Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+using Elsa.Api.Client.Shared.Models;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Models;
+
+///
+/// Represents the current state of a workflow.
+///
+public class WorkflowState : Entity
+{
+ ///
+ /// The workflow definition ID.
+ ///
+ public string DefinitionId { get; set; } = default!;
+
+ ///
+ /// The workflow definition version.
+ ///
+ public int DefinitionVersion { get; set; }
+
+ ///
+ /// The correlation ID of the workflow, if any.
+ ///
+ public string? CorrelationId { get; set; }
+
+ ///
+ /// The status of the workflow.
+ ///
+ public WorkflowStatus Status { get; set; }
+
+ ///
+ /// The sub status of the workflow.
+ ///
+ public WorkflowSubStatus SubStatus { get; set; }
+
+ ///
+ /// Collected bookmarks.
+ ///
+ public ICollection Bookmarks { get; set; } = new List();
+
+ ///
+ /// The serialized workflow state, if any.
+ ///
+ public WorkflowFaultState? Fault { get; set; }
+
+ ///
+ /// A list of callbacks that activities registered in order to be notified when the activities they scheduled complete.
+ ///
+ public ICollection CompletionCallbacks { get; set; } = new List();
+
+ ///
+ /// A flattened list of objects, representing the various active "call stacks" of the workflow.
+ ///
+ public ICollection ActivityExecutionContexts { get; set; } = new List();
+
+ ///
+ /// A dictionary of outputs produced by the workflow.
+ ///
+ public IDictionary Output { get; set; } = new Dictionary();
+
+ ///
+ /// A global property bag that contains properties set by application code and/or activities.
+ ///
+ public IDictionary Properties { get; set; } = new Dictionary();
+
+ ///
+ /// The created time of the workflow.
+ ///
+ public DateTimeOffset CreatedAt { get; set; }
+
+ ///
+ /// The last updated time of the workflow.
+ ///
+ public DateTimeOffset UpdatedAt { get; set; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/BulkDeleteWorkflowInstancesRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/BulkDeleteWorkflowInstancesRequest.cs
new file mode 100644
index 000000000..48d726634
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/BulkDeleteWorkflowInstancesRequest.cs
@@ -0,0 +1,6 @@
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Requests;
+
+public class BulkDeleteWorkflowInstancesRequest
+{
+ public ICollection Ids { get; set; } = default!;
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/ListWorkflowInstancesRequest.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/ListWorkflowInstancesRequest.cs
new file mode 100644
index 000000000..c32a852bc
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/ListWorkflowInstancesRequest.cs
@@ -0,0 +1,18 @@
+using Elsa.Api.Client.Resources.WorkflowInstances.Enums;
+using Elsa.Api.Client.Shared.Models;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Requests;
+
+public class ListWorkflowInstancesRequest
+{
+ public int? Page { get; set; }
+ public int? PageSize { get; set; }
+ public string? SearchTerm { get; set; }
+ public string? DefinitionId { get; set; }
+ public string? CorrelationId { get; set; }
+ public int? Version { get; set; }
+ public WorkflowStatus? Status { get; set; }
+ public WorkflowSubStatus? SubStatus { get; set; }
+ public OrderByWorkflowInstance? OrderBy { get; set; }
+ public OrderDirection? OrderDirection { get; set; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Responses/BulkDeleteWorkflowInstancesResponse.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Responses/BulkDeleteWorkflowInstancesResponse.cs
new file mode 100644
index 000000000..73aa8280c
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Responses/BulkDeleteWorkflowInstancesResponse.cs
@@ -0,0 +1,8 @@
+using System.Text.Json.Serialization;
+
+namespace Elsa.Api.Client.Resources.WorkflowInstances.Responses;
+
+internal class BulkDeleteWorkflowInstancesResponse
+{
+ [JsonPropertyName("deleted")] public int DeletedCount { get; }
+}
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Models/ActivityDesignerMetadata.cs b/src/clients/Elsa.Api.Client/Shared/Models/ActivityDesignerMetadata.cs
similarity index 97%
rename from src/clients/Elsa.Api.Client/Models/ActivityDesignerMetadata.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/ActivityDesignerMetadata.cs
index 4be3f5ce7..f84c005e1 100644
--- a/src/clients/Elsa.Api.Client/Models/ActivityDesignerMetadata.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/ActivityDesignerMetadata.cs
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents designer metadata for an activity.
diff --git a/src/clients/Elsa.Api.Client/Models/ActivityOutput.cs b/src/clients/Elsa.Api.Client/Shared/Models/ActivityOutput.cs
similarity index 91%
rename from src/clients/Elsa.Api.Client/Models/ActivityOutput.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/ActivityOutput.cs
index 1ec22b38d..b7af4c148 100644
--- a/src/clients/Elsa.Api.Client/Models/ActivityOutput.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/ActivityOutput.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents an output binding for an activity.
diff --git a/src/clients/Elsa.Api.Client/Models/Case.cs b/src/clients/Elsa.Api.Client/Shared/Models/Case.cs
similarity index 84%
rename from src/clients/Elsa.Api.Client/Models/Case.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Case.cs
index 8c144f160..9df50c448 100644
--- a/src/clients/Elsa.Api.Client/Models/Case.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Case.cs
@@ -1,7 +1,7 @@
using Elsa.Api.Client.Contracts;
using Elsa.Api.Client.Expressions;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
public class Case
{
diff --git a/src/clients/Elsa.Api.Client/Models/Connection.cs b/src/clients/Elsa.Api.Client/Shared/Models/Connection.cs
similarity index 90%
rename from src/clients/Elsa.Api.Client/Models/Connection.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Connection.cs
index c5df38710..6794fb948 100644
--- a/src/clients/Elsa.Api.Client/Models/Connection.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Connection.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a connection between two activities.
diff --git a/src/clients/Elsa.Api.Client/Models/Container.cs b/src/clients/Elsa.Api.Client/Shared/Models/Container.cs
similarity index 95%
rename from src/clients/Elsa.Api.Client/Models/Container.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Container.cs
index 8afa2ee1d..0df8541af 100644
--- a/src/clients/Elsa.Api.Client/Models/Container.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Container.cs
@@ -2,7 +2,7 @@ using Elsa.Api.Client.Activities;
using Elsa.Api.Client.Extensions;
using Elsa.Api.Client.Resources.WorkflowDefinitions.Models;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a container activity.
diff --git a/src/clients/Elsa.Api.Client/Models/Endpoint.cs b/src/clients/Elsa.Api.Client/Shared/Models/Endpoint.cs
similarity index 95%
rename from src/clients/Elsa.Api.Client/Models/Endpoint.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Endpoint.cs
index 1edbb1301..6f291a1a8 100644
--- a/src/clients/Elsa.Api.Client/Models/Endpoint.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Endpoint.cs
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a connection between two activities.
diff --git a/src/clients/Elsa.Api.Client/Models/Entity.cs b/src/clients/Elsa.Api.Client/Shared/Models/Entity.cs
similarity index 84%
rename from src/clients/Elsa.Api.Client/Models/Entity.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Entity.cs
index 9eca1a8b7..eef0a70b1 100644
--- a/src/clients/Elsa.Api.Client/Models/Entity.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Entity.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents an entity.
diff --git a/src/clients/Elsa.Api.Client/Models/HttpStatusCodeCase.cs b/src/clients/Elsa.Api.Client/Shared/Models/HttpStatusCodeCase.cs
similarity index 91%
rename from src/clients/Elsa.Api.Client/Models/HttpStatusCodeCase.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/HttpStatusCodeCase.cs
index 52da64a1d..d88e22566 100644
--- a/src/clients/Elsa.Api.Client/Models/HttpStatusCodeCase.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/HttpStatusCodeCase.cs
@@ -1,6 +1,6 @@
using Elsa.Api.Client.Activities;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents an expected status code in the FlowSendHttpRequest activity.
diff --git a/src/clients/Elsa.Api.Client/Models/ListResponse.cs b/src/clients/Elsa.Api.Client/Shared/Models/ListResponse.cs
similarity index 83%
rename from src/clients/Elsa.Api.Client/Models/ListResponse.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/ListResponse.cs
index 0f3c9b406..335be4b7a 100644
--- a/src/clients/Elsa.Api.Client/Models/ListResponse.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/ListResponse.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a generic list response that offers a unified format for returning list of things from API endpoints.
diff --git a/src/clients/Elsa.Api.Client/Models/MemoryReference.cs b/src/clients/Elsa.Api.Client/Shared/Models/MemoryReference.cs
similarity index 86%
rename from src/clients/Elsa.Api.Client/Models/MemoryReference.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/MemoryReference.cs
index d2153da79..5072ecf8f 100644
--- a/src/clients/Elsa.Api.Client/Models/MemoryReference.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/MemoryReference.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a reference to a memory block.
diff --git a/src/clients/Elsa.Api.Client/Models/OrderDirection.cs b/src/clients/Elsa.Api.Client/Shared/Models/OrderDirection.cs
similarity index 84%
rename from src/clients/Elsa.Api.Client/Models/OrderDirection.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/OrderDirection.cs
index f4f3368fb..cef855664 100644
--- a/src/clients/Elsa.Api.Client/Models/OrderDirection.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/OrderDirection.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// The order direction.
diff --git a/src/clients/Elsa.Api.Client/Shared/Models/PagedListResponse.cs b/src/clients/Elsa.Api.Client/Shared/Models/PagedListResponse.cs
new file mode 100644
index 000000000..9df005a6f
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Shared/Models/PagedListResponse.cs
@@ -0,0 +1,9 @@
+namespace Elsa.Api.Client.Shared.Models;
+
+///
+/// Represents a generic paged list response that offers a unified format for returning paged list of things from API endpoints.
+///
+/// A page of items.
+/// The total number of items.
+/// The type of the items.
+public record PagedListResponse(ICollection Items, long TotalCount);
\ No newline at end of file
diff --git a/src/clients/Elsa.Api.Client/Models/Position.cs b/src/clients/Elsa.Api.Client/Shared/Models/Position.cs
similarity index 94%
rename from src/clients/Elsa.Api.Client/Models/Position.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Position.cs
index ededacccd..7283a5b65 100644
--- a/src/clients/Elsa.Api.Client/Models/Position.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Position.cs
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a position.
diff --git a/src/clients/Elsa.Api.Client/Models/Size.cs b/src/clients/Elsa.Api.Client/Shared/Models/Size.cs
similarity index 95%
rename from src/clients/Elsa.Api.Client/Models/Size.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/Size.cs
index 2461162b0..9dfa1d6ad 100644
--- a/src/clients/Elsa.Api.Client/Models/Size.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/Size.cs
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents a size.
diff --git a/src/clients/Elsa.Api.Client/Models/VersionOptions.cs b/src/clients/Elsa.Api.Client/Shared/Models/VersionOptions.cs
similarity index 98%
rename from src/clients/Elsa.Api.Client/Models/VersionOptions.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/VersionOptions.cs
index 99e768f3a..344f08df6 100644
--- a/src/clients/Elsa.Api.Client/Models/VersionOptions.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/VersionOptions.cs
@@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
using Elsa.Api.Client.Converters;
using JetBrains.Annotations;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents the version to get.
diff --git a/src/clients/Elsa.Api.Client/Models/VersionedEntity.cs b/src/clients/Elsa.Api.Client/Shared/Models/VersionedEntity.cs
similarity index 94%
rename from src/clients/Elsa.Api.Client/Models/VersionedEntity.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/VersionedEntity.cs
index 3b20a80a1..e00dfd1c5 100644
--- a/src/clients/Elsa.Api.Client/Models/VersionedEntity.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/VersionedEntity.cs
@@ -1,4 +1,4 @@
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents an entity that is versioned.
diff --git a/src/clients/Elsa.Api.Client/Models/WrappedInput.cs b/src/clients/Elsa.Api.Client/Shared/Models/WrappedInput.cs
similarity index 93%
rename from src/clients/Elsa.Api.Client/Models/WrappedInput.cs
rename to src/clients/Elsa.Api.Client/Shared/Models/WrappedInput.cs
index 36183004b..7215e0672 100644
--- a/src/clients/Elsa.Api.Client/Models/WrappedInput.cs
+++ b/src/clients/Elsa.Api.Client/Shared/Models/WrappedInput.cs
@@ -1,6 +1,6 @@
using Elsa.Api.Client.Contracts;
-namespace Elsa.Api.Client.Models;
+namespace Elsa.Api.Client.Shared.Models;
///
/// Represents an input value for an activity.
diff --git a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Endpoint.cs b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Endpoint.cs
index 3f4098864..23f28f691 100644
--- a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Endpoint.cs
+++ b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Endpoint.cs
@@ -36,16 +36,16 @@ internal class List : ElsaEndpoint
private WorkflowDefinitionFilter CreateFilter(Request request)
{
- var versionOptions = request.VersionOptions != null ? VersionOptions.FromString(request.VersionOptions) : default(VersionOptions?);
- var splitIds = request.DefinitionIds ?? Array.Empty();
+ var versionOptions = string.IsNullOrWhiteSpace(request.VersionOptions) ? default(VersionOptions?) : VersionOptions.FromString(request.VersionOptions);
- if (!string.IsNullOrWhiteSpace(request.SearchTerm)) {
- return new WorkflowDefinitionFilter { SearchTerm = request.SearchTerm, VersionOptions = versionOptions };
- }
-
- return splitIds.Any()
- ? new WorkflowDefinitionFilter { DefinitionIds = splitIds, VersionOptions = versionOptions }
- : new WorkflowDefinitionFilter { MaterializerName = request.MaterializerName, VersionOptions = versionOptions };
+ return new WorkflowDefinitionFilter
+ {
+ VersionOptions = versionOptions,
+ SearchTerm = request.SearchTerm?.Trim(),
+ MaterializerName = request.MaterializerName,
+ DefinitionIds = request.DefinitionIds,
+ Ids = request.Ids
+ };
}
private async Task> FindAsync(Request request, WorkflowDefinitionFilter filter, PageArgs pageArgs, CancellationToken cancellationToken)
@@ -58,24 +58,24 @@ internal class List : ElsaEndpoint
{
default:
{
- var order = new WorkflowDefinitionOrder
- {
- KeySelector = p => p.CreatedAt,
- Direction = direction
- };
-
- return await _store.FindSummariesAsync(filter, order, pageArgs, cancellationToken);
- }
- case OrderByWorkflowDefinition.Name:
+ var order = new WorkflowDefinitionOrder
{
- var order = new WorkflowDefinitionOrder
- {
- KeySelector = p => p.Name ?? string.Empty,
- Direction = direction
- };
+ KeySelector = p => p.CreatedAt,
+ Direction = direction
+ };
- return await _store.FindSummariesAsync(filter, order, pageArgs, cancellationToken);
- }
+ return await _store.FindSummariesAsync(filter, order, pageArgs, cancellationToken);
+ }
+ case OrderByWorkflowDefinition.Name:
+ {
+ var order = new WorkflowDefinitionOrder
+ {
+ KeySelector = p => p.Name ?? string.Empty,
+ Direction = direction
+ };
+
+ return await _store.FindSummariesAsync(filter, order, pageArgs, cancellationToken);
+ }
case OrderByWorkflowDefinition.Version:
{
var order = new WorkflowDefinitionOrder
diff --git a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Models.cs b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Models.cs
index f3d006f8a..bbc36e974 100644
--- a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Models.cs
+++ b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/List/Models.cs
@@ -9,6 +9,7 @@ internal class Request
{
public string? VersionOptions { get; set; }
public string[]? DefinitionIds { get; set; }
+ public string[]? Ids { get; set; }
[BindFrom("materializer")] public string? MaterializerName { get; set; }
[BindFrom("label")] public string[]? Labels { get; set; }
public int? Page { get; set; }
diff --git a/src/modules/Elsa.Workflows.Core/State/ActivityExecutionContextState.cs b/src/modules/Elsa.Workflows.Core/State/ActivityExecutionContextState.cs
index d1838f4a3..8ddcf91f8 100644
--- a/src/modules/Elsa.Workflows.Core/State/ActivityExecutionContextState.cs
+++ b/src/modules/Elsa.Workflows.Core/State/ActivityExecutionContextState.cs
@@ -45,6 +45,4 @@ public class ActivityExecutionContextState
/// The evaluated values of the activity's properties.
///
public IDictionary? ActivityState { get; set; }
-
- //public RegisterState Register { get; set; } = default!;
}
\ No newline at end of file