{"record":{"id":"b6ee014d1fc75c9f","repo":"elsa-workflows/elsa-core","slug":"workflow-definition-file-path-was-not-found-in-the-recipe","errorCode":null,"errorMessage":"Workflow definition file '{Path}' was not found in the recipe artifact.","messagePattern":"Workflow definition file '(.+?)' was not found in the recipe artifact\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Platform.Integration/Steps/ImportWorkflowDefinitionStep.cs","lineNumber":89,"sourceCode":"        }, cancellationToken);\n\n        if (!importResult.Succeeded)\n        {\n            var errors = string.Join(\"; \", importResult.ValidationErrors.Select(x => x.Message));\n            throw new InvalidOperationException($\"Workflow definition validation failed: {errors}\");\n        }\n\n        context.Log($\"Workflow definition '{model.DefinitionId}' was imported.\");\n    }\n\n    private string ResolveWorkflowJson()\n    {\n        if (!string.IsNullOrWhiteSpace(Path))\n        {\n            if (artifact.TryGetText(Path, out var content))\n                return content;\n\n            throw new InvalidOperationException($\"Workflow definition file '{Path}' was not found in the recipe artifact.\");\n        }\n\n        if (WorkflowDefinition.ValueKind == JsonValueKind.Object)\n            return WorkflowDefinition.GetRawText();\n\n        throw new InvalidOperationException(\"A workflow definition or artifact-relative path is required.\");\n    }\n}\n","sourceCodeStart":71,"sourceCodeEnd":98,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Platform.Integration/Steps/ImportWorkflowDefinitionStep.cs#L71-L98","documentation":"ResolveWorkflowJson locates the workflow definition JSON either from an explicit artifact-relative Path or from the WorkflowDefinition property. When Path is set but no such entry exists in the recipe artifact (TryGetText returns false), the step throws this InvalidOperationException naming the missing path.","triggerScenarios":"Executing the import step with Path set to a file name/folder that does not exist inside the recipe artifact — wrong casing, wrong extension, missing directory prefix, or the artifact was built without that file.","commonSituations":"Renaming workflow files in the recipe source without updating the step's Path; packaging scripts that skip the workflow directory; path separators or leading slashes that don't match how the artifact stores entry names.","solutions":["List the artifact's entries (e.g. via artifact inspection APIs) and set Path to an exact existing entry, matching case and separators.","Fix the packaging step so the workflow definition file is actually included in the recipe artifact.","Remove any leading '/' or './' from Path and use the artifact-relative path as stored in the artifact.","Alternatively, drop Path and supply the workflow JSON inline via the WorkflowDefinition property."],"exampleFix":"// before\nstep.Path = \"workflows/order-flow.json\"; // artifact contains \"workflows/OrderFlow.json\"\n// after\nstep.Path = \"workflows/OrderFlow.json\";","handlingStrategy":"validation","validationCode":"if (!artifact.Entries.Any(e => string.Equals(e.Path, step.Path, StringComparison.OrdinalIgnoreCase)))\n    throw new InvalidOperationException($\"Artifact does not contain '{step.Path}'. Available: {string.Join(\", \", artifact.Entries.Select(e => e.Path))}\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await step.ExecuteAsync(context);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"was not found in the recipe artifact\"))\n{\n    logger.LogError(ex, \"Check the step Path against the artifact contents.\");\n    throw;\n}","preventionTips":["List artifact entries and log them when packaging recipes.","Keep workflow file names and step Path values in sync (single source of truth).","Avoid casing/separator drift: store paths normalized."],"tags":["file-not-found","workflow-import","path","artifact"],"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-23T08:17:48.524Z"}