<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Forhad at DailyCodings</title>
    <description>The latest articles on DEV Community by Forhad at DailyCodings (@dailycodings_mailbox_93bd).</description>
    <link>https://dev.to/dailycodings_mailbox_93bd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266060%2F575652ce-290a-4e3d-9ea9-ccfd3e968aad.png</url>
      <title>DEV Community: Forhad at DailyCodings</title>
      <link>https://dev.to/dailycodings_mailbox_93bd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dailycodings_mailbox_93bd"/>
    <language>en</language>
    <item>
      <title>Building an AI prospect enrichment pipeline with Node.js and MongoDB</title>
      <dc:creator>Forhad at DailyCodings</dc:creator>
      <pubDate>Thu, 26 Nov 2026 15:14:17 +0000</pubDate>
      <link>https://dev.to/dailycodings/building-an-ai-prospect-enrichment-pipeline-with-nodejs-and-mongodb-3675</link>
      <guid>https://dev.to/dailycodings/building-an-ai-prospect-enrichment-pipeline-with-nodejs-and-mongodb-3675</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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 &lt;strong&gt;roughly 540 firms&lt;/strong&gt;. The harder part was deciding which findings belonged in the sheet and letting a researcher correct them. The &lt;a href="https://dailycodings.com/projects/ai-prospect-enrichment-pipeline" rel="noopener noreferrer"&gt;prospect enrichment case study&lt;/a&gt; covers the team’s starting point and the outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three decisions behind an enriched row
&lt;/h2&gt;

&lt;p&gt;We split the research into three stages. Each stage answers a question that changes how the next one should interpret its sources.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Why the answer matters downstream&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Firm identity&lt;/td&gt;
&lt;td&gt;Which business does this row represent?&lt;/td&gt;
&lt;td&gt;A parent, trading name and subsidiary may all lead to the same domain. The selected entity determines whose activities and assets to research.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Classification&lt;/td&gt;
&lt;td&gt;What does this firm actually do?&lt;/td&gt;
&lt;td&gt;An investment manager runs money. A financial adviser may advise clients on money another firm manages. The distinction changes which figure sales can use.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Assets&lt;/td&gt;
&lt;td&gt;How much does this entity manage or advise on, according to which source?&lt;/td&gt;
&lt;td&gt;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.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Following one ambiguous figure through review
&lt;/h2&gt;

&lt;p&gt;Consider a fictional row for &lt;em&gt;Example Advisory UK&lt;/em&gt;. The group website says its parent manages &lt;strong&gt;£4 billion&lt;/strong&gt;. A subsidiary factsheet says Example Advisory UK advises on &lt;strong&gt;£180 million&lt;/strong&gt;. Both statements could be accurate. They answer different questions.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  How two workers share the list
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;This short Node.js example illustrates the claim step. It assumes a MongoDB collection called &lt;code&gt;jobs&lt;/code&gt; with one document per row. The names are illustrative. Both the row ID and its expected state are part of the filter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;claimRow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rowId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;workerId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;jobs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;updateOne&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rowId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"pending"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"researching"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;workerId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;matchedCount&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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. &lt;a href="https://www.mongodb.com/docs/manual/core/write-operations-atomicity/" rel="noopener noreferrer"&gt;MongoDB’s single-document write guarantees&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How a correction survives the next run
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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. &lt;a href="https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate" rel="noopener noreferrer"&gt;Google Sheets batch updates&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What to measure before expanding the queue
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;roughly 540 firms&lt;/strong&gt; 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 &lt;strong&gt;99 rows with duplicate company IDs&lt;/strong&gt;. Dividing one figure by the other would give a meaningless duplicate rate because they came from different runs.&lt;/p&gt;

&lt;p&gt;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 &lt;strong&gt;usable row&lt;/strong&gt; that includes the work spent on rejected suggestions. The &lt;a href="https://dailycodings.com/insights/lead-data-enrichment-cost" rel="noopener noreferrer"&gt;lead enrichment cost guide&lt;/a&gt; walks through how to budget that work.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;By Forhad. Originally published on &lt;a href="https://dailycodings.com/insights/ai-prospect-enrichment-pipeline-architecture" rel="noopener noreferrer"&gt;DailyCodings Insights&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>mongodb</category>
      <category>ai</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Workflow Automation for Small Teams: 7 Patterns That Don't Break</title>
      <dc:creator>Forhad at DailyCodings</dc:creator>
      <pubDate>Thu, 26 Nov 2026 15:14:04 +0000</pubDate>
      <link>https://dev.to/dailycodings/workflow-automation-for-small-teams-7-patterns-that-dont-break-bhi</link>
      <guid>https://dev.to/dailycodings/workflow-automation-for-small-teams-7-patterns-that-dont-break-bhi</guid>
      <description>&lt;p&gt;A reporting sync we worked on stopped running for about 11 days. The dashboard kept showing its last good numbers, so nobody knew the data was stale. An alert for a failed run would have missed the problem. We also needed a way to notice when a run never happened.&lt;/p&gt;

&lt;p&gt;That experience shaped the seven checks we use when a small team connects a form, CRM, reporting job or email tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start with one bottleneck you can measure
&lt;/h2&gt;

&lt;p&gt;The most common mistake is trying to automate everything at once. Instead, pick &lt;strong&gt;one repeated task that already costs you real time&lt;/strong&gt;, and write down what it costs today.&lt;/p&gt;

&lt;p&gt;Good first candidates share three traits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It happens often:&lt;/strong&gt; daily or weekly, not once a quarter&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It follows clear rules:&lt;/strong&gt; the same steps every time, with few judgment calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mistakes are visible:&lt;/strong&gt; you can tell whether the result is right&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Good first automation&lt;/th&gt;
&lt;th&gt;Poor first automation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Copying new form leads into the CRM&lt;/td&gt;
&lt;td&gt;Rebuilding your whole sales process&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sending a weekly report to managers&lt;/td&gt;
&lt;td&gt;Automating rare, one-off tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reminding customers about overdue invoices&lt;/td&gt;
&lt;td&gt;Anything nobody can explain step by step&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Measure before and after: hours saved, errors avoided, or response time. A clear win on one workflow earns the trust (and budget) for the next.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Write down the contract between your tools
&lt;/h2&gt;

&lt;p&gt;Every automation passes data from one system to another. Problems start when nobody has agreed what that data looks like.&lt;/p&gt;

&lt;p&gt;Before building, write a short contract for each step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inputs:&lt;/strong&gt; which fields arrive, in what format, and which are required&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outputs:&lt;/strong&gt; what the next system expects to receive&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Field mapping:&lt;/strong&gt; "Company size" in the form becomes "Number of employees" in the CRM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When we built an AI-powered lead funnel, we learned this the hard way. Conversion tracking fired the moment a visitor clicked submit, so failed and duplicate submissions were counted as real leads. Moving the event to fire only after the backend accepted the lead removed those "ghost" conversions. The fix was simply a clearer contract about what counts as a lead. You can read the full &lt;a href="https://dailycodings.com/projects/linkedin-audit-ai-lead-funnel" rel="noopener noreferrer"&gt;lead funnel case study&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make every step safe to run twice
&lt;/h2&gt;

&lt;p&gt;Automations get retried, re-run, and triggered twice by accident. If running a step twice creates two invoices or two CRM contacts, you will eventually have a mess.&lt;/p&gt;

&lt;p&gt;Engineers call this &lt;strong&gt;idempotency&lt;/strong&gt;: running the same step again gives the same result. In practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Search before you create.&lt;/strong&gt; Look up a company by its website domain before creating a new record.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use unique keys.&lt;/strong&gt; Give each order, lead, or job an ID, and skip anything already processed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update instead of insert&lt;/strong&gt; when a record already exists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a CRM automation we built for a financial services team, every company was matched by domain before anything was created. That one rule prevented duplicates when more than 200 records were created on the automation's first day.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Expect failure, and recover on your own
&lt;/h2&gt;

&lt;p&gt;External services time out, APIs hit rate limits, and websites change. A reliable automation assumes some steps will fail and plans for it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Retry with a pause:&lt;/strong&gt; try again after a few seconds, then a little longer, before giving up&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep failed items:&lt;/strong&gt; store anything that could not be processed so it can be re-run later&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recover, do not restart:&lt;/strong&gt; pick up from the failed step instead of running everything again&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the lead funnel above, outages did happen. Because every submission was stored before processing, every affected lead was recovered and still received their report. Nobody was lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Make failures loud, including silence
&lt;/h2&gt;

&lt;p&gt;The most dangerous automation failure is the quiet one. Nothing crashes, nothing errors, the data simply stops arriving.&lt;/p&gt;

&lt;p&gt;An early version of a reporting sync we worked on had stopped running for about &lt;strong&gt;11 days&lt;/strong&gt; before anyone noticed. The dashboards looked normal; they were just out of date. You can read how we fixed it in the &lt;a href="https://dailycodings.com/projects/monday-reporting-data-pipeline" rel="noopener noreferrer"&gt;reporting pipeline case study&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Build in two kinds of alerts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error alerts&lt;/strong&gt; that name the exact step that failed, sent to the channel your team actually reads, such as Slack or email&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Nothing happened" alerts&lt;/strong&gt; for when a job that should run every day processes zero records&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A short log of every run (when it ran, how many items, what failed) turns a two-day investigation into a two-minute one.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Keep a person in the loop where mistakes are expensive
&lt;/h2&gt;

&lt;p&gt;Not everything should run fully on its own. When an automation can send money, email customers, or overwrite important data, add a checkpoint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dry-run mode&lt;/strong&gt; that shows what would change, without changing anything&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approval steps&lt;/strong&gt; where a person reviews AI or bulk changes before they go live&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test and live modes&lt;/strong&gt; so changes are tried on sample data first&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On a recent AI data pipeline, edits can either be applied directly or wait on an approvals page for a person to accept them. The team chooses per job: fast where it is safe, reviewed where it matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Give every automation an owner and a short runbook
&lt;/h2&gt;

&lt;p&gt;Six months from now, someone will need to change or fix this workflow. Make that easy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One named owner&lt;/strong&gt; responsible for each automation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A one-page runbook:&lt;/strong&gt; what it does, where it runs, what to do when it fails&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version control or change notes&lt;/strong&gt; for every edit, so you can see what changed and roll back&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Automations without an owner become the ones nobody dares to touch.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick checklist before you switch it on
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The task is measured, with a clear before-and-after goal&lt;/li&gt;
&lt;li&gt;Inputs, outputs, and field mappings are written down&lt;/li&gt;
&lt;li&gt;Running any step twice does not create duplicates&lt;/li&gt;
&lt;li&gt;Failed steps retry, and failed items are kept for re-processing&lt;/li&gt;
&lt;li&gt;Errors and "zero records" trigger an alert to a real person&lt;/li&gt;
&lt;li&gt;Risky actions have a dry run or an approval step&lt;/li&gt;
&lt;li&gt;There is a named owner and a short runbook&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These checks apply to Zapier, Make, n8n and custom code. For a comparison of how the three platforms handle these decisions, see &lt;a href="https://dailycodings.com/insights/n8n-vs-zapier-vs-make" rel="noopener noreferrer"&gt;n8n vs Zapier vs Make&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;By DailyCodings Team. Originally published on &lt;a href="https://dailycodings.com/insights/automation-patterns-for-small-teams" rel="noopener noreferrer"&gt;DailyCodings Insights&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>automation</category>
      <category>devops</category>
      <category>productivity</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How we tested a HubSpot to Salesforce migration with Node.js and MongoDB</title>
      <dc:creator>Forhad at DailyCodings</dc:creator>
      <pubDate>Thu, 26 Nov 2026 15:13:41 +0000</pubDate>
      <link>https://dev.to/dailycodings/how-we-tested-a-hubspot-to-salesforce-migration-with-nodejs-and-mongodb-42bo</link>
      <guid>https://dev.to/dailycodings/how-we-tested-a-hubspot-to-salesforce-migration-with-nodejs-and-mongodb-42bo</guid>
      <description>&lt;p&gt;A sales rep opens an account in Salesforce to prepare for a follow-up. The contact is there. So is the last meeting. Can the rep find the note that explains what the customer agreed to? An import can return a new record ID for every note and still put that rep on the wrong account.&lt;/p&gt;

&lt;p&gt;I worked on this migration at Changing Digital for the sales team behind a fund research platform. We used Node.js to copy HubSpot records into MongoDB, built account timelines the team could review, then checked batches of records imported into Salesforce. &lt;strong&gt;We archived 23,684 activities. Salesforce verification had reached the test-batch stage.&lt;/strong&gt; The &lt;a href="https://dailycodings.com/projects/hubspot-salesforce-crm-migration" rel="noopener noreferrer"&gt;migration case study&lt;/a&gt; gives the business context and results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why MongoDB sat between the two CRMs
&lt;/h2&gt;

&lt;p&gt;Sales could still edit a HubSpot record while we worked on its Salesforce mapping. If a note looked different after an import, comparing it with the latest HubSpot screen could send us looking for a bug in a record someone had just edited.&lt;/p&gt;

&lt;p&gt;We started with a full copy in MongoDB. Later syncs picked up changes and retained earlier versions. That gave us a source record to return to when checking a batch. Google Sheets served a different purpose. It gave the sales team a familiar way to review the history of a company or contact before the move.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;What it produced&lt;/th&gt;
&lt;th&gt;What someone could check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HubSpot to MongoDB&lt;/td&gt;
&lt;td&gt;Archived records, activities and their change history&lt;/td&gt;
&lt;td&gt;Which version of the source record was under review?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MongoDB to Google Sheets&lt;/td&gt;
&lt;td&gt;Timelines for 1,653 companies and 2,830 contacts&lt;/td&gt;
&lt;td&gt;Does the sequence of calls, meetings and notes make sense to the rep who owns the relationship?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reviewed records to Salesforce&lt;/td&gt;
&lt;td&gt;Test imports, native notes and a daily change log&lt;/td&gt;
&lt;td&gt;Which run wrote this record, and does the destination agree with its source?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Counting the archive without double-counting history
&lt;/h2&gt;

&lt;p&gt;The archive contained 8,711 emails, 7,856 calls, 2,854 meetings, 2,123 messages, 1,716 notes and 424 tasks. Those six counts add up to 23,684. An activity can appear on both a company timeline and a contact timeline. Adding up the rows in those two views would count some conversations twice.&lt;/p&gt;

&lt;p&gt;Here is an illustrative, read-only Node.js query for that check. It assumes a MongoDB collection called &lt;code&gt;activitySnapshots&lt;/code&gt; with one source portal, a named review snapshot, and a HubSpot ID and activity type on each row. The names are examples. Grouping by type and source ID first gives one count per activity even if several archived rows describe it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;counts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"activitySnapshots"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;snapshot&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"review-01"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"$activityType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"$hubspotId"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"$_id.type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;activities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$sort&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;activities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a reconciliation report, check for missing source IDs before running the count. Then compare each type with the source inventory for the same snapshot. A matching grand total can hide a missing call and an extra email. &lt;a href="https://www.mongodb.com/docs/drivers/node/current/aggregation/" rel="noopener noreferrer"&gt;MongoDB aggregation with the Node.js driver&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Following one note into Salesforce
&lt;/h2&gt;

&lt;p&gt;HubSpot keeps the text of a note in &lt;code&gt;hs_note_body&lt;/code&gt;. Its &lt;code&gt;hs_timestamp&lt;/code&gt; determines where it appears on the timeline. Associations identify the company, contact or other record the note belongs to. Two companies can have a note with exactly the same text, so matching on the text alone is a poor way to reconstruct the relationship. &lt;a href="https://developers.hubspot.com/docs/api-reference/latest/crm/activities/notes/guide" rel="noopener noreferrer"&gt;HubSpot Notes API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our test batches imported notes as native Salesforce notes. In Salesforce, the note and its links to business records can be read separately. &lt;code&gt;ContentDocumentLink.LinkedEntityId&lt;/code&gt; identifies the record a document is linked to. That gives an engineer a way to check whether the note landed on the intended account and contact. &lt;a href="https://help.salesforce.com/s/articleView?id=000381453&amp;amp;language=en_US&amp;amp;type=1" rel="noopener noreferrer"&gt;How Salesforce identifies a note’s parent records&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider a fictional note linked to both a company and a contact. First map those two HubSpot IDs to their expected Salesforce IDs. Then read the note’s account and contact links back from Salesforce. This small Node.js example uses readable stand-ins for the IDs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"contact-B"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;actual&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"account-A"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"contact-C"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;unexpected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;actual&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;missing&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unexpected&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// { missing: ["contact-B"], unexpected: ["contact-C"] }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both sides have two links. The difference tells the reviewer exactly which contact is missing and which one received the note in error. A useful next check is to open the corrected note as a sales rep and read it from the account they use for follow-up.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking dates and fields before the next batch
&lt;/h2&gt;

&lt;p&gt;There are three dates worth distinguishing on an imported activity. When did the conversation happen? When was its CRM record created? When was the record last edited? An import performed today can represent a call from years ago. Give each date a destination and compare timestamps in the same time zone.&lt;/p&gt;

&lt;p&gt;The project’s test imports preserved original creation and modification dates. If you are repeating that check in another Salesforce org, verify which destination objects support setting audit fields and whether the importing user has permission to set them on creation. Also inspect the date the rep actually sees on the timeline. &lt;a href="https://developer.salesforce.com/docs/platform/object-reference/guide/system-fields.html" rel="noopener noreferrer"&gt;Salesforce system fields&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our field-gap report listed HubSpot properties with no corresponding Salesforce field. That gave sales a specific decision. If a rep needs an old value to service the account, give it a destination and test it. If the team only needs it for a historical lookup, agree where they will retrieve it from the archive. The daily change log tied Salesforce changes back to a run so we could revisit the affected batch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the test batches proved
&lt;/h2&gt;

&lt;p&gt;At the point covered by the case study, &lt;strong&gt;113 automated tests had passed&lt;/strong&gt; across the sync, timelines and migration logic. We had a completed activity archive and record-by-record comparisons for tested Salesforce batches. The full production cutover was still ahead.&lt;/p&gt;

&lt;p&gt;For a cutover decision, I would ask for three pieces of evidence from the final change window. Reconcile the source counts by activity type, resolve or explicitly accept every outstanding mapping difference, and have a rep find a known conversation using their ordinary Salesforce access. The rep’s check answers the question that started this work. Can they pick up the account where they left off?&lt;/p&gt;

&lt;p&gt;If you are deciding how much history to include in your own pilot, the &lt;a href="https://dailycodings.com/insights/hubspot-to-salesforce-migration-cost" rel="noopener noreferrer"&gt;HubSpot to Salesforce migration cost guide&lt;/a&gt; breaks down the work to price.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;By Forhad. Originally published on &lt;a href="https://dailycodings.com/insights/hubspot-to-salesforce-migration-nodejs-mongodb" rel="noopener noreferrer"&gt;DailyCodings Insights&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>mongodb</category>
      <category>salesforce</category>
      <category>database</category>
    </item>
  </channel>
</rss>
