Here’s my code in Go:
variables := map[string]interface{}{
"sessionDate": data.SessionDate,
"projectID": data.ProjectID,
}
// Assuming 'variables' is a map[string]interface{} with your process variables
processInstanceEvent, err := client.NewCreateInstanceCommand().
BPMNProcessId("Process_115z0rf"). // Replace with your actual BPMN process ID
LatestVersion().
VariablesFromMap(variables).
Send(context.Background())
And according to the official documentation of Camunda 8, the section on Creating a process instance, it should work. In the docs, the procedure is explained for Java users, though. But When I run my Go code, I get this error:
# command-line-arguments
.\testdb.go:102:18: multiple-value client.NewCreateInstanceCommand().BPMNProcessId("Process_115z0rf").LatestVersion().VariablesFromMap(variables) (value of type (commands.CreateInstanceCommandStep3, error)) in single-value context