Skip to content

feat(triggers): add Gong webhook triggers for call events#3984

Merged
waleedlatif1 merged 4 commits intostagingfrom
waleedlatif1/add-gong-trigger
Apr 6, 2026
Merged

feat(triggers): add Gong webhook triggers for call events#3984
waleedlatif1 merged 4 commits intostagingfrom
waleedlatif1/add-gong-trigger

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add Gong webhook triggers (gong_call_completed, gong_webhook) for receiving call data from Gong automation rules
  • Create provider handler in the new refactored webhook providers registry
  • Wire triggers into existing Gong block with triggerAllowed and trigger subBlocks

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 6, 2026

PR Summary

Medium Risk
Introduces new inbound webhook surface and provider parsing for Gong events; mis-parsing or unexpected payloads could affect workflow executions, but changes are scoped to the new provider/triggers.

Overview
Adds Gong webhook triggers (gong_webhook and gong_call_completed) so workflows can start from Gong automation-rule events, including UI sub-blocks for trigger selection, webhook URL display, and setup instructions.

Wires Gong into the webhook provider registry via a new gong handler that normalizes incoming payloads into structured trigger inputs/outputs, and updates the Gong integration metadata and GongBlock to allow triggers and expose the new trigger sub-blocks.

Reviewed by Cursor Bugbot for commit a79bb4b. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 6, 2026 6:02pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 6, 2026

Greptile Summary

This PR adds Gong webhook trigger support to the Sim platform, introducing two trigger types (gong_webhook and gong_call_completed) that allow workflows to fire when Gong automation rules deliver call events. The implementation closely mirrors the established pattern used by the circleback and fathom integrations.

  • New triggers (triggers/gong/): A primary gong_webhook trigger with a selectedTriggerId dropdown (defaulting to gong_webhook, now listed first) and a secondary gong_call_completed trigger; all subBlocks are conditionally gated on the dropdown value
  • Provider handler (lib/webhooks/providers/gong.ts): Flattens the raw Gong POST body into isTest, callData, metaData, parties, context, and trackers fields for downstream workflow use
  • Block integration (blocks/blocks/gong.ts): triggerAllowed: true is set, both trigger subBlock arrays are spread in via getTrigger(), and a triggers.available declaration is added
  • Registrations: Both triggers are added to TRIGGER_REGISTRY and the provider handler is registered under 'gong' in PROVIDER_HANDLERS
  • Auth: No custom verifyAuth on gongHandler; the registry's defaultHandler provides optional bearer-token validation when providerConfig.token is configured — consistent with other manual-setup triggers such as circleback

Confidence Score: 5/5

Safe to merge — implementation is correct, follows established patterns, and all prior review concerns are resolved

All findings from previous review threads (auth design, triggerSave pattern, buildGenericOutputs delegation, dropdown ordering) were addressed by the developer with clear justifications. The Gong trigger code is structurally identical to the circleback and fathom integrations. No new P0 or P1 issues were found in this review pass.

No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/providers/gong.ts Webhook provider handler that flattens the Gong call payload into isTest, callData, metaData, parties, context, and trackers; no verifyAuth — falls back to defaultHandler bearer-token check
apps/sim/triggers/gong/utils.ts Shared utilities: trigger dropdown options, HTML setup-instruction generator, buildCallOutputs() and buildGenericOutputs() output schema builders
apps/sim/triggers/gong/webhook.ts Primary Gong Webhook trigger with selectedTriggerId dropdown defaulting to gong_webhook (first option); all subBlocks gated on dropdown selection
apps/sim/triggers/gong/call_completed.ts Secondary Gong Call Completed trigger; subBlocks conditioned on selectedTriggerId === gong_call_completed, mirrors circleback/fathom pattern
apps/sim/blocks/blocks/gong.ts Adds triggerAllowed, spreads both Gong trigger subBlock arrays via getTrigger(), and declares triggers.available
apps/sim/triggers/registry.ts Registers gong_webhook and gong_call_completed in TRIGGER_REGISTRY, alphabetically placed between gmail_poller and grain_webhook
apps/sim/lib/webhooks/providers/registry.ts Registers gongHandler under the 'gong' provider key; defaultHandler supplies bearer-token fallback when verifyAuth is absent
apps/sim/triggers/gong/index.ts Barrel export for gongCallCompletedTrigger and gongWebhookTrigger
apps/sim/app/(landing)/integrations/data/integrations.json Adds gong_webhook and gong_call_completed to Gong's triggers list and sets triggerCount to 2

Sequence Diagram

sequenceDiagram
    participant Gong as Gong
    participant API as Webhook Endpoint
    participant Registry as providers/registry
    participant Handler as gongHandler
    participant Executor as Workflow Executor

    Gong->>API: POST /api/webhooks/trigger/{path}
    Note over Gong,API: {isTest, callData:{metaData,<br/>parties, context, content}}
    API->>Registry: getProviderHandler("gong")
    Registry-->>API: gongHandler (no verifyAuth)
    Note over API: defaultHandler checks bearer token<br/>if providerConfig.token is set
    API->>Handler: formatInput({ body })
    Note over Handler: Extracts: isTest, callData,<br/>metaData (from callData.metaData),<br/>parties, context, trackers<br/>(from callData.content.trackers)
    Handler-->>API: { input: { isTest, callData,<br/>metaData, parties, context, trackers } }
    API->>Executor: executeWorkflowCore({ input })
    Executor-->>Gong: 200 OK
Loading

Reviews (3): Last reviewed commit: "json" | Re-trigger Greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 a79bb4b. Configure here.

@waleedlatif1 waleedlatif1 merged commit 62ea0f1 into staging Apr 6, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/add-gong-trigger branch April 6, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant