Class Workflow.WorkflowSettingsBuilder

Object
akka.javasdk.workflow.Workflow.WorkflowSettingsBuilder
Enclosing class:
Workflow<S>

public static class Workflow.WorkflowSettingsBuilder extends Object
  • Constructor Details

  • Method Details

    • newBuilder

      public static Workflow.WorkflowSettingsBuilder newBuilder()
    • timeout

      public Workflow.WorkflowSettingsBuilder timeout(Duration timeout)
      Define a timeout for the duration of the entire workflow. When the timeout expires, the workflow is finished and no transitions are allowed.
      Parameters:
      timeout - Timeout duration
    • timeout

      public <W> Workflow.WorkflowSettingsBuilder timeout(Duration timeout, akka.japi.function.Function<W,Workflow.StepEffect> timeoutFailoverStep)
      Define a timeout for the duration of the entire workflow with a timeout handler step. When the timeout expires, the specified timeout handler step will be executed to handle the timeout gracefully (e.g., cleanup, logging, or compensation). The timeout handler step must end the workflow - no further step transitions are allowed after a global timeout.
      Parameters:
      timeout - Timeout duration
      timeoutFailoverStep - Reference to the timeout handler step method
    • timeout

      public <W, I> Workflow.WorkflowSettingsBuilder timeout(Duration timeout, akka.japi.function.Function2<W,I,Workflow.StepEffect> timeoutFailoverStep, I input)
      Define a timeout for the duration of the entire workflow with a timeout handler step that accepts input. When the timeout expires, the specified timeout handler step will be executed with the provided input to handle the timeout gracefully (e.g., cleanup, logging, or compensation). The timeout handler step must end the workflow - no further step transitions are allowed after a global timeout.
      Parameters:
      timeout - Timeout duration
      timeoutFailoverStep - Reference to the timeout handler step method
      input - Input parameter to pass to the timeout handler step
    • defaultStepTimeout

      public Workflow.WorkflowSettingsBuilder defaultStepTimeout(Duration timeout)
      Define a default timeout duration for all steps. Can be overridden per step.
    • defaultStepRecovery

      @Deprecated public Workflow.WorkflowSettingsBuilder defaultStepRecovery(Workflow.RecoverStrategy<?> recoverStrategy)
      Deprecated.
      Define a default recovery strategy for all steps. Can be overridden per step.
    • stepTimeout

      public <W> Workflow.WorkflowSettingsBuilder stepTimeout(akka.japi.function.Function<W,Workflow.StepEffect> lambda, Duration timeout)
      Configure a specific step with a timeout.
      Parameters:
      lambda - Reference to the step method
      timeout - Timeout duration for this step
    • stepTimeout

      public <W, I> Workflow.WorkflowSettingsBuilder stepTimeout(akka.japi.function.Function2<W,I,Workflow.StepEffect> lambda, Duration timeout)
      Configure a specific step with a timeout.
      Parameters:
      lambda - Reference to the step method
      timeout - Timeout duration for this step
    • stepRecovery

      public <W> Workflow.WorkflowSettingsBuilder stepRecovery(akka.japi.function.Function<W,Workflow.StepEffect> lambda, Workflow.RecoverStrategy<?> recovery)
      Configure a specific step with a recovery strategy.
      Parameters:
      lambda - Reference to the step method
      recovery - Recovery strategy for this step
    • stepRecovery

      public <W, I> Workflow.WorkflowSettingsBuilder stepRecovery(akka.japi.function.Function2<W,I,Workflow.StepEffect> lambda, Workflow.RecoverStrategy<?> recovery)
      Configure a specific step with a recovery strategy.
      Parameters:
      lambda - Reference to the step method
      recovery - Recovery strategy for this step
    • passivationDelay

      public <W, I> Workflow.WorkflowSettingsBuilder passivationDelay(Duration delay)
      A paused (or finished) workflow will be kept in memory for the given delay before being passivated. This improves the performance of resuming such a workflow because it doesn't have to be recovered from the storage.
    • build

      public Workflow.WorkflowSettings build()
      Creates the final workflow configuration from this builder.
      Returns:
      The complete workflow configuration