OrchardCMS/OrchardCore · error · NotSupportedException
The syntax isn't supported for CorrelateTask.
Error message
The syntax {Syntax} isn't supported for CorrelateTask. What it means
The CorrelateTask workflow activity evaluates its Value expression using the syntax configured on the activity. Only Liquid and JavaScript syntaxes are supported; if Syntax holds any other WorkflowScriptSyntax value, ExecuteAsync throws NotSupportedException.
Solutions
- Open the workflow in the admin editor and set the CorrelateTask's Syntax to Liquid or JavaScript.
- Edit the stored workflow JSON to change the activity's Syntax value to a supported one.
- Upgrade the Workflow module if the syntax was introduced in a newer version that supports it.
Example fix
// before (workflow JSON) "Syntax": "PlainText" // after "Syntax": "Liquid"
Defensive patterns
Strategy: validation
Validate before calling
// validate the activity's syntax before the workflow runs
if (correlateTask.Syntax is not (WorkflowScriptSyntax.Liquid or WorkflowScriptSyntax.JavaScript)) {
throw new InvalidOperationException("CorrelateTask requires Liquid or JavaScript syntax.");
} Type guard
const isSupportedSyntax = (s) => s === 'Liquid' || s === 'JavaScript';
Try / catch
try {
await workflowManager.TriggerEventAsync(eventName, correlationId);
} catch (NotSupportedException ex) when (ex.Message.Contains("CorrelateTask")) {
logger.LogError(ex, "Workflow uses unsupported script syntax for CorrelateTask.");
} Prevention
- Only configure Liquid or JavaScript syntax on CorrelateTask activities.
- Validate imported/exported workflow JSON against supported syntax values.
- After upgrading, re-save workflows that used legacy syntax values.
- Wrap workflow execution with handlers that log NotSupportedException with the activity name.
When it happens
Trigger: A CorrelateTask activity whose Syntax property was set to an unsupported value (e.g. a syntax enum member added later or a legacy/default value like None/PlainText) and the workflow reaches that activity.
Common situations: Workflows imported/exported from a different Orchard Core version where the CorrelateTask supported another syntax; manually edited workflow JSON with an invalid syntax value; new WorkflowScriptSyntax members not yet handled by the activity.
Related errors
- The syntax isn't supported for ForEachTask.
- The syntax isn't supported for ForLoopTask.
- The syntax isn't supported for IfElseTask.
- The syntax isn't supported for SetOutputTask.
- The syntax isn't supported for SetPropertyTask.
AI-assisted analysis of OrchardCMS/OrchardCore@4306c0717f (2026-09-13).
Data as JSON: /api/errors/f88c23e590a16840.
Report an issue: GitHub.
Appendix: source
Thrown at src/OrchardCore.Modules/OrchardCore.Workflows/Activities/CorrelateTask.cs:50
set => SetProperty(value);
}
public WorkflowScriptSyntax Syntax
{
get => GetProperty(() => WorkflowScriptSyntax.JavaScript);
set => SetProperty(value);
}
public override IEnumerable<Outcome> GetPossibleOutcomes(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
=> Outcome(S["Done"]);
public override async Task<ActivityExecutionResult> ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext)
{
var value = Syntax switch
{
WorkflowScriptSyntax.Liquid => await _expressionEvaluator.EvaluateAsync(Value, workflowContext, null),
WorkflowScriptSyntax.JavaScript => await _scriptEvaluator.EvaluateAsync(Value, workflowContext),
_ => throw new NotSupportedException($"The syntax {Syntax} isn't supported for CorrelateTask.")
};
workflowContext.CorrelationId = value?.Trim();
return Outcome("Done");
}
}
View on GitHub (pinned to 4306c0717f)