diff --git a/apps/webapp/app/services/knowledgeGraph.server.ts b/apps/webapp/app/services/knowledgeGraph.server.ts index 9cbc9ec..50c1a25 100644 --- a/apps/webapp/app/services/knowledgeGraph.server.ts +++ b/apps/webapp/app/services/knowledgeGraph.server.ts @@ -1135,10 +1135,25 @@ export class KnowledgeGraphService { return null; } + const integrationAccount = await prisma.integrationAccount.findFirst({ + where: { + integrationDefinition: { + slug: source, + }, + workspaceId: user.Workspace.id, + isActive: true, + deleted: null, + }, + }); + + if (!integrationAccount) { + return null; + } + // Fetch active rules for this source const rules = await prisma.ingestionRule.findMany({ where: { - source, + source: integrationAccount.id, workspaceId: user.Workspace.id, isActive: true, deleted: null,