MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / getWebhookSecret

Function getWebhookSecret

packages/server/src/services/chatflows/index.ts:673–693  ·  view source on GitHub ↗
(chatflowId: string, workspaceId: string)

Source from the content-addressed store, hash-verified

671}
672
673const getWebhookSecret = async (chatflowId: string, workspaceId: string): Promise<string | null> => {
674 try {
675 const appServer = getRunningExpressApp()
676 const dbResponse = await appServer.AppDataSource.getRepository(ChatFlow)
677 .createQueryBuilder('chatflow')
678 .select('chatflow.webhookSecret')
679 .where('chatflow.id = :id', { id: chatflowId })
680 .andWhere('chatflow.workspaceId = :workspaceId', { workspaceId })
681 .getOne()
682 const stored = dbResponse?.webhookSecret
683 if (!stored) return null
684 const decrypted = await decryptCredentialData(stored)
685 return (decrypted?.secret as string | undefined) ?? null
686 } catch (error) {
687 if (error instanceof InternalFlowiseError) throw error
688 throw new InternalFlowiseError(
689 StatusCodes.INTERNAL_SERVER_ERROR,
690 `Error: chatflowsService.getWebhookSecret - ${getErrorMessage(error)}`
691 )
692 }
693}
694
695export default {
696 assertChatflowIdsInWorkspace,

Callers

nothing calls this directly

Calls 3

getRunningExpressAppFunction · 0.90
decryptCredentialDataFunction · 0.90
getErrorMessageFunction · 0.90

Tested by

no test coverage detected