Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • fix collection & site dropdown in webflow triggers

Type of Change

  • Bug fix

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
Copy link

vercel bot commented Jan 16, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 16, 2026 4:10pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

This PR fixes Webflow trigger configuration by replacing manual text inputs with dynamic dropdowns for site and collection selection. The changes improve UX by fetching and displaying available sites and collections from the user's Webflow account.

Key changes:

  • Added fetchOptions and fetchOptionById functions to all Webflow collection triggers to dynamically populate site and collection dropdowns
  • Changed form submission trigger from formId (which Webflow API doesn't support in filters) to formName filter
  • Moved collection filtering logic from webhook creation to webhook processing, since Webflow API doesn't support resource filters for collection triggers
  • Added forms:read OAuth scope for form submission functionality
  • Separated webhook payload formatting for form submissions vs collection items to handle different field structures
  • Added conditions to form_submission trigger fields to ensure they only appear when that trigger type is selected

Important architectural change:
Collection filtering now happens at the processor level (after webhook fires) rather than at webhook creation, because Webflow API only supports the filter parameter for form_submission triggers, not for collection item triggers.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured, fix previously identified function signature issues, and follow the established patterns in the codebase. The architectural decision to move collection filtering to the processor layer is correct based on Webflow API limitations. All changes maintain backward compatibility and improve user experience.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/webhooks/provider-subscriptions.ts Changed from formId to formName filter for form submission webhooks, removed collection filter from webhook creation (moved to processor)
apps/sim/lib/webhooks/utils.server.ts Separated webhook formatting logic for form submissions vs collection items, properly handling Webflow's _cid and _id fields
apps/sim/triggers/webflow/collection_item_changed.ts Added dynamic site and collection dropdowns with fetchOptions and fetchOptionById functions
apps/sim/triggers/webflow/collection_item_created.ts Added dynamic site and collection dropdowns with fetchOptions and fetchOptionById functions, added Form Submission to trigger type options
apps/sim/triggers/webflow/collection_item_deleted.ts Added dynamic site and collection dropdowns with fetchOptions and fetchOptionById functions
apps/sim/triggers/webflow/form_submission.ts Changed from formId to formName, added dynamic site dropdown, added forms:read scope, added conditions to all fields

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as Trigger UI
    participant API as Webflow API
    participant Webhook as Webhook Handler
    participant Processor as Webhook Processor

    User->>UI: Select Webflow credential
    UI->>API: POST /api/tools/webflow/sites
    API-->>UI: Return sites list
    User->>UI: Select site from dropdown
    UI->>API: POST /api/tools/webflow/collections
    API-->>UI: Return collections list
    User->>UI: Select collection (optional)
    User->>UI: Save trigger
    UI->>Webhook: Create webhook subscription
    Webhook->>API: POST /v2/sites/{siteId}/webhooks
    Note over Webhook,API: Filter by formName for form_submission<br/>No filter for collection triggers
    API-->>Webhook: Webhook created
    
    Note over Processor: When webhook fires
    API->>Processor: POST webhook event
    Processor->>Processor: Check if collectionId matches<br/>(for collection triggers)
    alt Collection matches or no filter
        Processor->>Processor: Format webhook input
        Processor->>Processor: Trigger workflow
    else Collection doesn't match
        Processor->>Processor: Skip event
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 583f5c4 into staging Jan 16, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/webflow branch January 16, 2026 16:22
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.

2 participants