{"record":{"id":"2fb727c1542ad4e8","repo":"elsa-workflows/elsa-core","slug":"entry-point-label-flowchart-entrypoint-not-found-in","errorCode":null,"errorMessage":"Entry point label '{flowchart.EntryPoint}' not found in flowchart","messagePattern":"Entry point label '(.+?)' not found in flowchart","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Dsl.ElsaScript/Compiler/ElsaScriptCompiler.cs","lineNumber":406,"sourceCode":"                throw new InvalidOperationException($\"Target label '{connNode.Target}' not found in flowchart\");\n\n            var source = new Endpoint(sourceActivity, connNode.Outcome);\n            var target = new Endpoint(targetActivity);\n            connections.Add(new Connection(source, target));\n        }\n\n        // Create flowchart activity\n        var flowchartActivity = new Workflows.Activities.Flowchart.Activities.Flowchart\n        {\n            Activities = labelToActivity.Values.ToList(),\n            Connections = connections\n        };\n\n        // Set entry point if specified\n        if (!string.IsNullOrEmpty(flowchart.EntryPoint))\n        {\n            if (!labelToActivity.TryGetValue(flowchart.EntryPoint, out var startActivity))\n                throw new InvalidOperationException($\"Entry point label '{flowchart.EntryPoint}' not found in flowchart\");\n\n            flowchartActivity.Start = startActivity;\n        }\n\n        return flowchartActivity;\n    }\n\n    private async Task<IActivity> CompileListenAsync(ListenNode listen, CancellationToken cancellationToken = default)\n    {\n        // Listen is just a regular activity invocation that can start a workflow\n        var activity = await CompileActivityInvocationAsync(listen.Activity, cancellationToken);\n\n        // Try to set CanStartWorkflow if the activity supports it\n        var canStartWorkflowProp = activity.GetType().GetProperty(\"CanStartWorkflow\");\n        if (canStartWorkflowProp != null && canStartWorkflowProp.PropertyType == typeof(bool))\n        {\n            canStartWorkflowProp.SetValue(activity, true);\n        }","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Dsl.ElsaScript/Compiler/ElsaScriptCompiler.cs#L388-L424","documentation":"ElsaScript's flowchart compiler throws this when a workflow declares an `entryPoint` label that does not match any activity label defined in the flowchart. The compiler builds a label-to-activity map while compiling statements; if the declared entry point is absent, no start activity can be set, so compilation aborts. This is a fail-fast integrity check so workflows never run with an undefined start node.","triggerScenarios":"Compiling an ElsaScript source whose flowchart block declares `entryPoint \"Foo\"` (or similar) where no statement in the flowchart carries the label `Foo` — e.g. a typo, a renamed label, or a deleted activity that the entry point still references.","commonSituations":"Renaming or deleting a labelled activity without updating the flowchart's entryPoint; copy-pasting workflow scripts between files where labels differ; typos in label names or case mismatches.","solutions":["Add or correct the label on the activity that should be the entry point so it matches flowchart.EntryPoint exactly","Update the flowchart's entryPoint value to the exact name of an existing label (labels are case-sensitive)","Remove the entryPoint declaration to fall back to the default start behavior","Print/list all labels in the script and diff against the entryPoint value to spot the mismatch"],"exampleFix":"// before\nflowchart entryPoint \"ProccessOrder\"\n  ProccessOrder: HttpEndpoint(...)\n// after (label matches)\nflowchart entryPoint \"ProcessOrder\"\n  ProcessOrder: HttpEndpoint(...)","handlingStrategy":"validation","validationCode":"// before compiling\nvar labels = scriptLabels; // labels declared in the flowchart\nif (!string.IsNullOrEmpty(entryPoint) && !labels.Contains(entryPoint))\n    throw new ArgumentException($\"EntryPoint '{entryPoint}' has no matching label. Labels: [{string.Join(\", \", labels)}]\");","typeGuard":null,"tryCatchPattern":"try { await compiler.CompileAsync(script); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Entry point label\"))\n{\n    logger.LogError(ex, \"ElsaScript entry point refers to a missing label\");\n}","preventionTips":["Keep entryPoint and activity labels defined adjacently in the script","Rename labels with search-and-replace across the whole script file","Add a build-time lint that asserts every entryPoint exists in the label set"],"tags":["elsascript","compiler","workflow","label"],"backgroundTag":"resource-not-found","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}