Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5ca66c3
refactor(webhooks): extract provider-specific logic into handler regi…
waleedlatif1 Apr 6, 2026
925be3d
feat(triggers): add Salesforce webhook triggers (#3982)
waleedlatif1 Apr 6, 2026
c9b45f4
feat(triggers): add HubSpot merge, restore, and generic webhook trigg…
waleedlatif1 Apr 6, 2026
62a7700
feat(integrations): add Sixtyfour AI integration (#3981)
waleedlatif1 Apr 6, 2026
796384a
feat(triggers): add Resend webhook triggers with auto-registration (#…
waleedlatif1 Apr 6, 2026
62ea0f1
feat(triggers): add Gong webhook triggers for call events (#3984)
waleedlatif1 Apr 6, 2026
590f376
feat(triggers): add Intercom webhook triggers (#3990)
waleedlatif1 Apr 6, 2026
7ea0693
feat(triggers): add Greenhouse webhook triggers (#3985)
waleedlatif1 Apr 6, 2026
21e5b5c
feat(triggers): add Notion webhook triggers (#3989)
waleedlatif1 Apr 6, 2026
c18f023
feat(analytics): add Google Tag Manager and Google Analytics for host…
waleedlatif1 Apr 6, 2026
8b1d749
feat(triggers): add Vercel webhook triggers with automatic registrati…
waleedlatif1 Apr 6, 2026
cd5cee3
feat(landing): add PostHog tracking for CTA clicks, demo requests, an…
waleedlatif1 Apr 6, 2026
18a7868
feat(triggers): add Zoom webhook triggers (#3992)
waleedlatif1 Apr 6, 2026
5ea63f1
feat(triggers): add Linear v2 triggers with automatic webhook registr…
waleedlatif1 Apr 6, 2026
7e0794c
fix(signup): show multiple signup errors at once (#3987)
TheodoreSpeaks Apr 6, 2026
58571fe
fix(hitl): fix stream endpoint, pause persistence, and resume page (#…
waleedlatif1 Apr 6, 2026
2164cef
fix(mothership): fix url keeping markdown hash on resource switch (#3…
TheodoreSpeaks Apr 7, 2026
8c8c627
feat(block): Conditionally hide impersonateUser field from block, add…
TheodoreSpeaks Apr 7, 2026
25b4a3f
feat(posthog): Add posthog log for signup failed (#3998)
TheodoreSpeaks Apr 7, 2026
df2c47a
fix(copilot): fix copilot running workflow stuck on 10mb error (#3999)
TheodoreSpeaks Apr 7, 2026
8df3f20
fix(blocks): allow tool expansion in disabled mode, improve child dep…
waleedlatif1 Apr 7, 2026
5eb494d
fix(secrets): secrets/integrations component code cleanup (#4003)
icecrasher321 Apr 7, 2026
606477e
feat(home): add folders to resource menu (#4000)
waleedlatif1 Apr 7, 2026
cc8c9e8
feat(home): add double-enter to send top queued message (#4005)
waleedlatif1 Apr 7, 2026
c52834b
fix(subflows): make edges inside subflows directly clickable (#3969)
waleedlatif1 Apr 7, 2026
609ba61
fix(sockets): joining currently deleted workflow (#4004)
icecrasher321 Apr 7, 2026
89ae738
feat(folders): soft-delete folders and show in Recently Deleted (#4001)
waleedlatif1 Apr 7, 2026
64c6cd9
fix(webhooks): harden audited provider triggers (#3997)
waleedlatif1 Apr 7, 2026
8e11c32
fix(resource-menu): consistent height between 1 result and no results…
waleedlatif1 Apr 7, 2026
1e00a06
fix(home): simplify enter-to-send queued message to single press (#4008)
waleedlatif1 Apr 7, 2026
7793583
fix(secrets): restore unsaved-changes guard for settings tab navigati…
waleedlatif1 Apr 7, 2026
68df732
refactor(triggers): consolidate v2 Linear triggers into same files as…
waleedlatif1 Apr 7, 2026
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
feat(triggers): add Greenhouse webhook triggers (#3985)
* feat(triggers): add Greenhouse webhook triggers

Add 8 webhook triggers for Greenhouse ATS events:
- Candidate Hired, New Application, Stage Change, Rejected
- Offer Created, Job Created, Job Updated
- Generic Webhook (all events)

Includes event filtering via provider handler registry and output
schemas matching actual Greenhouse webhook payload structures.

* fix(triggers): address PR review feedback for Greenhouse triggers

- Fix rejection_reason.type key collision with mock payload generator
  by renaming to reason_type
- Replace dynamic import with static import in matchEvent handler
- Add HMAC-SHA256 signature verification via createHmacVerifier
- Add secretKey extra field to all trigger subBlocks
- Extract shared buildJobPayload helper to deduplicate job outputs

* fix(triggers): align rejection_reason output with actual Greenhouse payload

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>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
waleedlatif1 and claude authored Apr 6, 2026
commit 7ea06931c8f5cd70550455841535769582e42c95
26 changes: 26 additions & 0 deletions apps/sim/blocks/blocks/greenhouse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GreenhouseIcon } from '@/components/icons'
import { AuthMode, type BlockConfig, IntegrationType } from '@/blocks/types'
import type { GreenhouseResponse } from '@/tools/greenhouse/types'
import { getTrigger } from '@/triggers'

export const GreenhouseBlock: BlockConfig<GreenhouseResponse> = {
type: 'greenhouse',
Expand All @@ -16,6 +17,20 @@ export const GreenhouseBlock: BlockConfig<GreenhouseResponse> = {
icon: GreenhouseIcon,
authMode: AuthMode.ApiKey,

triggers: {
enabled: true,
available: [
'greenhouse_candidate_hired',
'greenhouse_new_application',
'greenhouse_candidate_stage_change',
'greenhouse_candidate_rejected',
'greenhouse_offer_created',
'greenhouse_job_created',
'greenhouse_job_updated',
'greenhouse_webhook',
],
},

subBlocks: [
{
id: 'operation',
Expand Down Expand Up @@ -291,6 +306,17 @@ Return ONLY the ISO 8601 timestamp - no explanations, no extra text.`,
required: true,
password: true,
},

// ── Trigger subBlocks ──

...getTrigger('greenhouse_candidate_hired').subBlocks,
...getTrigger('greenhouse_new_application').subBlocks,
...getTrigger('greenhouse_candidate_stage_change').subBlocks,
...getTrigger('greenhouse_candidate_rejected').subBlocks,
...getTrigger('greenhouse_offer_created').subBlocks,
...getTrigger('greenhouse_job_created').subBlocks,
...getTrigger('greenhouse_job_updated').subBlocks,
...getTrigger('greenhouse_webhook').subBlocks,
],

tools: {
Expand Down
80 changes: 80 additions & 0 deletions apps/sim/lib/webhooks/providers/greenhouse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import crypto from 'crypto'
import { createLogger } from '@sim/logger'
import { NextResponse } from 'next/server'
import { safeCompare } from '@/lib/core/security/encryption'
import type {
EventMatchContext,
FormatInputContext,
FormatInputResult,
WebhookProviderHandler,
} from '@/lib/webhooks/providers/types'
import { createHmacVerifier } from '@/lib/webhooks/providers/utils'
import { isGreenhouseEventMatch } from '@/triggers/greenhouse/utils'

const logger = createLogger('WebhookProvider:Greenhouse')

/**
* Validates the Greenhouse HMAC-SHA256 signature.
* Greenhouse sends: `Signature: sha256 <hexdigest>`
*/
function validateGreenhouseSignature(secretKey: string, signature: string, body: string): boolean {
try {
if (!secretKey || !signature || !body) {
return false
}
const prefix = 'sha256 '
if (!signature.startsWith(prefix)) {
return false
}
const providedDigest = signature.substring(prefix.length)
const computedDigest = crypto.createHmac('sha256', secretKey).update(body, 'utf8').digest('hex')
return safeCompare(computedDigest, providedDigest)
} catch {
logger.error('Error validating Greenhouse signature')
return false
}
}

export const greenhouseHandler: WebhookProviderHandler = {
verifyAuth: createHmacVerifier({
configKey: 'secretKey',
headerName: 'signature',
validateFn: validateGreenhouseSignature,
providerLabel: 'Greenhouse',
}),

async formatInput({ body }: FormatInputContext): Promise<FormatInputResult> {
const b = body as Record<string, unknown>
return {
input: {
action: b.action,
payload: b.payload || {},
},
}
},

async matchEvent({ webhook, body, requestId, providerConfig }: EventMatchContext) {
const triggerId = providerConfig.triggerId as string | undefined
const b = body as Record<string, unknown>
const action = b.action as string | undefined

if (triggerId && triggerId !== 'greenhouse_webhook') {
if (!isGreenhouseEventMatch(triggerId, action || '')) {
logger.debug(
`[${requestId}] Greenhouse event mismatch for trigger ${triggerId}. Action: ${action}. Skipping execution.`,
{
webhookId: webhook.id,
triggerId,
receivedAction: action,
}
)

return NextResponse.json({
message: 'Event type does not match trigger configuration. Ignoring.',
})
}
}

return true
},
}
2 changes: 2 additions & 0 deletions apps/sim/lib/webhooks/providers/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { gmailHandler } from '@/lib/webhooks/providers/gmail'
import { gongHandler } from '@/lib/webhooks/providers/gong'
import { googleFormsHandler } from '@/lib/webhooks/providers/google-forms'
import { grainHandler } from '@/lib/webhooks/providers/grain'
import { greenhouseHandler } from '@/lib/webhooks/providers/greenhouse'
import { hubspotHandler } from '@/lib/webhooks/providers/hubspot'
import { imapHandler } from '@/lib/webhooks/providers/imap'
import { intercomHandler } from '@/lib/webhooks/providers/intercom'
Expand Down Expand Up @@ -54,6 +55,7 @@ const PROVIDER_HANDLERS: Record<string, WebhookProviderHandler> = {
google_forms: googleFormsHandler,
fathom: fathomHandler,
grain: grainHandler,
greenhouse: greenhouseHandler,
hubspot: hubspotHandler,
imap: imapHandler,
intercom: intercomHandler,
Expand Down
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
41 changes: 41 additions & 0 deletions apps/sim/triggers/greenhouse/candidate_hired.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { GreenhouseIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildCandidateHiredOutputs,
buildGreenhouseExtraFields,
greenhouseSetupInstructions,
greenhouseTriggerOptions,
} from '@/triggers/greenhouse/utils'
import type { TriggerConfig } from '@/triggers/types'

/**
* Greenhouse Candidate Hired Trigger
*
* This is the PRIMARY trigger - it includes the dropdown for selecting trigger type.
* Fires when a candidate is marked as hired in Greenhouse.
*/
export const greenhouseCandidateHiredTrigger: TriggerConfig = {
id: 'greenhouse_candidate_hired',
name: 'Greenhouse Candidate Hired',
provider: 'greenhouse',
description: 'Trigger workflow when a candidate is hired',
version: '1.0.0',
icon: GreenhouseIcon,

subBlocks: buildTriggerSubBlocks({
triggerId: 'greenhouse_candidate_hired',
triggerOptions: greenhouseTriggerOptions,
includeDropdown: true,
setupInstructions: greenhouseSetupInstructions('Candidate Hired'),
extraFields: buildGreenhouseExtraFields('greenhouse_candidate_hired'),
}),

outputs: buildCandidateHiredOutputs(),

webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}
39 changes: 39 additions & 0 deletions apps/sim/triggers/greenhouse/candidate_rejected.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { GreenhouseIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildCandidateRejectedOutputs,
buildGreenhouseExtraFields,
greenhouseSetupInstructions,
greenhouseTriggerOptions,
} from '@/triggers/greenhouse/utils'
import type { TriggerConfig } from '@/triggers/types'

/**
* Greenhouse Candidate Rejected Trigger
*
* Fires when a candidate is rejected from a position.
*/
export const greenhouseCandidateRejectedTrigger: TriggerConfig = {
id: 'greenhouse_candidate_rejected',
name: 'Greenhouse Candidate Rejected',
provider: 'greenhouse',
description: 'Trigger workflow when a candidate is rejected',
version: '1.0.0',
icon: GreenhouseIcon,

subBlocks: buildTriggerSubBlocks({
triggerId: 'greenhouse_candidate_rejected',
triggerOptions: greenhouseTriggerOptions,
setupInstructions: greenhouseSetupInstructions('Candidate Rejected'),
extraFields: buildGreenhouseExtraFields('greenhouse_candidate_rejected'),
}),

outputs: buildCandidateRejectedOutputs(),

webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}
39 changes: 39 additions & 0 deletions apps/sim/triggers/greenhouse/candidate_stage_change.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { GreenhouseIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildCandidateStageChangeOutputs,
buildGreenhouseExtraFields,
greenhouseSetupInstructions,
greenhouseTriggerOptions,
} from '@/triggers/greenhouse/utils'
import type { TriggerConfig } from '@/triggers/types'

/**
* Greenhouse Candidate Stage Change Trigger
*
* Fires when a candidate moves to a different interview stage.
*/
export const greenhouseCandidateStageChangeTrigger: TriggerConfig = {
id: 'greenhouse_candidate_stage_change',
name: 'Greenhouse Candidate Stage Change',
provider: 'greenhouse',
description: 'Trigger workflow when a candidate changes interview stages',
version: '1.0.0',
icon: GreenhouseIcon,

subBlocks: buildTriggerSubBlocks({
triggerId: 'greenhouse_candidate_stage_change',
triggerOptions: greenhouseTriggerOptions,
setupInstructions: greenhouseSetupInstructions('Candidate Stage Change'),
extraFields: buildGreenhouseExtraFields('greenhouse_candidate_stage_change'),
}),

outputs: buildCandidateStageChangeOutputs(),

webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}
8 changes: 8 additions & 0 deletions apps/sim/triggers/greenhouse/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export { greenhouseCandidateHiredTrigger } from './candidate_hired'
export { greenhouseCandidateRejectedTrigger } from './candidate_rejected'
export { greenhouseCandidateStageChangeTrigger } from './candidate_stage_change'
export { greenhouseJobCreatedTrigger } from './job_created'
export { greenhouseJobUpdatedTrigger } from './job_updated'
export { greenhouseNewApplicationTrigger } from './new_application'
export { greenhouseOfferCreatedTrigger } from './offer_created'
export { greenhouseWebhookTrigger } from './webhook'
39 changes: 39 additions & 0 deletions apps/sim/triggers/greenhouse/job_created.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { GreenhouseIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildGreenhouseExtraFields,
buildJobCreatedOutputs,
greenhouseSetupInstructions,
greenhouseTriggerOptions,
} from '@/triggers/greenhouse/utils'
import type { TriggerConfig } from '@/triggers/types'

/**
* Greenhouse Job Created Trigger
*
* Fires when a new job posting is created.
*/
export const greenhouseJobCreatedTrigger: TriggerConfig = {
id: 'greenhouse_job_created',
name: 'Greenhouse Job Created',
provider: 'greenhouse',
description: 'Trigger workflow when a new job is created',
version: '1.0.0',
icon: GreenhouseIcon,

subBlocks: buildTriggerSubBlocks({
triggerId: 'greenhouse_job_created',
triggerOptions: greenhouseTriggerOptions,
setupInstructions: greenhouseSetupInstructions('Job Created'),
extraFields: buildGreenhouseExtraFields('greenhouse_job_created'),
}),

outputs: buildJobCreatedOutputs(),

webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}
39 changes: 39 additions & 0 deletions apps/sim/triggers/greenhouse/job_updated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { GreenhouseIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildGreenhouseExtraFields,
buildJobUpdatedOutputs,
greenhouseSetupInstructions,
greenhouseTriggerOptions,
} from '@/triggers/greenhouse/utils'
import type { TriggerConfig } from '@/triggers/types'

/**
* Greenhouse Job Updated Trigger
*
* Fires when a job posting is updated.
*/
export const greenhouseJobUpdatedTrigger: TriggerConfig = {
id: 'greenhouse_job_updated',
name: 'Greenhouse Job Updated',
provider: 'greenhouse',
description: 'Trigger workflow when a job is updated',
version: '1.0.0',
icon: GreenhouseIcon,

subBlocks: buildTriggerSubBlocks({
triggerId: 'greenhouse_job_updated',
triggerOptions: greenhouseTriggerOptions,
setupInstructions: greenhouseSetupInstructions('Job Updated'),
extraFields: buildGreenhouseExtraFields('greenhouse_job_updated'),
}),

outputs: buildJobUpdatedOutputs(),

webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
},
}
Loading
Loading