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

Function runWorkflow

worker/scripts/workflow-runner.ts:151–177  ·  view source on GitHub ↗
(
  client: Client,
  definition: WorkflowDefinition,
  workflowRecordId: string,
  fileId: string,
)

Source from the content-addressed store, hash-verified

149}
150
151async function runWorkflow(
152 client: Client,
153 definition: WorkflowDefinition,
154 workflowRecordId: string,
155 fileId: string,
156): Promise<{ runId: string; result: unknown }> {
157 const temporalWorkflowId = `shipsec-run-${randomUUID()}`;
158 const taskQueue = process.env.TEMPORAL_TASK_QUEUE ?? 'shipsec-default';
159
160 const handle = await client.workflow.start(shipsecWorkflowRun, {
161 workflowId: temporalWorkflowId,
162 taskQueue,
163 args: [
164 {
165 runId: temporalWorkflowId,
166 workflowId: workflowRecordId,
167 definition,
168 inputs: {
169 input1: fileId,
170 },
171 },
172 ],
173 });
174
175 const result = await handle.result();
176 return { runId: temporalWorkflowId, result };
177}
178
179async function main() {
180 const { workflowRecordId, fileId, limit, shouldRun, list } = parseArgs();

Callers 1

mainFunction · 0.70

Calls 1

resultMethod · 0.80

Tested by

no test coverage detected