Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Apr 6, 2026
commit a4eef8b1be00f68f2602e472cf48ace816560390
24 changes: 5 additions & 19 deletions apps/sim/triggers/notion/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ export function buildNotionExtraFields(triggerId: string): SubBlockConfig[] {
]
Comment thread
waleedlatif1 marked this conversation as resolved.
}

/**
* Shared author output schema for Notion webhook payloads.
*/
function buildAuthorOutputs(): Record<string, TriggerOutput> {
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.
*/
Expand All @@ -94,7 +84,7 @@ function buildBaseOutputs(): Record<string, TriggerOutput> {
function buildEntityOutputs(): Record<string, TriggerOutput> {
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)' },
}
}
Comment thread
cursor[bot] marked this conversation as resolved.

Expand All @@ -107,13 +97,12 @@ export function buildPageEventOutputs(): Record<string, TriggerOutput> {
authors: {
type: 'array',
description: 'Array of users who triggered the event',
...buildAuthorOutputs(),
},
Comment thread
cursor[bot] marked this conversation as resolved.
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)' },
},
},
}
Expand All @@ -128,13 +117,12 @@ export function buildDatabaseEventOutputs(): Record<string, TriggerOutput> {
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)' },
},
},
}
Expand All @@ -149,16 +137,15 @@ export function buildCommentEventOutputs(): Record<string, TriggerOutput> {
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)' },
},
},
}
Expand All @@ -173,7 +160,6 @@ export function buildGenericWebhookOutputs(): Record<string, TriggerOutput> {
authors: {
type: 'array',
description: 'Array of users who triggered the event',
...buildAuthorOutputs(),
},
entity: buildEntityOutputs(),
data: {
Expand Down
Loading