Model a work in distribution pattern

I have a use case that I am unable to model deterministically. Scenario works normally, but fails during replay.

I need to model a work distribution pattern where workflows produce and the work gets processed at external REST services. The Rest APIs are dynamic - they register to pull work and can execute work one after the other(throttles the number of calls made to that system).

This external workers were modelled with as a workflow with a queue and a while loop.

while (true) {
  Workflow.await(() -> (queue.peek() != null);
  //This availability is NOT DETERMINISTIC, so fails during replay.
  if(registeredServices.available()){
    ExecutionWorkflow child = Workflow.newChildWorkflowStub(ExecutionWorkflow.class,     childWorkflowOptions);
    child.runChild(queue.pop);
  }
}

A group of rest APIS need to pull work when they are available(registeredServices).

Are there any patterns to model this?

The short answer is that registeredService.available has to be an activity.

But I think there is some higher level problem with this approach. Do you want to zoom about your use case? DM me with your availability and email.