MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / checkFlowValidation

Function checkFlowValidation

packages/server/src/services/validation/index.ts:315–339  ·  view source on GitHub ↗
(flowId: string, workspaceId?: string)

Source from the content-addressed store, hash-verified

313}
314
315const checkFlowValidation = async (flowId: string, workspaceId?: string): Promise<IValidationResult[]> => {
316 try {
317 const appServer = getRunningExpressApp()
318
319 // Create query conditions with workspace filtering if provided
320 const whereCondition: any = { id: flowId }
321 if (workspaceId) whereCondition.workspaceId = workspaceId
322
323 const flow = await appServer.AppDataSource.getRepository(ChatFlow).findOne({
324 where: whereCondition
325 })
326
327 if (!flow) {
328 throw new InternalFlowiseError(StatusCodes.NOT_FOUND, `Error: validationService.checkFlowValidation - flow not found!`)
329 }
330
331 const flowData: IReactFlowObject = JSON.parse(flow.flowData)
332 return validateFlowData(flowData.nodes, flowData.edges, appServer.nodesPool.componentNodes)
333 } catch (error) {
334 throw new InternalFlowiseError(
335 StatusCodes.INTERNAL_SERVER_ERROR,
336 `Error: validationService.checkFlowValidation - ${getErrorMessage(error)}`
337 )
338 }
339}
340
341export default {
342 checkFlowValidation

Callers

nothing calls this directly

Calls 4

getRunningExpressAppFunction · 0.90
getErrorMessageFunction · 0.90
validateFlowDataFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected