don’t schedule it again by using a condition that only runs when the work isn’t done (i.e when result of API request is video isn’t ready or error)
Well you scheduled it once, but that’s it. The workflow you scheduled needs to schedule itself as the last action. Read the manual in detail and it’s impossible to go wrong (well, so long as you add a condition that stops it running infinitely)…
On front end when you click to initiate the scheduled flow you schedule a single backend workflow for 1-video-check for current date and time.
1-video-check workflow looks like this with 3 steps.
Lip sync-get movie api call >
schedule api workflow (1-video-check, current time+10 seconds) (only if success = no) >
schedule api workflow (2-video-check-success, current date time, only if success = yes)
Then your 2-video-check-success workflow will include you make changes to a thing & email, etc.
Logic here is that 2nd step of 1-video-check will endlessly loop the same check workflow until a success=yes, then it proceeds.
— ^^^this gets what you want^^^—
Personally I’d recommend putting a ”pollStartTime” field as a date on the original record that gets passed to 1-video-check.
Then have a conditional on that workflow where if “pollStartTime” is more than 10 min ago it won’t run. This is to stop an endless loop from occurring. Max it’ll happen is 10min which is still a lot but better than unlimited.