diff --git a/src/modules/Elsa.Workflows.Core/Builders/WorkflowBuilder.cs b/src/modules/Elsa.Workflows.Core/Builders/WorkflowBuilder.cs
index b3e78b665..d3b390dd4 100644
--- a/src/modules/Elsa.Workflows.Core/Builders/WorkflowBuilder.cs
+++ b/src/modules/Elsa.Workflows.Core/Builders/WorkflowBuilder.cs
@@ -38,6 +38,9 @@ public class WorkflowBuilder : IWorkflowBuilder
///
public string? Description { get; set; }
+ ///
+ public bool IsReadonly { get; set; }
+
///
public IActivity? Root { get; set; }
@@ -135,7 +138,7 @@ public class WorkflowBuilder : IWorkflowBuilder
var identity = new WorkflowIdentity(definitionId, Version, id);
var publication = WorkflowPublication.LatestAndPublished;
var workflowMetadata = new WorkflowMetadata(Name, Description);
- var workflow = new Workflow(identity, publication, workflowMetadata, WorkflowOptions, root, Variables, Inputs, Outputs, Outcomes, CustomProperties);
+ var workflow = new Workflow(identity, publication, workflowMetadata, WorkflowOptions, root, Variables, Inputs, Outputs, Outcomes, CustomProperties, IsReadonly);
// If a Result variable is defined, install it into the workflow so we can capture the output into it.
if (Result != null)
diff --git a/src/modules/Elsa.Workflows.Core/Contracts/IWorkflowBuilder.cs b/src/modules/Elsa.Workflows.Core/Contracts/IWorkflowBuilder.cs
index 71c8d9fd3..8280ad733 100644
--- a/src/modules/Elsa.Workflows.Core/Contracts/IWorkflowBuilder.cs
+++ b/src/modules/Elsa.Workflows.Core/Contracts/IWorkflowBuilder.cs
@@ -31,7 +31,13 @@ public interface IWorkflowBuilder
/// A description of the workflow.
///
string? Description { get; set; }
-
+
+
+ ///
+ /// WorkflowDefinition is readonly.
+ ///
+ bool IsReadonly { get; set; }
+
///
/// Options for the workflow being built.
///
diff --git a/src/modules/Elsa.Workflows.Core/Models/Workflow.cs b/src/modules/Elsa.Workflows.Core/Models/Workflow.cs
index a3cbd2ca6..93672d8d6 100644
--- a/src/modules/Elsa.Workflows.Core/Models/Workflow.cs
+++ b/src/modules/Elsa.Workflows.Core/Models/Workflow.cs
@@ -28,7 +28,8 @@ public class Workflow : Composite