Skip to content

feat(confluence): add webhook triggers for Confluence events - #3318

Merged
waleedlatif1 merged 9 commits into
stagingfrom
feat/confluence-triggers
Feb 24, 2026
Merged

feat(confluence): add webhook triggers for Confluence events#3318
waleedlatif1 merged 9 commits into
stagingfrom
feat/confluence-triggers

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Added 16 Confluence webhook triggers (page, comment, blog, attachment, space, label events) + generic catch-all
  • Wired triggers into ConfluenceV2Block with trigger subBlocks and triggers config
  • Added Confluence signature verification and event filtering in webhook processor
  • Added formatWebhookInput handler with extractors aligned to actual Confluence API payloads
  • Outputs match real webhook payload structure (flat spaceKey, numeric version, actual API fields)

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)

@vercel

vercelBot commented Feb 24, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedFeb 24, 2026 7:22am

Request Review

@greptile-apps

greptile-appsBot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Added comprehensive Confluence webhook trigger support with 16 specific event triggers plus a generic catch-all webhook. Implementation follows established patterns from Jira/GitHub/Linear integrations with proper HMAC signature verification, payload-based event filtering, and entity-specific data extraction.

Key Changes:

  • Added 16 Confluence webhook triggers covering pages, comments, blogs, attachments, spaces, and labels
  • Implemented signature verification using validateJiraSignature (Confluence uses same HMAC-SHA256 approach as Jira)
  • Added payload-based filtering via isConfluencePayloadMatch (Confluence lacks explicit event field, so detection relies on entity presence)
  • Created entity-specific extractors (extractPageData, extractCommentData, etc.) in formatWebhookInput
  • Integrated all triggers into ConfluenceV2Block with proper subBlocks spreading and triggers config
  • Fixed webhookSecret field access across Jira, Linear, and GitHub for consistency
  • Registered all 16 triggers in the global trigger registry

Architecture:

  • Signature verification reuses validateJiraSignature since both use X-Hub-Signature with HMAC-SHA256
  • Payload filtering happens before workflow execution to avoid unnecessary processing
  • Generic webhook trigger (confluence_webhook) accepts all events and preserves all entity fields
  • All trigger files follow consistent structure with proper outputs, icons, and setup instructions

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured implementation following established patterns for webhook triggers (Jira, GitHub, Linear). Proper signature verification, payload filtering, and comprehensive test coverage across 16 event types. Code is consistent, uses existing utilities, and includes proper type safety.
  • No files require special attention

Important Files Changed

FilenameOverview
apps/sim/triggers/confluence/utils.tsAdded comprehensive utilities for 16 Confluence triggers with proper payload extraction and filtering
apps/sim/lib/webhooks/processor.tsAdded Confluence signature verification and payload filtering, fixed webhookSecret usage across providers
apps/sim/lib/webhooks/utils.server.tsAdded formatWebhookInput handler with entity-specific extractors for all Confluence event types
apps/sim/blocks/blocks/confluence.tsIntegrated 16 Confluence triggers into ConfluenceV2Block with proper subBlocks and triggers config
apps/sim/triggers/registry.tsRegistered all 16 Confluence triggers in the global trigger registry

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Confluence Webhook Event] --> B{Signature Verification}
B -->|Valid/No Secret| C{Provider Check}
B -->|Invalid| D[Return 401]
C -->|confluence| E{Payload Filtering}
E -->|Match triggerId| F[formatWebhookInput]
E -->|No Match| G[Skip Execution]
F -->|page_*| H[extractPageData]
F -->|comment_*| I[extractCommentData]
F -->|blog_*| J[extractBlogData]
F -->|attachment_*| K[extractAttachmentData]
F -->|space_*| L[extractSpaceData]
F -->|label_*| M[extractLabelData]
F -->|generic webhook| N[Extract All Entities]
H --> O[Queue Workflow Execution]
I --> O
J --> O
K --> O
L --> O
M --> O
N --> O
Loading

Last reviewed commit: f9d5f2c

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

22 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

waleedlatif1and others added 4 commits February 23, 2026 22:27
Adds 16 Confluence triggers: page CRUD, comments, blogs, attachments,
spaces, and labels — plus a generic webhook trigger.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add trigger subBlocks and triggers config to ConfluenceV2Block so
triggers appear in the UI. Add Confluence signature verification and
event filtering to the webhook processor.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rewrite output builders to match real Confluence webhook payload
structure (flat spaceKey, numeric version, actual API fields)
- Remove fabricated fields (nested space/version objects, comment.body)
- Add missing fields (creatorAccountId, lastModifierAccountId, self,
creationDate, modificationDate, accountType)
- Add extractor functions (extractPageData, extractCommentData, etc.)
following the same pattern as Jira
- Add formatWebhookInput handler for Confluence in utils.server.ts
so payloads are properly destructured before reaching workflows
- Make event field matching resilient (check both event and webhookEvent)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The generic webhook (confluence_webhook) was falling through to
extractPageData, which only returns the page field. For a catch-all
trigger that accepts all event types, preserve all entity fields
(page, comment, blog, attachment, space, label, content).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vent field
Confluence Cloud webhooks don't include an event/webhookEvent field in the
body (unlike Jira). Replaced broken event string matching with structural
payload filtering that checks which entity key is present.
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

Comment threadapps/sim/lib/webhooks/processor.ts Outdated
…ure verification
These providers define their secret subBlock with id: 'webhookSecret' but the
processor was reading providerConfig.secret which is always undefined, silently
skipping signature verification even when a secret is configured.
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

24 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/triggers/confluence/utils.ts
…ory fallback
Admin REST API webhooks (Settings > Webhooks) include an event field for
action-level filtering (page_created vs page_updated). Connect app webhooks
omit it, so we fall back to entity-category matching.
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment threadapps/sim/lib/webhooks/processor.ts
@waleedlatif1
waleedlatif1 merged commit d824ce5 into stagingFeb 24, 2026
12 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/confluence-triggers branch February 24, 2026 07:36
royceP2 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Mar 3, 2026
…ioai#3318)
* feat(confluence): add webhook triggers for Confluence events
Adds 16 Confluence triggers: page CRUD, comments, blogs, attachments,
spaces, and labels — plus a generic webhook trigger.
* feat(confluence): wire triggers into block and webhook processor
Add trigger subBlocks and triggers config to ConfluenceV2Block so
triggers appear in the UI. Add Confluence signature verification and
event filtering to the webhook processor.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(confluence): align trigger outputs with actual webhook payloads
- Rewrite output builders to match real Confluence webhook payload
structure (flat spaceKey, numeric version, actual API fields)
- Remove fabricated fields (nested space/version objects, comment.body)
- Add missing fields (creatorAccountId, lastModifierAccountId, self,
creationDate, modificationDate, accountType)
- Add extractor functions (extractPageData, extractCommentData, etc.)
following the same pattern as Jira
- Add formatWebhookInput handler for Confluence in utils.server.ts
so payloads are properly destructured before reaching workflows
- Make event field matching resilient (check both event and webhookEvent)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(confluence): handle generic webhook in formatWebhookInput
The generic webhook (confluence_webhook) was falling through to
extractPageData, which only returns the page field. For a catch-all
trigger that accepts all event types, preserve all entity fields
(page, comment, blog, attachment, space, label, content).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(confluence): use payload-based filtering instead of nonexistent event field
Confluence Cloud webhooks don't include an event/webhookEvent field in the
body (unlike Jira). Replaced broken event string matching with structural
payload filtering that checks which entity key is present.
* lint
* fix(confluence): read webhookSecret instead of secret in signature verification
* fix(webhooks): read webhookSecret for jira, linear, and github signature verification
These providers define their secret subBlock with id: 'webhookSecret' but the
processor was reading providerConfig.secret which is always undefined, silently
skipping signature verification even when a secret is configured.
* fix(confluence): use event field for exact matching with entity-category fallback
Admin REST API webhooks (Settings > Webhooks) include an event field for
action-level filtering (page_created vs page_updated). Connect app webhooks
omit it, so we fall back to entity-category matching.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for freeto 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

@waleedlatif1