feat(triggers): add Greenhouse webhook triggers#3985
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Registers a new Reviewed by Cursor Bugbot for commit 8518fe3. Configure here. |
Greptile SummaryThis PR adds 8 Greenhouse ATS webhook triggers (Candidate Hired, New Application, Candidate Stage Change, Candidate Rejected, Offer Created, Job Created, Job Updated, and a generic catch-all). The implementation is well-structured and follows the established codebase patterns: shared output-schema builders live in a central
Confidence Score: 5/5Safe to merge — the single remaining finding is a minor style/best-practice omission that does not affect runtime correctness. All P0/P1 concerns raised in prior review rounds (static import, HMAC verification, duplicated job payload) have been resolved. The only outstanding issue is a missing apps/sim/triggers/greenhouse/utils.ts — Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as Greenhouse
participant WH as Webhook Endpoint
participant PH as Provider Handler (greenhouse)
participant EM as Event Matcher
participant WE as Workflow Executor
GH->>WH: POST /webhook/{id}<br/>Signature: sha256 <digest>
WH->>PH: verifyAuth(request, rawBody, providerConfig)
alt secretKey configured
PH->>PH: validateGreenhouseSignature(secret, signature, body)
alt Signature invalid
PH-->>WH: 401 Unauthorized
WH-->>GH: 401
end
end
PH->>PH: formatInput() → { action, payload }
PH->>EM: matchEvent(triggerId, action)
alt triggerId !== greenhouse_webhook
EM->>EM: isGreenhouseEventMatch(triggerId, action)
alt Action mismatch
EM-->>WH: 200 { message: "Ignoring" }
WH-->>GH: 200
end
end
EM-->>WH: true (proceed)
WH->>WE: Execute workflow with { action, payload }
WE-->>WH: Execution result
WH-->>GH: 200 OK
Reviews (3): Last reviewed commit: "fix(triggers): align rejection_reason ou..." | Re-trigger Greptile |
- 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
|
@greptile |
|
@cursor review |
…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>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 8518fe3. Configure here.
* 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>
Summary
Type of Change
Testing
Tested manually
Checklist