Your first protected action.
Add Mola Ledger to your Node.js application, wrap a provider call, and inspect its activity in Studio. Node.js 22.16 or newer is required; Node.js 24 is recommended.
1. Install the SDK
npm install mola-ledgerFor source-based installation:
npm install github:zaiderikat/Mola-Ledger2. Wrap an action
Use your existing provider client in the example below. Choose the ID in application code and reuse it for every retry of the same intended action.
import { createLedger } from 'mola-ledger';
const ledger = createLedger();
try {
const incident = await ledger.execute({
id: 'incident-for-alert-1842-v1',
namespace: 'support-agent',
action: 'incident.create',
input: { alertId: 1842, severity: 'high' },
providerReference: result => result.url,
run: ({ idempotencyKey }) => provider.createIncident({
alertId: 1842,
severity: 'high',
idempotencyKey,
}),
});
console.log(incident);
} finally {
await ledger.close();
}The first call runs the callback. A repeat with the same identity and input returns the confirmed result. Reusing the identity with different input is rejected. In a long-running application, close the ledger during orderly shutdown.
3. Open Studio
Run this from the same project directory:
npx mola-ledger studioOpen http://127.0.0.1:4317 on your machine. Studio shows attempts, suppression decisions, operation timelines, and an investigation queue. It refreshes while your application runs.
When the outcome is uncertain
A failed callback does not prove the external action failed. Mola Ledger blocks further execution for that identity until you positively verify the outcome and reconcile it through the SDK. Studio is read-only; it does not provide a retry button.
Detailed guides
The current product documentation is available below as Markdown files.
Current scope
The local SDK and Studio are available. Shared monitoring across independent hosts is planned. The existing HTTP backend is retained for compatibility and small single-host evaluation.
Protection covers calls wrapped with the SDK, not every action automatically. Mola Ledger does not guarantee exactly-once external execution. Keep Studio local; it has no remote authentication.
License: See the current repository license on GitHub.
Back to Mola Ledger ↗