How to set a Cron Schedule in Go
Create an instance of StartWorkflowOptions
from the go.temporal.io/sdk/client
package, set the CronSchedule
field, and pass the instance to the ExecuteWorkflow
call.
- Type:
string
- Default: None
workflowOptions := client.StartWorkflowOptions{
CronSchedule: "15 8 * * *",
// ...
}
workflowRun, err := c.ExecuteWorkflow(context.Background(), workflowOptions, YourWorkflowDefinition)
if err != nil {
// ...
}