.NET Best practices to retrieve last successful workflow and/or scheduled workflow run

I’ve been researching on how to retrieve scheduler and workflow information with the .NET SDK, and everything seems to point to retrieving a Handle and then calling Describe.

However I’m not sure that’s the best approach for my use case.

I’m handling a series of Scheduled jobs, that run every 10 minutes, and retrieve data from System A, and dump into Database B.

Although idempotent, I’m trying to optimize this process by only grabbing new data that was created after the last time we successfully downloaded data. When looking at the last runs of a Scheduler, I only get 10 and seemingly no guarantee that any of those 10 were actually Completed successfully. And when looking at the Workflow handler, I can see if the last run was successful, but if it wasn’t, I can’t seem to find a good way to retrieve the last successful run.

Ideally I’d be able from within my Download Activity Execution to query for the last time a given Workflow was scheduled and ran successfully.

Am I missing something obvious here? Any help would be greatly appreciated.