elsa-workflows / elsa-workflows/elsa-extensions

MongoDB-Based Persistence for Secrets

Open
#126 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
49
Forks
48
Avg merge
21h 35m
Merged PRs (30d)
20

Description

**Overview**

This proposal introduces MongoDB-based persistence for Secrets in Elsa Workflows 3, enabling secure, scalable, and provider-consistent storage of sensitive configuration data such as API keys, connection strings, tokens etc...

Currently, when using MongoDB as the primary persistence provider for workflows and runtime data, secrets management may require an alternative storage mechanism. This feature aims to provide a first-class MongoDB secrets store implementation, fully integrated with Elsa 3’s abstractions and extensibility model.

**Prototype Implementation**

I have already implemented a working prototype that provides a custom implementation of ISecretStore using the Elsa.Persistence.MongoDb extension.

The prototype:

- Integrates with Elsa’s MongoDB persistence configuration
- Stores secrets in a dedicated MongoDB collection
- Supports encrypted secret values
- Is fully compatible with Elsa’s secret resolution pipeline
- Works transparently with existing workflow execution

The implementation leverages the existing MongoDB infrastructure configured via:

```
builder.Services.AddElsa(elsa =>
{
elsa.UseMongoDb(configuration.GetSection("Elsa:PersistenceConnectionString"));

elsa.UseWorkflowManagement(management => management.UseMongoDb());
elsa.UseWorkflowRuntime(runtime => { runtime.UseMongoDb(); });
...

//using MongoDb as persistence engine for secrets
elsa.UseSecrets()
.UseSecretsManagement(management => { management.UseMongoDb(); })
.UseSecretsApi()
.UseSecretsScripting();

....
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.