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 d41dcd773..88476b99e 100644 --- a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Contracts/IWorkflowInstancesApi.cs @@ -16,6 +16,24 @@ public interface IWorkflowInstancesApi [Get("/workflow-instances")] Task> ListAsync(ListWorkflowInstancesRequest request, CancellationToken cancellationToken = default); + /// + /// Returns a workflow instance. + /// + /// The ID of the workflow instance to return. + /// The cancellation token. + [Get("/workflow-instances/{id}")] + Task GetAsync(string id, CancellationToken cancellationToken = default); + + /// + /// Returns a workflow instance. + /// + /// The ID of the workflow instance for which to return the journal. + /// The page number. + /// The page size. + /// The cancellation token. + [Get("/workflow-instances/{workflowInstanceId}/journal")] + Task> GetJournalAsync(string workflowInstanceId, int? page = default, int? pageSize = default, CancellationToken cancellationToken = default); + /// /// Deletes a workflow instance. /// diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs index 282fb8316..9f4d36092 100644 --- a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExceptionState.cs @@ -5,7 +5,7 @@ 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) +public record ExceptionState(string Type, string Message, string? StackTrace, ExceptionState? InnerException) { /// /// Initializes a new instance of the class. diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExecutionLogRecord.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExecutionLogRecord.cs new file mode 100644 index 000000000..6c60166e8 --- /dev/null +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Models/ExecutionLogRecord.cs @@ -0,0 +1,30 @@ +namespace Elsa.Api.Client.Resources.WorkflowInstances.Models; + +/// +/// Represents a single execution log record. +/// +/// The ID of the execution log record. +/// The ID of the activity instance associated with the execution log record. +/// The ID of the parent activity instance associated with the execution log record. +/// The ID of the activity associated with the execution log record. +/// The type of the activity associated with the execution log record. +/// The ID of the node associated with the execution log record. +/// The timestamp of the execution log record. +/// The name of the event associated with the execution log record. +/// The message associated with the execution log record. +/// The source of the execution log record. +/// The state of the activity associated with the execution log record. +/// The payload associated with the execution log record. +public record ExecutionLogRecord( + string Id, + string ActivityInstanceId, + string? ParentActivityInstanceId, + string ActivityId, + string ActivityType, + string NodeId, + DateTimeOffset Timestamp, + string? EventName, + string? Message, + string? Source, + IDictionary? ActivityState, + object? Payload); \ No newline at end of file