{"record":{"id":"db4c951abdc2c1d4","repo":"elsa-workflows/elsa-core","slug":"bpmn-process-activity-process-id-has-no-process-definition","errorCode":null,"errorMessage":"BPMN process activity '{_process.Id}' has no process definition to execute.","messagePattern":"BPMN process activity '(.+?)' has no process definition to execute\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/modules/Elsa.Bpmn/Hosting/BpmnScopeHost.cs","lineNumber":379,"sourceCode":"            HasEnclosingScope: invocationCorrelation.Count > 0,\n            LiveWork: memory.Work.ToLiveWork(),\n            InvocationCorrelation: invocationCorrelation,\n            Variables: new BpmnScopeVariables(_context),\n            Capabilities: Capabilities);\n    }\n\n    /// <summary>\n    /// The correlation of the work that started this scope. It belongs to the scope and is fixed for its lifetime;\n    /// a completing unit of work's correlation is never written here, because the event-subprocess start hint is read\n    /// from this same dictionary.\n    /// </summary>\n    private IReadOnlyDictionary<string, string> InvocationCorrelation =>\n        BpmnScopeMemory.Read<Dictionary<string, string>>(_context, InvocationCorrelationPropertyKey) ?? NoCorrelation;\n\n    private BpmnGraph BuildGraph()\n    {\n        var definition = _process.Process\n                         ?? throw new InvalidOperationException($\"BPMN process activity '{_process.Id}' has no process definition to execute.\");\n\n        // Every binding the definition declares, with the nested definition attached where the bound activity is\n        // itself a BPMN scope. The graph validator reads that for an event subprocess body's start trigger.\n        var boundWork = BpmnBoundWork.Derive(definition, bindingRef => (_process.FindWorkActivity(bindingRef) as BpmnProcess)?.Process);\n\n        return BpmnGraph.Build(definition, boundWork, Capabilities);\n    }\n}\n","sourceCodeStart":361,"sourceCodeEnd":388,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Bpmn/Hosting/BpmnScopeHost.cs#L361-L388","documentation":"BpmnScopeHost.BuildGraph requires the process activity to carry an actual BPMN process definition (_process.Process). When it is null — the activity exists but has no compiled definition attached — an InvalidOperationException is thrown stating the process activity has no definition to execute. This is an internal consistency guard before graph building.","triggerScenarios":"Executing a BPMN process activity whose Process definition property was never populated — e.g. the definition failed to load/compile, or the activity was constructed without its definition reference during model binding.","commonSituations":"Broken deployment where the definition was deleted or renamed after instances referenced it; serialization round-trips losing the definition link; custom activity construction bypassing the loader.","solutions":["Verify the workflow definition still exists and is published; re-import the BPMN document if needed.","Rebuild/redeploy the workflow so the process activity is re-bound to its definition.","Check the model loading path (interchange import → activity compilation) for a step that failed silently."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (processActivity.Process is null) throw new InvalidOperationException($\"Process activity '{processActivity.Id}' is missing its definition; re-publish the workflow.\");","typeGuard":"bool HasDefinition(BpmnProcessActivity p) => p?.Process is not null;","tryCatchPattern":"try { await host.ExecuteAsync(context); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"no process definition\")) { log.LogError(ex, \"Unbound BPMN process activity {Id}\", ex.Message); /* re-import / republish definition */ }","preventionTips":["Republish definitions after edits and before resuming instances.","Never delete definitions with live instances without migration.","Validate that imported activities carry their definitions before execution."],"tags":["bpmn","missing-definition","internal"],"backgroundTag":"entity-not-found","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}