sleep method

  1. @override
Future<void> sleep(
  1. String name,
  2. Duration duration
)
override

Suspends the workflow for the given duration using a durable timer.

The timer survives process restarts via database persistence.

  • name: Human-readable name for this sleep step.
  • duration: How long to sleep.

Implementation

@override
Future<void> sleep(String name, Duration duration) {
  validateIdentifier(name, 'name');
  return _timerManager.registerTimer(
    workflowExecutionId: _workflowExecutionId,
    stepName: name,
    duration: duration,
  );
}