I have a SWF workflow that has two activities.
The first activity (A1) simply calls a service API that in turn launches an application that will (eventually) upload a file in a specific S3 bucket.
The second activity (A2) downloads this file and evaluates the data it contains.
My problem is that I have A2 repeatedly failing and retrying because the S3 file is not there until the file is uploaded by the application.
A1 simply launches an external application and completes immediately after getting a "Application Successfully Launched" response, so having A2 wait on a Promise returned by A1 doesn't make A2 wait until the file is in S3.
My initial solution is to catch the exception that's caused by the file not being there yet and retry within the activity, but that's a bad alternative since the activity will keep running and prevent other workflows running on the same machine from doing useful work.
The ideal solution I think would be to "hibernate" the activity and "wake up" every X minutes to see if the file is there or not in a way that doesn't potentially starve other workflows.
Is this possible?