{"record":{"id":"dcd26f4a3983ec11","repo":"elsa-workflows/elsa-core","slug":"activity-type-not-found","errorCode":null,"errorMessage":"Activity type not found","messagePattern":"Activity type not found","errorType":"exception","errorClass":"ActivityNotFoundException","httpStatus":null,"severity":"critical","filePath":"src/modules/Elsa.Workflows.Core/Activities/NotFoundActivity.cs","lineNumber":46,"sourceCode":"    /// <summary>\n    /// The type name of the missing activity type.\n    /// </summary>\n    public string MissingTypeName { get; set; } = null!;\n    \n    /// <summary>\n    /// The version of the missing activity type.\n    /// </summary>\n    public int MissingTypeVersion { get; set; }\n\n    /// <summary>\n    /// The original activity JSON.\n    /// </summary>\n    public string OriginalActivityJson { get; set; } = null!;\n\n    /// <inheritdoc />\n    protected override void Execute(ActivityExecutionContext context)\n    {\n        throw new ActivityNotFoundException(MissingTypeName, MissingTypeVersion);\n    }\n}","sourceCodeStart":28,"sourceCodeEnd":48,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Workflows.Core/Activities/NotFoundActivity.cs#L28-L48","documentation":"NotFoundActivity.Execute throws ActivityNotFoundException carrying the missing activity type name and version. NotFoundActivity is a placeholder substituted when a workflow definition references an activity type not registered in the activity registry, so the failure surfaces at execution time instead of silently skipping the node.","triggerScenarios":"Executing a workflow instance whose definition contains an activity whose Type (and version, when specified) has no registration in the running application's activity registry.","commonSituations":"Deploying a workflow to an app lacking the package/custom activity used by the definition; renaming or deleting a custom activity class while old definitions still reference the old type; typos in the Type string; version mismatches.","solutions":["Register the missing activity type: load the assembly and install the activity feature/module via the Elsa options.","Read MissingTypeName/MissingTypeVersion on the NotFoundActivity or exception to identify the absent type.","Fix typos in the definition's activity Type field or re-save the definition in the designer.","If the activity was intentionally removed, remove or replace the node in the workflow definition."],"exampleFix":"// before\n// workflow references type \"MyCustomActivity\" but it is not registered; execution throws\n// after\nservices.AddElsa(elsa => elsa.AddActivitiesFrom<MyCustomActivity>()); // register the type so the activity resolves","handlingStrategy":"validation","validationCode":"// before executing, verify all activity types in the definition are registered\nvar registry = serviceProvider.GetRequiredService<IActivityRegistry>();\nforeach (var activity in workflowDefinition.Activities)\n{\n    if (!registry.IsActivityTypeRegistered(activity.Type))\n        throw new InvalidOperationException($\"Activity type '{activity.Type}' is not registered.\");\n}","typeGuard":"static bool IsRegistered(IActivityRegistry registry, string type) => registry.IsActivityTypeRegistered(type);","tryCatchPattern":"try { await workflowRunner.RunAsync(workflow); }\ncatch (ActivityNotFoundException ex)\n{\n    logger.LogError(ex, \"Missing activity type '{Type}' (version {Version})\", ex.MissingType, ex.MissingTypeVersion);\n}","preventionTips":["Ensure every package containing used activities is referenced by the host app.","Re-save definitions after renaming/deleting custom activities.","Verify activity type names match exactly (case-sensitive) between designer and code.","Deploy definitions only to environments with all required activity modules installed."],"tags":["workflow","activity","registry","not-found"],"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-16T04:17:20.429Z"}