# NewWorkflowOption (dapr-sdk-parent 1.12.2 API)
declaration: package: io.dapr.workflows.client, class: NewWorkflowOption

Package io.dapr.workflows.client

# Class NewWorkflowOption

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

public class NewWorkflowOption extends Object
Options for starting a new instance of a workflow.

## Constructor Summary

Constructors
Constructor
Description
`NewWorkflowOption()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`getInput()`
Gets the input of the new workflow.
`String`
`getInstanceId()`
Gets the instance ID of the new workflow.
`com.microsoft.durabletask.NewOrchestrationInstanceOptions`
`getNewOrchestrationInstanceOptions()`
`Instant`
`getStartTime()`
Gets the configured start time of the new workflow instance.
`String`
`getVersion()`
Gets the user-specified version of the new workflow.
`NewWorkflowOption`
`setInput(Object input)`
Sets the input of the workflow to start.
`NewWorkflowOption`
`setInstanceId(String instanceId)`
Sets the instance ID of the workflow to start.
`NewWorkflowOption`
`setStartTime(Instant startTime)`
Sets the start time of the new workflow.
`NewWorkflowOption`
`setVersion(String version)`
Sets the version of the workflow to start.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### NewWorkflowOption

public NewWorkflowOption()

## Method Details

### setVersion

public NewWorkflowOption setVersion(String version)
Sets the version of the workflow to start.

Parameters:
  `version` - the user-defined version of workflow
Returns:
  this `NewWorkflowOption` object

### setInstanceId

public NewWorkflowOption 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 `NewWorkflowOption` object

### setInput

public NewWorkflowOption setInput(Object input)
Sets the input of the workflow to start.

Parameters:
  `input` - the input of the new workflow
Returns:
  this `NewWorkflowOption` object

### setStartTime

public NewWorkflowOption 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.

Parameters:
  `startTime` - the start time of the new workflow
Returns:
  this `NewWorkflowOption` 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.

### getNewOrchestrationInstanceOptions

public com.microsoft.durabletask.NewOrchestrationInstanceOptions getNewOrchestrationInstanceOptions()