From a4eef8b1be00f68f2602e472cf48ace816560390 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 6 Apr 2026 11:26:51 -0700 Subject: [PATCH] fix(triggers): resolve type field collision in Notion trigger outputs Rename nested `type` fields to `entity_type`/`parent_type` to avoid collision with processOutputField's leaf node detection which checks `'type' in field`. Remove spread of author outputs into `authors` array which was overwriting `type: 'array'`. Co-Authored-By: Claude Opus 4.6 --- apps/sim/triggers/notion/utils.ts | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/apps/sim/triggers/notion/utils.ts b/apps/sim/triggers/notion/utils.ts index e2e4ad09a7..d29c636477 100644 --- a/apps/sim/triggers/notion/utils.ts +++ b/apps/sim/triggers/notion/utils.ts @@ -59,16 +59,6 @@ export function buildNotionExtraFields(triggerId: string): SubBlockConfig[] { ] } -/** - * Shared author output schema for Notion webhook payloads. - */ -function buildAuthorOutputs(): Record { - return { - id: { type: 'string', description: 'Author user ID' }, - type: { type: 'string', description: 'Author type (person or bot)' }, - } -} - /** * Base webhook outputs common to all Notion triggers. */ @@ -94,7 +84,7 @@ function buildBaseOutputs(): Record { function buildEntityOutputs(): Record { return { id: { type: 'string', description: 'Entity ID (page or database ID)' }, - type: { type: 'string', description: 'Entity type (page or database)' }, + entity_type: { type: 'string', description: 'Entity type (page or database)' }, } } @@ -107,13 +97,12 @@ export function buildPageEventOutputs(): Record { authors: { type: 'array', description: 'Array of users who triggered the event', - ...buildAuthorOutputs(), }, entity: buildEntityOutputs(), data: { parent: { id: { type: 'string', description: 'Parent page or database ID' }, - type: { type: 'string', description: 'Parent type (database, page, workspace)' }, + parent_type: { type: 'string', description: 'Parent type (database, page, workspace)' }, }, }, } @@ -128,13 +117,12 @@ export function buildDatabaseEventOutputs(): Record { authors: { type: 'array', description: 'Array of users who triggered the event', - ...buildAuthorOutputs(), }, entity: buildEntityOutputs(), data: { parent: { id: { type: 'string', description: 'Parent page or workspace ID' }, - type: { type: 'string', description: 'Parent type (page, workspace)' }, + parent_type: { type: 'string', description: 'Parent type (page, workspace)' }, }, }, } @@ -149,16 +137,15 @@ export function buildCommentEventOutputs(): Record { authors: { type: 'array', description: 'Array of users who triggered the event', - ...buildAuthorOutputs(), }, entity: { id: { type: 'string', description: 'Comment ID' }, - type: { type: 'string', description: 'Entity type (comment)' }, + entity_type: { type: 'string', description: 'Entity type (comment)' }, }, data: { parent: { id: { type: 'string', description: 'Parent page ID' }, - type: { type: 'string', description: 'Parent type (page)' }, + parent_type: { type: 'string', description: 'Parent type (page)' }, }, }, } @@ -173,7 +160,6 @@ export function buildGenericWebhookOutputs(): Record { authors: { type: 'array', description: 'Array of users who triggered the event', - ...buildAuthorOutputs(), }, entity: buildEntityOutputs(), data: {