Sync OrderIntakeAdditional data from DataHub on schedule

Recipe ToolsMarketingdatabaseDatabase

What it does

When a custom schedule triggers, this automation retrieves the last update time from a lookup table and queries a JDBC source for new records. It builds a batch list and syncs OrderIntakeAdditional data to keep the system current.

Who it's for

Data and analytics teams who need OrderIntakeAdditional records refreshed automatically from DataHub without manual intervention.

How teams use this

Refresh OrderIntakeAdditional data nightly

Run this automation every night to pull new OrderIntakeAdditional records from DataHub and sync them to the target system. The lookup table tracks progress so no data is missed or duplicated.

Sync to a different target database

Point the JDBC and Mssql queries to a new target system while keeping the same schedule and lookup logic. Only the connection details change.

Add filtering by order status

Include a condition in the JDBC SQL query to only sync OrderIntakeAdditional records with a specific status. This narrows the batch to relevant records only.

Monitor sync failures and retry

Set up error handling to log failed syncs and trigger a retry after a delay using the JDBC and Mssql steps. This ensures no data is lost if either step fails.

How it works

  1. Trigger on a custom schedule. This automation runs at the specified time interval to check for new OrderIntakeAdditional data in DataHub.
  2. Get the last update timestamp. Look up the last_max_ml_final_update_time from the Output_Time lookup table to know where the previous sync ended.
  3. Query JDBC source for new records. Run custom SQL in the JDBC source to fetch OrderIntakeAdditional records that are newer than the last update time stored in the lookup table.
  4. Build and sync the batch list. Add the retrieved target data to a batch list and run SQL in Mssql to sync OrderIntakeAdditional records to the destination system.
  5. Update the lookup table. Store the current timestamp as the new last_max_ml_final_update_time so the next run picks up from this point.