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

Method commit

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

Source from the content-addressed store, hash-verified

705 }
706
707 async commit(id: string, auth?: AuthContext | null): Promise<WorkflowDefinition> {
708 const organizationId = await this.requireWorkflowAdmin(id, auth);
709 const workflow = await this.repository.findById(id, { organizationId });
710 if (!workflow) {
711 throw new NotFoundException(`Workflow ${id} not found`);
712 }
713
714 const version = await this.versionRepository.findLatestByWorkflowId(id, {
715 organizationId,
716 });
717 if (!version) {
718 throw new NotFoundException(`No versions recorded for workflow ${id}`);
719 }
720
721 this.logger.log(`Compiling workflow ${workflow.id} version ${version.version}`);
722 const graph = WorkflowGraphSchema.parse(version.graph);
723 const definition = compileWorkflowGraph(graph);
724 await this.repository.saveCompiledDefinition(id, definition, { organizationId });
725 await this.versionRepository.setCompiledDefinition(version.id, definition, {
726 organizationId,
727 });
728 this.logger.log(
729 `Compiled workflow ${workflow.id} version ${version.version} with ${definition.actions.length} action(s); entrypoint=${definition.entrypoint.ref}`,
730 );
731 return definition;
732 }
733
734 async run(
735 id: string,

Calls 7

requireWorkflowAdminMethod · 0.95
compileWorkflowGraphFunction · 0.90
parseMethod · 0.80
setCompiledDefinitionMethod · 0.80
findByIdMethod · 0.45

Tested by

no test coverage detected