diff --git a/Elsa.sln b/Elsa.sln
index c1c55e7517..079a69ea42 100644
--- a/Elsa.sln
+++ b/Elsa.sln
@@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution", "solution", "{7D
icon.png = icon.png
NuGet.Config = NuGet.Config
README.md = README.md
+ plan-activityExecutionCallStack.prompt.md = plan-activityExecutionCallStack.prompt.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{0354F050-3992-4DD4-B0EE-5FBA04AC72B6}"
diff --git a/plan-activityExecutionCallStack.prompt.md b/plan-activityExecutionCallStack.prompt.md
new file mode 100644
index 0000000000..4178261fe0
--- /dev/null
+++ b/plan-activityExecutionCallStack.prompt.md
@@ -0,0 +1,212 @@
+# Plan: Activity Execution Call Stack Implementation (Hybrid: explicit + ambient)
+
+This plan implements a comprehensive call stack mechanism to track the execution chain from root workflow through all parent activities to a specific activity execution, enabling visibility into the complete invocation hierarchy when viewing activity execution records.
+
+Core design
+- Explicit predecessor: Activities that know the causal predecessor (e.g., a completed child that schedules the next) set `SchedulingActivityExecutionId` directly via scheduling options.
+- Ambient fallback: During completion callbacks, bookmark resumes, and child-workflow starts, the workflow sets an ambient "current scheduling source" on the `WorkflowExecutionContext`. If a schedule call omits `SchedulingActivityExecutionId`, the scheduler fills it from the ambient. This minimizes code churn while preserving correctness.
+- Structural vs temporal: Keep `Owner`/`ParentActivityExecutionContext` for structural containment; use `SchedulingActivityExecutionId`/`SchedulingWorkflowInstanceId` for the temporal execution chain.
+
+## Steps
+
+### 1. Add call stack fields to scheduling models throughout the chain
+
+Add `SchedulingActivityExecutionId` (nullable `string`) to:
+- [`ScheduleWorkOptions`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Options/ScheduleWorkOptions.cs)
+- [`ScheduledActivityOptions`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Models/ScheduledActivityOptions.cs)
+- [`ActivityWorkItem`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Models/ActivityWorkItem.cs)
+- [`ActivityInvocationOptions`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Options/ActivityInvocationOptions.cs)
+
+Include clear XML documentation explaining this tracks the temporal/execution predecessor (distinct from structural `Owner`/`ParentActivityExecutionContext`).
+
+Update all constructors and property mappings in:
+- [`WorkflowExecutionContextSchedulerStrategy.Schedule`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Services/WorkflowExecutionContextSchedulerStrategy.cs)
+- [`DefaultActivitySchedulerMiddleware.ExecuteWorkItemAsync`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Middleware/Workflows/DefaultActivitySchedulerMiddleware.cs)
+
+Thread this value through the scheduling chain.
+
+### 2. Store call stack fields in runtime and persisted contexts
+
+Add the following fields to [`ActivityExecutionContext`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Contexts/ActivityExecutionContext.cs):
+- `SchedulingActivityExecutionId` (nullable `string`)
+- `SchedulingActivityId` (nullable `string` - denormalized for convenience)
+- `SchedulingWorkflowInstanceId` (nullable `string` - for cross-workflow tracking)
+
+Include XML comments distinguishing these from `ParentActivityExecutionContext`:
+- **`ParentActivityExecutionContext`**: The structural container activity (e.g., Flowchart contains all its children). Represents the hierarchical parent in the workflow structure.
+- **`SchedulingActivityExecutionId`**: The temporal/execution predecessor that directly triggered execution of this activity. Tracks the execution sequence, not the structural hierarchy.
+- **`SchedulingWorkflowInstanceId`**: The workflow instance ID of the activity that invoked this activity's workflow. Set when crossing workflow boundaries (e.g., via `ExecuteWorkflow` or `DispatchWorkflow`).
+
+Update [`WorkflowExecutionContext.CreateActivityExecutionContextAsync`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs) to accept and store these fields from `ActivityInvocationOptions`.
+
+Add corresponding fields to [`ActivityExecutionRecord`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Entities/ActivityExecutionRecord.cs):
+- `SchedulingActivityExecutionId` (nullable `string`)
+- `SchedulingActivityId` (nullable `string`)
+- `SchedulingWorkflowInstanceId` (nullable `string`)
+- `CallStackDepth` (nullable `int`)
+
+Update [`DefaultActivityExecutionMapper.MapAsync`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs) to populate these fields from the execution context. Calculate `CallStackDepth` by traversing the `SchedulingActivityExecutionId` chain until reaching null.
+
+### 3. Add ambient scheduling source to the workflow context
+
+Add an ambient scheduling source to [`WorkflowExecutionContext`]:
+- Fields (transient): `CurrentSchedulingActivityExecutionId`, `CurrentSchedulingWorkflowInstanceId`.
+- API: `IDisposable BeginSchedulingScope(string? activityExecutionId, string? workflowInstanceId)` that pushes values and restores previous values on dispose.
+
+Set ambient scope in these places:
+- Around owner completion callbacks (where next activities are scheduled).
+- Around bookmark-resume handlers (background completions resuming the workflow).
+- At child-workflow start (root activity creation).
+
+Modify [`WorkflowExecutionContextSchedulerStrategy.Schedule`] to set `SchedulingActivityExecutionId` and `SchedulingWorkflowInstanceId` from `ScheduleWorkOptions` if provided; otherwise fall back to the ambient `WorkflowExecutionContext` values.
+
+### 4. Update composite activities to capture scheduling activity context
+
+In [`Flowchart.Counters.cs`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Activities/Flowchart/Activities/Flowchart.Counters.cs):
+- Update `ScheduleOutboundActivityAsync` to populate `ScheduleWorkOptions.SchedulingActivityExecutionId = completedActivityContext.Id` when a completed activity schedules its outbound activities.
+- Update `MaybeScheduleBackwardConnectionActivityAsync` to include `SchedulingActivityExecutionId` in the `ScheduleWorkOptions`.
+- Update `MaybeScheduleWaitAllActivityAsync`, `MaybeScheduleWaitAllActiveActivityAsync`, `MaybeScheduleWaitAnyActivityAsync` to pass `SchedulingActivityExecutionId` when scheduling.
+
+In [`Flowchart.Tokens.cs`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Core/Activities/Flowchart/Activities/Flowchart.Tokens.cs):
+- Update `OnChildCompletedTokenBasedLogicAsync` to pass `SchedulingActivityExecutionId` in `ScheduleWorkOptions` when scheduling subsequent activities.
+
+Apply the same pattern to other composite activities:
+- `Sequence`
+- `ForEach`
+- `Parallel`
+- `While`
+- `Do`
+- Any other activities that schedule child activities based on completion
+
+When scheduling a child activity that was directly triggered by another activity's completion, set `SchedulingActivityExecutionId` to the completing activity's execution context ID. When omitted, the ambient scope ensures a sensible fallback.
+
+### 5. Handle cross-workflow call stack linkage (span by default)
+
+For [`ExecuteWorkflow`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Activities/ExecuteWorkflow.cs) and [`DispatchWorkflow`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Activities/DispatchWorkflow.cs):
+
+- Capture the calling activity's `ExecutionId` and current `WorkflowInstanceId`.
+- Pass them through `RunWorkflowOptions` and `DispatchWorkflowRequest` to the child workflow.
+- When the child workflow starts, set the first activity's:
+ - `SchedulingActivityExecutionId` to the parent's invocation activity's execution ID.
+ - `SchedulingWorkflowInstanceId` to the parent workflow instance ID.
+- Also set the ambient scope (`BeginSchedulingScope`) for the duration of child start so subsequent schedules inherit these values by default.
+
+Cross-workflow chains should be considered part of the call stack by default (span by default).
+
+### 6. Add call stack depth and create database migration
+
+Add `CallStackDepth` (nullable `int`) field to [`ActivityExecutionRecord`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Entities/ActivityExecutionRecord.cs).
+
+In [`DefaultActivityExecutionMapper.MapAsync`](file:///Users/sipke/Projects/Elsa/elsa-core/main/src/modules/Elsa.Workflows.Runtime/Services/DefaultActivityExecutionMapper.cs):
+- Calculate `CallStackDepth` by traversing the source `ActivityExecutionContext.SchedulingActivityExecutionId` chain until reaching null.
+- Use root depth = 0 (documented convention).
+- Store this value in the `ActivityExecutionRecord`.
+
+Create EF Core migration adding indexed columns to `ActivityExecutionRecord` table:
+- `SchedulingActivityExecutionId` (indexed, nullable)
+- `SchedulingActivityId` (indexed, nullable)
+- `SchedulingWorkflowInstanceId` (indexed, nullable)
+- `CallStackDepth` (indexed, nullable)
+
+The `CallStackDepth` index enables efficient filtering by execution depth without reconstructing the full chain (e.g., "show me all activities at depth > 5").
+
+### 7. Implement call stack query and reconstruction APIs
+
+Implement `IActivityExecutionStore.GetExecutionChainAsync(string activityExecutionId, bool includeCrossWorkflowChain = true, int? skip = null, int? take = null)` that:
+- Recursively queries `SchedulingActivityExecutionId` until reaching root (null).
+- Follows `SchedulingWorkflowInstanceId` across workflow boundaries by default (span by default). Optionally allow disabling cross-workflow span via parameter.
+- Supports pagination via `skip` and `take` parameters to handle deep call stacks efficiently.
+- Returns a paginated result containing:
+ - `Items`: List of execution records (ordered from root to current activity, or subset if paginated)
+ - `TotalCount`: Total number of items in the full chain
+ - `Skip`: The skip value used
+ - `Take`: The take value used
+- When pagination is not specified (`skip` and `take` are null), returns the full chain.
+
+Add extension methods:
+- **`ActivityExecutionContext.GetExecutionChain(int? skip = null, int? take = null)`**: Reconstruct the runtime call stack by traversing `SchedulingActivityExecutionId`, returning a paginated result from root to current activity.
+- **`ActivityExecutionRecord.GetExecutionChainAsync(IActivityExecutionStore, bool includeCrossWorkflowChain = true, int? skip = null, int? take = null)`**: Reconstruct persisted call stacks by querying the store with pagination support.
+
+Both methods should return results ordered from root to current activity, with pagination applied after ordering.
+
+Add REST API endpoint:
+- **`GET /api/workflow-instances/{workflowInstanceId}/activity-executions/{activityExecutionId}/call-chain`**
+ - Query parameters:
+ - `includeCrossWorkflowChain` (bool, default: true): Include parent workflow activities across workflow boundaries
+ - `skip` (int?, optional): Number of items to skip (for pagination)
+ - `take` (int?, optional): Number of items to return (for pagination, recommended max: 100)
+ - Response:
+ - `items`: Array of activity execution records
+ - `totalCount`: Total number of items in the full chain
+ - `skip`: The skip value used
+ - `take`: The take value used (or null if full chain returned)
+ - This enables UI to implement paginated/lazy loading for deep call stacks.
+
+## Further Considerations
+
+### 1. Structural vs temporal hierarchy documentation
+
+`ParentActivityExecutionContext` represents the structural container (e.g., Flowchart contains all its children), while `SchedulingActivityExecutionId` tracks the temporal execution predecessor (e.g., Activity B completed and directly triggered Activity C).
+
+These are orthogonal relationships:
+- A Flowchart can own many children (structural), but only a predecessor directly triggers the next (temporal).
+- When Activity B completes, it schedules the next child, establishing a temporal link via `SchedulingActivityExecutionId`.
+
+All XML comments for these fields should explicitly clarify this distinction to prevent developer confusion and misuse.
+
+### 2. Ambient scope guardrails
+
+- The ambient scope must be short-lived and always disposed via `using`/`finally` to avoid leakage between unrelated scheduling operations.
+- The scheduler should prefer explicit `ScheduleWorkOptions.SchedulingActivityExecutionId`/`SchedulingWorkflowInstanceId` and only fall back to ambient when not provided.
+- Document that the ambient exists to reduce boilerplate and should not be relied upon when explicit causal context is readily available.
+
+### 3. Cross-workflow boundary reconstruction (default span)
+
+`SchedulingWorkflowInstanceId` enables reconstructing call stacks that span multiple workflow instances:
+- Parent Workflow (Instance A) → ExecuteWorkflow activity (in Instance A) → Child Workflow (Instance B) → failing activity (in Instance B).
+
+Since span is the default, cross-instance traversal should occur unless explicitly disabled.
+
+### 4. Call stack depth optimization trade-offs
+
+Storing `CallStackDepth` trades a small amount of storage for simpler, faster queries and analytics:
+
+**Benefits:**
+- Efficient filtering by depth ranges (e.g., "depth > 5").
+- Early termination in chain reconstruction.
+- Index-based analytics queries.
+- Lower storage than persisting full chains.
+
+**Drawbacks:**
+- `CallStackDepth` becomes stale if parent records are deleted or altered post-hoc. Prefer immutable execution records.
+- Document that `CallStackDepth` is an optimization hint for querying, not an authoritative source if retention policies prune ancestors.
+
+### 5. Testing matrix
+
+- Sequential flow: A → B → C (explicit predecessor set, ambient unused).
+- Parallel fan-out: A schedules B and C (both record A as predecessor; ambient vs explicit).
+- Nested composites: Multiple owners scheduling into the same queue.
+- Background resume: Bookmark-based resumes interleaving with other work; ambient set during resume.
+- Cross-workflow: Execute/Dispatch child workflow; default spanning chain.
+- Deduplication scenarios: `PreventDuplicateScheduling` and re-scheduling.
+- Persistence/round-trips: Background/persisted scheduled activities using `ScheduledActivityOptions`.
+- Deep call stacks: Test pagination with chains deeper than 100 activities.
+- Cross-workflow pagination: Ensure pagination works correctly when spanning workflow boundaries.
+
+### 6. Performance and pagination considerations
+
+**Deep call stack handling:**
+- For very deep call stacks (e.g., recursive workflows or long-running sequential processes), retrieving the entire chain in a single query can be expensive.
+- Pagination (`skip`/`take`) enables efficient loading in the UI with incremental/lazy loading patterns.
+- Recommend default `take` of 50-100 items per page for REST API calls.
+- The `CallStackDepth` field enables quick assessment of chain depth before deciding whether to paginate.
+
+**Query optimization strategies:**
+- Use indexed lookups on `SchedulingActivityExecutionId` to traverse the chain efficiently.
+- Consider caching strategies for frequently accessed chains (e.g., recently failed activities).
+- For cross-workflow queries, implement efficient join strategies or batched lookups to minimize round-trips.
+- Document that pagination is "forward-only" (skip/take from root toward current) to align with typical debugging workflows (start at root, drill down).
+
+**REST API rate limiting:**
+- Consider rate limiting on the call chain endpoint if it becomes a performance bottleneck.
+- Monitor query performance and adjust default pagination sizes based on observed data.
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Contracts/IActivityExecutionsApi.cs b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Contracts/IActivityExecutionsApi.cs
index 2238c81621..65266fb05d 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Contracts/IActivityExecutionsApi.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Contracts/IActivityExecutionsApi.cs
@@ -45,4 +45,16 @@ public interface IActivityExecutionsApi
/// The activity execution.
[Get("/activity-executions/{id}")]
Task GetAsync(string id, CancellationToken cancellationToken = default);
-}
\ No newline at end of file
+
+ ///
+ /// Gets the call stack (execution chain) for a given activity execution.
+ ///
+ /// The ID of the activity execution.
+ /// Whether to include parent workflow activities across workflow boundaries.
+ /// The number of items to skip (for pagination).
+ /// The maximum number of items to return (for pagination).
+ /// An optional cancellation token.
+ /// The response containing the call stack.
+ [Get("/activity-executions/{id}/call-stack")]
+ Task GetCallStackAsync(string id, bool? includeCrossWorkflowChain = null, int? skip = null, int? take = null, CancellationToken cancellationToken = default);
+}
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionCallStack.cs b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionCallStack.cs
new file mode 100644
index 0000000000..a261655245
--- /dev/null
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionCallStack.cs
@@ -0,0 +1,22 @@
+namespace Elsa.Api.Client.Resources.ActivityExecutions.Models;
+
+///
+/// Represents a call stack (execution chain) for a given activity execution.
+///
+public class ActivityExecutionCallStack
+{
+ ///
+ /// The ID of the activity execution that was requested.
+ ///
+ public string ActivityExecutionId { get; set; } = null!;
+
+ ///
+ /// The activity execution records in the call stack (ordered from root to current activity).
+ ///
+ public ICollection Items { get; set; } = new List();
+
+ ///
+ /// The total number of items in the full call stack chain.
+ ///
+ public long TotalCount { get; set; }
+}
diff --git a/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionRecord.cs b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionRecord.cs
index c3ac7c87c8..81346b9994 100644
--- a/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionRecord.cs
+++ b/src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionRecord.cs
@@ -85,9 +85,37 @@ public class ActivityExecutionRecord : Entity
/// Gets or sets the status of the activity.
///
public ActivityStatus Status { get; set; }
+
+ ///
+ /// Gets or sets the aggregated count of faults encountered during the execution of the activity instance and its descendants.
+ ///
+ public int AggregateFaultCount { get; set; }
///
/// Gets or sets the time at which the activity execution completed.
///
public DateTimeOffset? CompletedAt { get; set; }
-}
\ No newline at end of file
+
+ ///
+ /// The ID of the activity execution context that scheduled this activity execution.
+ /// This represents the temporal/execution predecessor that directly triggered execution of this activity.
+ ///
+ public string? SchedulingActivityExecutionId { get; set; }
+
+ ///
+ /// The ID of the activity that scheduled this activity execution (denormalized for convenience).
+ ///
+ public string? SchedulingActivityId { get; set; }
+
+ ///
+ /// The workflow instance ID of the workflow that scheduled this activity execution.
+ /// This is set when crossing workflow boundaries (e.g., via ExecuteWorkflow or DispatchWorkflow).
+ ///
+ public string? SchedulingWorkflowInstanceId { get; set; }
+
+ ///
+ /// The depth of this activity in the call stack (0 for root activities).
+ /// Calculated by traversing the SchedulingActivityExecutionId chain until reaching null.
+ ///
+ public int? CallStackDepth { get; set; }
+}
diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.Designer.cs
new file mode 100644
index 0000000000..7c4a0dc74b
--- /dev/null
+++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.Designer.cs
@@ -0,0 +1,522 @@
+//
+using System;
+using Elsa.Persistence.EFCore.Modules.Runtime;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
+{
+ [DbContext(typeof(RuntimeElsaDbContext))]
+ [Migration("20260122123013_V3_7")]
+ partial class V3_7
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "9.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedValue")
+ .IsRequired()
+ .HasColumnType("longtext");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId");
+
+ b.ToTable("KeyValuePairs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityName")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityNodeId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityType")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityTypeVersion")
+ .HasColumnType("int");
+
+ b.Property("AggregateFaultCount")
+ .HasColumnType("int");
+
+ b.Property("CallStackDepth")
+ .HasColumnType("int");
+
+ b.Property("CompletedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("HasBookmarks")
+ .HasColumnType("tinyint(1)");
+
+ b.Property("SchedulingActivityExecutionId")
+ .HasColumnType("longtext");
+
+ b.Property("SchedulingActivityId")
+ .HasColumnType("longtext");
+
+ b.Property("SchedulingWorkflowInstanceId")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedActivityState")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedActivityStateCompressionAlgorithm")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedException")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedOutputs")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedProperties")
+ .HasColumnType("longtext");
+
+ b.Property("StartedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId");
+
+ b.HasIndex("ActivityName")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
+
+ b.HasIndex("ActivityNodeId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
+
+ b.HasIndex("ActivityType")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
+
+ b.HasIndex("ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt");
+
+ b.HasIndex("HasBookmarks")
+ .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_ActivityExecutionRecord_Status");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_TenantId");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId");
+
+ b.HasIndex("ActivityType", "ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion");
+
+ b.ToTable("ActivityExecutionRecords", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityTypeName")
+ .HasColumnType("varchar(255)");
+
+ b.Property("BookmarkId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("SerializedOptions")
+ .HasColumnType("longtext");
+
+ b.Property("StimulusHash")
+ .HasColumnType("varchar(255)");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName");
+
+ b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId");
+
+ b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt");
+
+ b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId");
+
+ b.ToTable("BookmarkQueueItems", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityTypeName")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("longtext");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("longtext");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt");
+
+ b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash");
+
+ b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name");
+
+ b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash");
+
+ b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId");
+
+ b.ToTable("Bookmarks", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("Hash")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Name")
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("longtext");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Hash")
+ .HasDatabaseName("IX_StoredTrigger_Hash");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_StoredTrigger_Name");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_StoredTrigger_TenantId");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId");
+
+ b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId")
+ .IsUnique()
+ .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId");
+
+ b.ToTable("Triggers", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityName")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityNodeId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityType")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityTypeVersion")
+ .HasColumnType("int");
+
+ b.Property("EventName")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Message")
+ .HasColumnType("longtext");
+
+ b.Property("ParentActivityInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Sequence")
+ .HasColumnType("bigint");
+
+ b.Property("SerializedActivityState")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("longtext");
+
+ b.Property("Source")
+ .HasColumnType("longtext");
+
+ b.Property("TenantId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("Timestamp")
+ .HasColumnType("datetime(6)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("WorkflowVersion")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId");
+
+ b.HasIndex("ActivityInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId");
+
+ b.HasIndex("ActivityName")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
+
+ b.HasIndex("ActivityNodeId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
+
+ b.HasIndex("ActivityType")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
+
+ b.HasIndex("ActivityTypeVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion");
+
+ b.HasIndex("EventName")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName");
+
+ b.HasIndex("ParentActivityInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId");
+
+ b.HasIndex("Sequence")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId");
+
+ b.HasIndex("Timestamp")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId");
+
+ b.HasIndex("WorkflowVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion");
+
+ b.HasIndex("ActivityType", "ActivityTypeVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion");
+
+ b.HasIndex("Timestamp", "Sequence")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence");
+
+ b.ToTable("WorkflowExecutionLogRecords", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("ActivityTypeName")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("varchar(255)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("datetime(6)");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("varchar(255)");
+
+ b.Property("SerializedBookmarkPayload")
+ .HasColumnType("longtext");
+
+ b.Property("SerializedInput")
+ .HasColumnType("longtext");
+
+ b.Property("TenantId")
+ .HasColumnType("longtext");
+
+ b.Property("WorkflowInstanceId")
+ .HasColumnType("varchar(255)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName");
+
+ b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt");
+
+ b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt");
+
+ b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId");
+
+ b.ToTable("WorkflowInboxMessages", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.cs
new file mode 100644
index 0000000000..84c98e2a4d
--- /dev/null
+++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/20260122123013_V3_7.cs
@@ -0,0 +1,77 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.Persistence.EFCore.MySql.Migrations.Runtime
+{
+ ///
+ public partial class V3_7 : Migration
+ {
+ private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
+
+ ///
+ public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "CallStackDepth",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "int",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingActivityExecutionId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingActivityId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingWorkflowInstanceId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "longtext",
+ nullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "CallStackDepth",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingActivityExecutionId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingActivityId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingWorkflowInstanceId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+ }
+ }
+}
diff --git a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
index f7add71af7..028fa234ad 100644
--- a/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
+++ b/src/modules/Elsa.Persistence.EFCore.MySql/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
@@ -68,12 +68,24 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property("AggregateFaultCount")
.HasColumnType("int");
+ b.Property("CallStackDepth")
+ .HasColumnType("int");
+
b.Property("CompletedAt")
.HasColumnType("datetime(6)");
b.Property("HasBookmarks")
.HasColumnType("tinyint(1)");
+ b.Property("SchedulingActivityExecutionId")
+ .HasColumnType("longtext");
+
+ b.Property("SchedulingActivityId")
+ .HasColumnType("longtext");
+
+ b.Property("SchedulingWorkflowInstanceId")
+ .HasColumnType("longtext");
+
b.Property("SerializedActivityState")
.HasColumnType("longtext");
diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.Designer.cs
new file mode 100644
index 0000000000..3e903ac43e
--- /dev/null
+++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.Designer.cs
@@ -0,0 +1,523 @@
+//
+using System;
+using Elsa.Persistence.EFCore.Modules.Runtime;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Oracle.EntityFrameworkCore.Metadata;
+
+#nullable disable
+
+namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
+{
+ [DbContext(typeof(RuntimeElsaDbContext))]
+ [Migration("20260122123056_V3_7")]
+ partial class V3_7
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "9.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ OracleModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("SerializedValue")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId");
+
+ b.ToTable("KeyValuePairs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityName")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityNodeId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityType")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityTypeVersion")
+ .HasColumnType("NUMBER(10)");
+
+ b.Property("AggregateFaultCount")
+ .HasColumnType("NUMBER(10)");
+
+ b.Property("CallStackDepth")
+ .HasColumnType("NUMBER(10)");
+
+ b.Property("CompletedAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("HasBookmarks")
+ .HasColumnType("BOOLEAN");
+
+ b.Property("SchedulingActivityExecutionId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SchedulingActivityId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SchedulingWorkflowInstanceId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedActivityState")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedActivityStateCompressionAlgorithm")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedException")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedOutputs")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedProperties")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("StartedAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId");
+
+ b.HasIndex("ActivityName")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
+
+ b.HasIndex("ActivityNodeId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
+
+ b.HasIndex("ActivityType")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
+
+ b.HasIndex("ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt");
+
+ b.HasIndex("HasBookmarks")
+ .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_ActivityExecutionRecord_Status");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_TenantId");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId");
+
+ b.HasIndex("ActivityType", "ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion");
+
+ b.ToTable("ActivityExecutionRecords", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityTypeName")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("BookmarkId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("SerializedOptions")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("StimulusHash")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName");
+
+ b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId");
+
+ b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt");
+
+ b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId");
+
+ b.ToTable("BookmarkQueueItems", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityTypeName")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Name")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt");
+
+ b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash");
+
+ b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name");
+
+ b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash");
+
+ b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId");
+
+ b.ToTable("Bookmarks", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Hash")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Name")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Hash")
+ .HasDatabaseName("IX_StoredTrigger_Hash");
+
+ b.HasIndex("Name")
+ .HasDatabaseName("IX_StoredTrigger_Name");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_StoredTrigger_TenantId");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("IX_StoredTrigger_WorkflowDefinitionVersionId");
+
+ b.HasIndex("WorkflowDefinitionId", "Hash", "ActivityId")
+ .IsUnique()
+ .HasDatabaseName("IX_StoredTrigger_Unique_WorkflowDefinitionId_Hash_ActivityId")
+ .HasFilter("\"Hash\" IS NOT NULL");
+
+ b.ToTable("Triggers", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowExecutionLogRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityInstanceId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityName")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityNodeId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityType")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityTypeVersion")
+ .HasColumnType("NUMBER(10)");
+
+ b.Property("EventName")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Message")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("ParentActivityInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Sequence")
+ .HasColumnType("NUMBER(19)");
+
+ b.Property("SerializedActivityState")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("Source")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("Timestamp")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("WorkflowDefinitionId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowDefinitionVersionId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("WorkflowVersion")
+ .HasColumnType("NUMBER(10)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityId");
+
+ b.HasIndex("ActivityInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityInstanceId");
+
+ b.HasIndex("ActivityName")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityName");
+
+ b.HasIndex("ActivityNodeId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityNodeId");
+
+ b.HasIndex("ActivityType")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType");
+
+ b.HasIndex("ActivityTypeVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityTypeVersion");
+
+ b.HasIndex("EventName")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_EventName");
+
+ b.HasIndex("ParentActivityInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ParentActivityInstanceId");
+
+ b.HasIndex("Sequence")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Sequence");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_TenantId");
+
+ b.HasIndex("Timestamp")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp");
+
+ b.HasIndex("WorkflowDefinitionId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionId");
+
+ b.HasIndex("WorkflowDefinitionVersionId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowInstanceId");
+
+ b.HasIndex("WorkflowVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_WorkflowVersion");
+
+ b.HasIndex("ActivityType", "ActivityTypeVersion")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion");
+
+ b.HasIndex("Timestamp", "Sequence")
+ .HasDatabaseName("IX_WorkflowExecutionLogRecord_Timestamp_Sequence");
+
+ b.ToTable("WorkflowExecutionLogRecords", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.WorkflowInboxMessage", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("ActivityTypeName")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("CorrelationId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.Property("SerializedBookmarkPayload")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SerializedInput")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("TenantId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("WorkflowInstanceId")
+ .HasColumnType("NVARCHAR2(450)");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_WorkflowInboxMessage_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_WorkflowInboxMessage_ActivityTypeName");
+
+ b.HasIndex(new[] { "CorrelationId" }, "IX_WorkflowInboxMessage_CorrelationId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_WorkflowInboxMessage_CreatedAt");
+
+ b.HasIndex(new[] { "ExpiresAt" }, "IX_WorkflowInboxMessage_ExpiresAt");
+
+ b.HasIndex(new[] { "Hash" }, "IX_WorkflowInboxMessage_Hash");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_WorkflowInboxMessage_WorkflowInstanceId");
+
+ b.ToTable("WorkflowInboxMessages", "Elsa");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.cs
new file mode 100644
index 0000000000..e1d892977a
--- /dev/null
+++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/20260122123056_V3_7.cs
@@ -0,0 +1,74 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Elsa.Persistence.EFCore.Oracle.Migrations.Runtime
+{
+ ///
+ public partial class V3_7 : Migration
+ {
+ private readonly Elsa.Persistence.EFCore.IElsaDbContextSchema _schema;
+
+ ///
+ public V3_7(Elsa.Persistence.EFCore.IElsaDbContextSchema schema)
+ {
+ _schema = schema;
+ }
+
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "CallStackDepth",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "NUMBER(10)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingActivityExecutionId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "NVARCHAR2(2000)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingActivityId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "NVARCHAR2(2000)",
+ nullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "SchedulingWorkflowInstanceId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords",
+ type: "NVARCHAR2(2000)",
+ nullable: true);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "CallStackDepth",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingActivityExecutionId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingActivityId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+
+ migrationBuilder.DropColumn(
+ name: "SchedulingWorkflowInstanceId",
+ schema: _schema.Schema,
+ table: "ActivityExecutionRecords");
+ }
+ }
+}
diff --git a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
index cdee3d63e3..f348912f6a 100644
--- a/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
+++ b/src/modules/Elsa.Persistence.EFCore.Oracle/Migrations/Runtime/RuntimeElsaDbContextModelSnapshot.cs
@@ -68,12 +68,24 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property("AggregateFaultCount")
.HasColumnType("NUMBER(10)");
+ b.Property("CallStackDepth")
+ .HasColumnType("NUMBER(10)");
+
b.Property("CompletedAt")
.HasColumnType("TIMESTAMP(7) WITH TIME ZONE");
b.Property("HasBookmarks")
.HasColumnType("BOOLEAN");
+ b.Property("SchedulingActivityExecutionId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SchedulingActivityId")
+ .HasColumnType("NVARCHAR2(2000)");
+
+ b.Property("SchedulingWorkflowInstanceId")
+ .HasColumnType("NVARCHAR2(2000)");
+
b.Property("SerializedActivityState")
.HasColumnType("NCLOB");
diff --git a/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260122123049_V3_7.Designer.cs b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260122123049_V3_7.Designer.cs
new file mode 100644
index 0000000000..3120b6882e
--- /dev/null
+++ b/src/modules/Elsa.Persistence.EFCore.PostgreSql/Migrations/Runtime/20260122123049_V3_7.Designer.cs
@@ -0,0 +1,522 @@
+//
+using System;
+using Elsa.Persistence.EFCore.Modules.Runtime;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Elsa.Persistence.EFCore.PostgreSql.Migrations.Runtime
+{
+ [DbContext(typeof(RuntimeElsaDbContext))]
+ [Migration("20260122123049_V3_7")]
+ partial class V3_7
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("Elsa")
+ .HasAnnotation("ProductVersion", "9.0.11")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Elsa.KeyValues.Entities.SerializedKeyValuePair", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("SerializedValue")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TenantId")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_SerializedKeyValuePair_TenantId");
+
+ b.ToTable("KeyValuePairs", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.ActivityExecutionRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ActivityName")
+ .HasColumnType("text");
+
+ b.Property("ActivityNodeId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ActivityType")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ActivityTypeVersion")
+ .HasColumnType("integer");
+
+ b.Property("AggregateFaultCount")
+ .HasColumnType("integer");
+
+ b.Property("CallStackDepth")
+ .HasColumnType("integer");
+
+ b.Property("CompletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("HasBookmarks")
+ .HasColumnType("boolean");
+
+ b.Property("SchedulingActivityExecutionId")
+ .HasColumnType("text");
+
+ b.Property("SchedulingActivityId")
+ .HasColumnType("text");
+
+ b.Property("SchedulingWorkflowInstanceId")
+ .HasColumnType("text");
+
+ b.Property("SerializedActivityState")
+ .HasColumnType("text");
+
+ b.Property("SerializedActivityStateCompressionAlgorithm")
+ .HasColumnType("text");
+
+ b.Property("SerializedException")
+ .HasColumnType("text");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("text");
+
+ b.Property("SerializedOutputs")
+ .HasColumnType("text");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("text");
+
+ b.Property("SerializedProperties")
+ .HasColumnType("text");
+
+ b.Property("StartedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TenantId")
+ .HasColumnType("text");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ActivityId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityId");
+
+ b.HasIndex("ActivityName")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityName");
+
+ b.HasIndex("ActivityNodeId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityNodeId");
+
+ b.HasIndex("ActivityType")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType");
+
+ b.HasIndex("ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityTypeVersion");
+
+ b.HasIndex("CompletedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_CompletedAt");
+
+ b.HasIndex("HasBookmarks")
+ .HasDatabaseName("IX_ActivityExecutionRecord_HasBookmarks");
+
+ b.HasIndex("StartedAt")
+ .HasDatabaseName("IX_ActivityExecutionRecord_StartedAt");
+
+ b.HasIndex("Status")
+ .HasDatabaseName("IX_ActivityExecutionRecord_Status");
+
+ b.HasIndex("TenantId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_TenantId");
+
+ b.HasIndex("WorkflowInstanceId")
+ .HasDatabaseName("IX_ActivityExecutionRecord_WorkflowInstanceId");
+
+ b.HasIndex("ActivityType", "ActivityTypeVersion")
+ .HasDatabaseName("IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion");
+
+ b.ToTable("ActivityExecutionRecords", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.BookmarkQueueItem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("text");
+
+ b.Property("ActivityTypeName")
+ .HasColumnType("text");
+
+ b.Property("BookmarkId")
+ .HasColumnType("text");
+
+ b.Property("CorrelationId")
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("SerializedOptions")
+ .HasColumnType("text");
+
+ b.Property("StimulusHash")
+ .HasColumnType("text");
+
+ b.Property("TenantId")
+ .HasColumnType("text");
+
+ b.Property("WorkflowInstanceId")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_BookmarkQueueItem_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_BookmarkQueueItem_ActivityTypeName");
+
+ b.HasIndex(new[] { "BookmarkId" }, "IX_BookmarkQueueItem_BookmarkId");
+
+ b.HasIndex(new[] { "CorrelationId" }, "IX_BookmarkQueueItem_CorrelationId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_BookmarkQueueItem_CreatedAt");
+
+ b.HasIndex(new[] { "StimulusHash" }, "IX_BookmarkQueueItem_StimulusHash");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_BookmarkQueueItem_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_BookmarkQueueItem_WorkflowInstanceId");
+
+ b.ToTable("BookmarkQueueItems", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredBookmark", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ActivityInstanceId")
+ .HasColumnType("text");
+
+ b.Property("ActivityTypeName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CorrelationId")
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("SerializedMetadata")
+ .HasColumnType("text");
+
+ b.Property("SerializedPayload")
+ .HasColumnType("text");
+
+ b.Property("TenantId")
+ .HasColumnType("text");
+
+ b.Property("WorkflowInstanceId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "ActivityInstanceId" }, "IX_StoredBookmark_ActivityInstanceId");
+
+ b.HasIndex(new[] { "ActivityTypeName" }, "IX_StoredBookmark_ActivityTypeName");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash" }, "IX_StoredBookmark_ActivityTypeName_Hash");
+
+ b.HasIndex(new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "CreatedAt" }, "IX_StoredBookmark_CreatedAt");
+
+ b.HasIndex(new[] { "Hash" }, "IX_StoredBookmark_Hash");
+
+ b.HasIndex(new[] { "Name" }, "IX_StoredBookmark_Name");
+
+ b.HasIndex(new[] { "Name", "Hash" }, "IX_StoredBookmark_Name_Hash");
+
+ b.HasIndex(new[] { "Name", "Hash", "WorkflowInstanceId" }, "IX_StoredBookmark_Name_Hash_WorkflowInstanceId");
+
+ b.HasIndex(new[] { "TenantId" }, "IX_StoredBookmark_TenantId");
+
+ b.HasIndex(new[] { "WorkflowInstanceId" }, "IX_StoredBookmark_WorkflowInstanceId");
+
+ b.ToTable("Bookmarks", "Elsa");
+ });
+
+ modelBuilder.Entity("Elsa.Workflows.Runtime.Entities.StoredTrigger", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ActivityId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Hash")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property