Conditional Scheduled service or task

I have a requirement to pull data from two data sources. Source B is dependent on source A. I look for data in source A first, it is not present, I need to look for it again in 8 hours, I repeat this for 48 hours (6 times) or until the data is found. Then I pull for data source B, which static, non-transactional data and I always present.

Is there a mechanism in WM IS 4.6, accessible from within a flow service, that can be used to schedule a task that will execute and upon failure try again at some interval and terminate either upon status of success or exhaustion of re-tries? Also, I need this “task/service” to be persisted, such that after an unplanned termination of the server, this service would restart and restore state to pick up where it left off. I know this sound very similar to Reliable Delivery in TN i.e. TASKS, but I don’t know of a way to achieve similar functionality from within a flow service. Any ideas?

You’ll have to mimic what TN does - probably by creating a special database table that keeps track of the retry status, etc. If you create a scheduled service or set up a startup service it will restart upon rebooting of the server, but the status of the the polling should be persisted somewhere (database, file system, repository, etc).

You could set up a scheduled event which runs fairly frequently but it looks to the data store to find out when to kick off the next process (ie. the datastore contains a date/time field which indicates the next time to trigger the polling. In other words you are recreating what TN already does and does well.

Thanks for the feedback. I realize the functionality is very similar to that of TN and I do not want to re-invent the wheel here. Do you have any suggestions, that would make better use of TN, rather than writing my own state management service? If I can find a way to use TN I will.