- AI Automation
- Data Engineering
- Node.js
- MongoDB
Building an AI prospect enrichment pipeline with Node.js and MongoDB
How two workers researched roughly 540 firms overnight, how reviewers traced asset figures to a source, and how sales kept its corrections in Google Sheets.
By Forhad5 min read

A fund manager and its advisory subsidiary can share a website. Search either name and you might find a credible assets figure, quoted in the right currency, on the group’s own site. Put that figure beside the subsidiary and the sales team now has a convincing reason to call the wrong prospect.
At Changing Digital, I built a Node.js workflow for a fund research platform whose sales team maintained a Google Sheet of UK and European firms. Five research tools became one pipeline. In one overnight run, two machines processed roughly 540 firms. The harder part was deciding which findings belonged in the sheet and letting a researcher correct them. The prospect enrichment case study covers the team’s starting point and the outcome.
The three decisions behind an enriched row
We split the research into three stages. Each stage answers a question that changes how the next one should interpret its sources.
| Stage | Question | Why the answer matters downstream |
|---|---|---|
| Firm identity | Which business does this row represent? | A parent, trading name and subsidiary may all lead to the same domain. The selected entity determines whose activities and assets to research. |
| Classification | What does this firm actually do? | An investment manager runs money. A financial adviser may advise clients on money another firm manages. The distinction changes which figure sales can use. |
| Assets | How much does this entity manage or advise on, according to which source? | The workflow checks the platform’s existing fund data first, then searches the web when it needs more evidence. It expresses figures in pounds for comparison. |
Looking up the name first also helps with costs. Once the entity is settled, the assets stage can use the platform’s own data before paying for another search. Per-row token and cost records let the team inspect which firms consumed the most research.
Following one ambiguous figure through review
Consider a fictional row for Example Advisory UK. The group website says its parent manages £4 billion. A subsidiary factsheet says Example Advisory UK advises on £180 million. Both statements could be accurate. They answer different questions.
For a prospect list of advisory firms, the £180 million figure belongs with the subsidiary, alongside the wording “assets under advice.” For a campaign targeting fund managers, the group’s £4 billion is a reason to research the parent as a separate prospect. If the group website were the only available source, I would leave the subsidiary’s figure open for review. A blank tells the next researcher what is missing.
For that review, I’d show the entity named in the source, the sentence supporting the figure, the reporting date and the original amount and currency. If the source reports euros, I’d also show the rate and date used to convert it to pounds. That gives the reviewer a way to distinguish a currency change from a change in the business.
How two workers share the list
MongoDB holds the research history and coordinates which rows are available. A worker claims a row before starting research. The second machine can pick up other firms while the first waits for a source or a model response. The sheet stays usable as the sales team’s workspace.
This short Node.js example illustrates the claim step. It assumes a MongoDB collection called jobs with one document per row. The names are illustrative. Both the row ID and its expected state are part of the filter.
async function claimRow(jobs, rowId, workerId) {
const result = await jobs.updateOne(
{ _id: rowId, state: "pending" },
{ $set: { state: "researching", workerId } }
);
return result.matchedCount === 1;
}
If two workers try the same pending row, the first successful write changes its state. The other worker’s filter then matches zero documents, so it can move on before spending money on the same research. In a system that reassigns abandoned work, the completion step also needs to check who still owns the claim. Otherwise a delayed result from the first worker could overwrite the newer attempt. MongoDB’s single-document write guarantees
How a correction survives the next run
There are two events worth recording separately. First, the pipeline proposes a change and saves the research history in MongoDB. Then the result reaches Google Sheets, either directly or after someone reviews it on the approvals page. A researcher can inspect the evidence or retry an individual row.
Suppose someone corrects the company name in the sheet after reviewing a subsidiary’s factsheet. If the next run starts from yesterday’s database name, it can undo the most valuable edit in the row. Our sync carried manual name corrections back into MongoDB so the next run could start from the researcher’s decision.
For anyone building a similar sync, test that sequence on a throwaway row. Change its name by hand, run the import again, and inspect both the sheet and its stored history. The Sheets API can confirm how many cells a batch updated. Reading back the specific row tells you whether the corrected name survived. Google Sheets batch updates
What to measure before expanding the queue
The roughly 540 firms figure describes work processed during one overnight run. Some results can still need review. Separately, a check on the live sheet found and cleaned up 99 rows with duplicate company IDs. Dividing one figure by the other would give a meaningless duplicate rate because they came from different runs.
For a pilot, I’d ask sales to pick a sample that includes a clearly identified firm, a parent and subsidiary that share a domain, and a firm whose public assets figure is ambiguous. For each, record the research cost, review time and decision. Divide the full sample’s research and review cost by the number of rows sales actually accepts. That gives you a cost per usable row that includes the work spent on rejected suggestions. The lead enrichment cost guide walks through how to budget that work.
Written by
Forhad, Lead engineer at DailyCodings
Forhad builds the systems behind DailyCodings' client work: web scraping pipelines, ETL and data platforms, workflow automations, dashboards, and AI-assisted tools, mostly in Python.
- Python development
- Data engineering
- Web scraping
- Automation
- AI workflows
- Dashboards


