MySQL to MongoDB: Incremental Archive Template

A scheduled workflow that selects new MySQL rows since the last run and inserts them into a MongoDB collection to archive aging transactional data.

What It Builds

A Schedule trigger fires the workflow on a cron you choose. A Connector node on the mysql connector runs an execute-query that pulls rows newer than a high-water mark you track, then a Connector node on the mongodb connector runs insert-documents to append those rows to an archive collection. The result is a low-cost, repeatable copy of recent transactional data that grows incrementally on every run.

The Prompt

Paste this into Spojit's Miraxa and it builds the workflow, connecting the tools for you:

Build a workflow that runs on a daily schedule, queries my MySQL database for rows created since the last run using a timestamp watermark, and inserts those rows into a MongoDB collection called transaction_archive so aging records are archived incrementally.

Connectors Used

  • Schedule trigger - fires the workflow on a 5-field cron in your timezone.
  • mysql - execute-query selects only rows newer than your watermark.
  • mongodb - insert-documents appends the selected rows to the archive collection.

Customize It

Edit the prompt to change the cron (hourly versus daily), the source table and watermark column, and the target MongoDB collection name. You can also have Miraxa add a Transform node before the insert to reshape rows, or filter the query to a single status before archiving.

Tips

  • Keep the mysql node in Direct mode: the query is deterministic and incurs no AI cost.
  • Track the watermark on an indexed timestamp column so each run scans only new rows.
  • Set the Schedule timezone explicitly (for example Australia/Sydney) so the cutoff matches your data.

Related

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.