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

  1. Open the workflow in the admin editor and set the CorrelateTask's Syntax to Liquid or JavaScript.
  2. Edit the stored workflow JSON to change the activity's Syntax value to a supported one.
  3. 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

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


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)