Class NewWorkflowOptions

java.lang.Object
io.dapr.workflows.client.NewWorkflowOptions

public class NewWorkflowOptions extends Object
Options for starting a new instance of a workflow.
  • Constructor Details

    • NewWorkflowOptions

      public NewWorkflowOptions()
  • Method Details

    • setVersion

      public NewWorkflowOptions setVersion(String version)
      Sets the version of the workflow to start.
      Parameters:
      version - the user-defined version of workflow
      Returns:
      this NewWorkflowOptions object
    • setInstanceId

      public NewWorkflowOptions setInstanceId(String instanceId)
      Sets the instance ID of the workflow to start.

      If no instance ID is configured, the workflow will be created with a randomly generated instance ID.

      Parameters:
      instanceId - the ID of the new workflow
      Returns:
      this NewWorkflowOptions object
    • setInput

      public NewWorkflowOptions setInput(Object input)
      Sets the input of the workflow to start.
      Parameters:
      input - the input of the new workflow
      Returns:
      this NewWorkflowOptions object
    • setStartTime

      public NewWorkflowOptions setStartTime(Instant startTime)
      Sets the start time of the new workflow.

      By default, new workflow instances start executing immediately. This method can be used to start them at a specific time in the future. If set, Dapr will not wait for the workflow to "start" which can improve throughput of creating many workflows.

      Parameters:
      startTime - the start time of the new workflow
      Returns:
      this NewWorkflowOptions object
    • getVersion

      public String getVersion()
      Gets the user-specified version of the new workflow.
      Returns:
      the user-specified version of the new workflow.
    • getInstanceId

      public String getInstanceId()
      Gets the instance ID of the new workflow.
      Returns:
      the instance ID of the new workflow.
    • getInput

      public Object getInput()
      Gets the input of the new workflow.
      Returns:
      the input of the new workflow.
    • getStartTime

      public Instant getStartTime()
      Gets the configured start time of the new workflow instance.
      Returns:
      the configured start time of the new workflow instance.