MCPcopy Create free account
hub / github.com/ShipSecAI/studio / startWorkflow

Method startWorkflow

backend/src/temporal/temporal.service.ts:115–145  ·  view source on GitHub ↗
(options: StartWorkflowOptions)

Source from the content-addressed store, hash-verified

113 }
114
115 async startWorkflow(options: StartWorkflowOptions): Promise<WorkflowStartResult> {
116 const client = await this.getClient();
117 const workflowId = options.workflowId ?? `shipsec-workflow-${randomUUID()}`;
118 const taskQueue = options.taskQueue ?? this.defaultTaskQueue;
119
120 const argsSummary = this.formatArgsSummary(options.args);
121 this.logger.log(
122 `Starting Temporal workflow ${options.workflowType} (workflowId=${workflowId}, taskQueue=${taskQueue}, args=${argsSummary})`,
123 );
124
125 // Map workflow type string to function reference
126 const workflowFn = this.getWorkflowFunction(options.workflowType);
127
128 const handle = await client.start(workflowFn, {
129 workflowId,
130 taskQueue,
131 args: (options.args ?? []) as any,
132 memo: options.memo,
133 searchAttributes: options.searchAttributes as any,
134 });
135
136 this.logger.log(
137 `Started Temporal workflow ${handle.workflowId} (run ${handle.firstExecutionRunId})`,
138 );
139
140 return {
141 workflowId: handle.workflowId,
142 runId: handle.firstExecutionRunId,
143 taskQueue,
144 };
145 }
146
147 private getWorkflowFunction(workflowType: string) {
148 switch (workflowType) {

Callers 5

startPreparedRunMethod · 0.80
testServerConnectionMethod · 0.80
startDiscoveryMethod · 0.80
startGroupDiscoveryMethod · 0.80
executeParsingScriptMethod · 0.80

Calls 3

getClientMethod · 0.95
formatArgsSummaryMethod · 0.95
getWorkflowFunctionMethod · 0.95

Tested by

no test coverage detected