5865
5866
// Add predefined search attributes
5868
>
searchattribute.AddSearchAttributes(
5869
>
&searchAttributes,
5870
>
chasm.SearchAttributeBatcherUser.Value(identity),
5871
>
chasm.SearchAttributeTemporalNamespaceDivision.Value(batcher.NamespaceDivision),
5872
>
)
5873
>
5874
>
startReq := &workflowservice.StartWorkflowExecutionRequest{
5875
>
Namespace: request.Namespace,
5876
>
WorkflowId: request.GetJobId(),
5877
>
WorkflowType: &commonpb.WorkflowType{Name: batcher.BatchWFTypeProtobufName},
5878
>
TaskQueue: &taskqueuepb.TaskQueue{Name: primitives.PerNSWorkerTaskQueue},
5879
>
Input: inputPayload,
5880
>
Identity: identity,
5881
>
RequestId: uuid.NewString(),
5882
>
WorkflowIdConflictPolicy: enumspb.WORKFLOW_ID_CONFLICT_POLICY_FAIL,
5883
>
WorkflowIdReusePolicy: enumspb.WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE,
5884
>
Memo: memo,
5885
>
SearchAttributes: searchAttributes,
5886
>
Priority: &commonpb.Priority{}, // ie default priority
5887
>
}
5888
>
5889
>
_, err = wh.historyClient.StartWorkflowExecution(
5890
>
ctx,
5891
>
common.CreateHistoryStartWorkflowRequest(
5892
>
namespaceID.String(),
5893
>
startReq,
5894
>
nil,
5895
>
nil,
5896
>
time.Now().UTC(),
5897
>
),
5898
>
)
5899
>
if err != nil {
5900
return nil, err
5901
}
5903
}
5904