Skip to content
Merged
Show file tree
Hide file tree
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
fix(triggers): align rejection_reason output with actual Greenhouse p…
…ayload

Reverted reason_type rename — instead flattened rejection_reason to JSON
type since TriggerOutput's type?: string conflicts with nested type keys.
Also hardened processOutputField to check typeof type === 'string' before
treating an object as a leaf node, preventing this class of bug for future triggers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude committed Apr 6, 2026
commit 8518fe34eece3694236d0cc4c2e545440fa59854
7 changes: 6 additions & 1 deletion apps/sim/lib/workflows/triggers/trigger-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ function processOutputField(key: string, field: unknown, depth = 0, maxDepth = 1
return null
}

if (field && typeof field === 'object' && 'type' in field) {
if (
field &&
typeof field === 'object' &&
'type' in field &&
typeof (field as Record<string, unknown>).type === 'string'
) {
const typedField = field as { type: string; description?: string }
return generateMockValue(typedField.type, typedField.description, key)
}
Expand Down
8 changes: 2 additions & 6 deletions apps/sim/triggers/greenhouse/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,8 @@ export function buildCandidateRejectedOutputs(): Record<string, TriggerOutput> {
},
jobs: { type: 'json', description: 'Associated jobs (array)' },
rejection_reason: {
id: { type: 'number', description: 'Rejection reason ID' },
name: { type: 'string', description: 'Rejection reason name' },
reason_type: {
id: { type: 'number', description: 'Rejection reason type ID' },
name: { type: 'string', description: 'Rejection reason type name' },
},
type: 'json',
description: 'Rejection reason object with id, name, and type fields',
},
Comment thread
cursor[bot] marked this conversation as resolved.
rejection_details: { type: 'json', description: 'Rejection details with custom fields' },
custom_fields: { type: 'json', description: 'Application custom fields' },
Expand Down
Loading