Registry / database / awaitly-mongo

awaitly-mongo

JSON →
library23.0.0jsnpmunverified

MongoDB persistence adapter for awaitly durable execution workflows. Version 23.0.0, maintained actively alongside awaitly core. Ships TypeScript types. Requires Node >=22 and awaitly ^1.33.0. Differentiates from generic MongoDB clients by tightly integrating with awaitly's workflow orchestration (state persistence, checkpointing, recovery). Breaking changes tracked against awaitly versions.

npm install awaitly-mongo
INSTALL
IMPORT
SIG · AWAITLY-MONGO
A
awaitly-mongo
databasejavascriptv23.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MongoAdapter
import { MongoAdapter } from 'awaitly-mongo'
const MongoAdapter = require('awaitly-mongo')
ESM-only package; require() will throw a runtime error.
connectToMongo
import { connectToMongo } from 'awaitly-mongo'
import connectToMongo from 'awaitly-mongo'
Named export, not default.
MongoAdapterOptions
import type { MongoAdapterOptions } from 'awaitly-mongo'
TypeScript type: use import type for compile-time only.

Initialize MongoAdapter and attach it to Awaitly WorkflowClient for durable execution.

import { MongoAdapter } from 'awaitly-mongo'; import { WorkflowClient } from 'awaitly'; const adapter = new MongoAdapter({ url: process.env.MONGO_URL ?? 'mongodb://localhost:27017', database: 'awaitly', }); const client = new WorkflowClient({ persistence: adapter }); console.log('Awaitly Mongo adapter ready'); // Run workflows...
Debug
Known issues
breakingRequires Node >=22
fix
Upgrade Node.js to version 22 or higher.
affects: >=23.0.0
deprecatedDeprecated connection string format without 'mongodb+srv' is discouraged
fix
Use 'mongodb+srv://' connection strings for Atlas clusters.
affects: >=1.0.0
gotchaMongoAdapter must be closed gracefully to prevent connection leaks
fix
Call adapter.close() on process exit or SIGTERM.
affects: >=1.0.0
breakingawaitly peer dependency must be >=1.33.0
fix
Update awaitly to ^1.33.0.
affects: >=23.0.0
gotchaDatabase indexes are not automatically created; you must run migration scripts
fix
Use the provided createIndexes() method after connecting.
affects: >=1.0.0
breakingRemoved support for callbacks; all APIs return Promises
fix
Use async/await instead of callbacks.
affects: >=23.0.0
Errors
Common errors & fixes
Error: Cannot find module 'awaitly-mongo'
Package not installed or peer dependency missing
fix
Run 'npm install awaitly-mongo awaitly'
TypeError: MongoAdapter is not a constructor
Using CommonJS require() instead of ESM import
fix
Change to 'import { MongoAdapter } from 'awaitly-mongo''
Error: db.collection is not a function
MongoAdapter is not properly initialized (missing URL or database)
fix
Ensure new MongoAdapter({ url, database }) has valid config
MongoNetworkError: failed to connect to server
MongoDB server unreachable or credentials wrong
fix
Check MONGO_URL environment variable and network access
Upgrade
Version history
23.0.0latest on npm
Audit
Dependencies
awaitlyrequiredpeer dependency required for workflow orchestration
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources