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

Method update

backend/src/workflows/workflows.service.ts:312–341  ·  view source on GitHub ↗
(
    id: string,
    dto: WorkflowGraphDto,
    auth?: AuthContext | null,
  )

Source from the content-addressed store, hash-verified

310 }
311
312 async update(
313 id: string,
314 dto: WorkflowGraphDto,
315 auth?: AuthContext | null,
316 ): Promise<ServiceWorkflowResponse> {
317 const input = this.parse(dto);
318
319 // Validate workflow graph before saving (including port connections)
320 try {
321 compileWorkflowGraph(input);
322 } catch (error) {
323 if (error instanceof Error) {
324 throw new BadRequestException(`Workflow validation failed: ${error.message}`);
325 }
326 throw error;
327 }
328
329 const organizationId = await this.requireWorkflowAdmin(id, auth);
330 const record = await this.repository.update(id, input, { organizationId });
331 const version = await this.versionRepository.create({
332 workflowId: record.id,
333 graph: input,
334 organizationId,
335 });
336 const response = this.buildWorkflowResponse(record, version);
337 this.logger.log(
338 `Updated workflow ${response.id} to version ${version.version} (nodes=${input.nodes.length}, edges=${input.edges.length})`,
339 );
340 return response;
341 }
342
343 async updateMetadata(
344 id: string,

Callers 1

Calls 5

parseMethod · 0.95
requireWorkflowAdminMethod · 0.95
buildWorkflowResponseMethod · 0.95
compileWorkflowGraphFunction · 0.90
createMethod · 0.45

Tested by

no test coverage detected