Elsa is designed to be extended by adding modules, features, activities, stores, expression providers, API endpoints, and runtime integration points. This page collects the common patterns.
## Add A Code-First Feature
1. Create `Features/MyFeature.cs`.
2. Derive from `FeatureBase`.
3. Add `[DependsOn]` attributes for required features.
4. Use `Configure()` for feature graph changes and activity scanning.
5. Use `ConfigureHostedServices()` for hosted services.
6. Use `Apply()` for service registration.
7. Add `Extensions/ModuleExtensions.cs` with `UseMyFeature`.
8. Add unit tests that prove core services register.
Use [HttpFeature](../../src/modules/Elsa.Http/Features/HttpFeature.cs), [SchedulingFeature](../../src/modules/Elsa.Scheduling/Features/SchedulingFeature.cs), and [StructuredLogsFeature](../../src/modules/Elsa.Diagnostics.StructuredLogs/Features/StructuredLogsFeature.cs) as examples.
## Add A Shell Feature
Shell features live in `ShellFeatures` and implement CShells interfaces such as `IShellFeature`, `IFastEndpointsShellFeature`, or `IMiddlewareShellFeature`.
Use shell features when modular server/package configuration needs to activate the feature without code-first `AddElsa` calls.
5. Register those services and call `AddRelationalStructuredLogPersistence`.
See [SqliteStructuredLogsModuleExtensions](../../src/modules/Elsa.Diagnostics.StructuredLogs.Persistence.Sqlite/Extensions/SqliteStructuredLogsModuleExtensions.cs).
## Add A Runtime Ingress Source
External event sources should participate in graceful shutdown. Add an ingress source when a module feeds work into the runtime from outside the engine.
Steps:
1. Implement the runtime `IIngressSource` contract in the owning module.
2. Register it as a singleton service.
3. Make dispatch loops or middleware honor paused state.
4. Add tests for pause/resume/drain behavior.
Existing first-party examples are HTTP and Scheduling ingress source registrations.
## Add A Workflow Provider
Workflow providers bring definitions from external storage. Existing examples: