{"record":{"id":"f88c23e590a16840","repo":"OrchardCMS/OrchardCore","slug":"the-syntax-syntax-isn-t-supported-for-correlatetask","errorCode":null,"errorMessage":"The syntax {Syntax} isn't supported for CorrelateTask.","messagePattern":"The syntax (.+?) isn't supported for CorrelateTask\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.Workflows/Activities/CorrelateTask.cs","lineNumber":50,"sourceCode":"        set => SetProperty(value);\n    }\n\n    public WorkflowScriptSyntax Syntax\n    {\n        get => GetProperty(() => WorkflowScriptSyntax.JavaScript);\n        set => SetProperty(value);\n    }\n\n    public override IEnumerable<Outcome> GetPossibleOutcomes(WorkflowExecutionContext workflowContext, ActivityContext activityContext)\n        => Outcome(S[\"Done\"]);\n\n    public override async Task<ActivityExecutionResult> ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext)\n    {\n        var value = Syntax switch\n        {\n            WorkflowScriptSyntax.Liquid => await _expressionEvaluator.EvaluateAsync(Value, workflowContext, null),\n            WorkflowScriptSyntax.JavaScript => await _scriptEvaluator.EvaluateAsync(Value, workflowContext),\n            _ => throw new NotSupportedException($\"The syntax {Syntax} isn't supported for CorrelateTask.\")\n        };\n\n        workflowContext.CorrelationId = value?.Trim();\n\n        return Outcome(\"Done\");\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":58,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Workflows/Activities/CorrelateTask.cs#L32-L58","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (workflow JSON)\n\"Syntax\": \"PlainText\"\n// after\n\"Syntax\": \"Liquid\"","handlingStrategy":"validation","validationCode":"// validate the activity's syntax before the workflow runs\nif (correlateTask.Syntax is not (WorkflowScriptSyntax.Liquid or WorkflowScriptSyntax.JavaScript)) {\n  throw new InvalidOperationException(\"CorrelateTask requires Liquid or JavaScript syntax.\");\n}","typeGuard":"const isSupportedSyntax = (s) => s === 'Liquid' || s === 'JavaScript';","tryCatchPattern":"try {\n  await workflowManager.TriggerEventAsync(eventName, correlationId);\n} catch (NotSupportedException ex) when (ex.Message.Contains(\"CorrelateTask\")) {\n  logger.LogError(ex, \"Workflow uses unsupported script syntax for CorrelateTask.\");\n}","preventionTips":["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."],"tags":["workflows","correlatetask","script-syntax","notsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}