Sync last job run time from lookup table

Recipe Tools

What it does

When someone calls this automation, it searches a lookup table for the last successful sync date for that recipe ID. It returns that date if found, or a default start time if not, so the calling automation knows where to resume.

Who it's for

Engineering teams who need to track sync history across callable automations without storing state in the main workflow.

How teams use this

Resume syncs from a known checkpoint

When someone calls this automation again, retrieve the last successful sync date from the lookup table so the calling automation only processes new data since that point. This prevents duplicate syncs and keeps this automation efficient.

Set a custom start date for backfill

Pass a start date parameter when invoking this automation to override the lookup table and sync from a specific date instead. The automation returns that date as the last sync for a one-time backfill run.

Track sync history across multiple automations

Use the same lookup table for multiple callable automations so each one maintains its own sync checkpoint independently. This automation handles record creation and lookup for each recipe ID without conflict.

How it works

  1. Receive a callable automation request. Someone calls this automation in real time with a recipe ID and optional start date parameter through Workato Service.
  2. Search for the last sync record. Search the Job Last Sync lookup table for an entry matching this recipe ID to see if a successful run has occurred before.
  3. Add entry if none exists. If no record is found, add an entry to the lookup table for this recipe ID so future calls can find and update it.
  4. Return the last sync date. Reply with the start date if provided, or return the time from one hour ago as the default last sync point for the calling automation.