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:15am

Review with Vercel Agent

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

This PR converts Webflow trigger site and collection inputs from manual text fields to dynamic dropdowns, improving UX by fetching available options from the Webflow API.

Key Changes:

  • Added fetchOptions and fetchOptionById functions to site and collection dropdowns across all Webflow triggers
  • Changed siteId field from short-input to dropdown type
  • Changed collectionId field from short-input to dropdown type
  • Added dependsOn relationships so collections load after a site is selected
  • Updated setup instructions to reflect the new dropdown interface
  • Added logger imports for error tracking

Critical Issue:

  • All fetchOptions functions use incorrect signature (blockId: string) instead of required (blockId: string, subBlockId: string) per type definition in apps/sim/blocks/types.ts:302-305

Confidence Score: 3/5

  • This PR has type signature errors that need fixing before merge
  • The implementation logic appears sound and follows established patterns from Gmail/Outlook triggers, but all fetchOptions functions have incorrect signatures that don't match the SubBlockConfig type definition. This is a type safety issue that should be caught by TypeScript and needs correction.
  • All 4 files need the fetchOptions signature fixed to include the subBlockId parameter

Important Files Changed

Filename Overview
apps/sim/triggers/webflow/collection_item_changed.ts Added dynamic dropdown fetching for sites and collections with incorrect fetchOptions signature (missing subBlockId parameter)
apps/sim/triggers/webflow/collection_item_created.ts Added dynamic dropdown fetching for sites and collections with incorrect fetchOptions signature (missing subBlockId parameter)
apps/sim/triggers/webflow/collection_item_deleted.ts Added dynamic dropdown fetching for sites and collections with incorrect fetchOptions signature (missing subBlockId parameter)
apps/sim/triggers/webflow/form_submission.ts Added dynamic dropdown fetching for sites with incorrect fetchOptions signature (missing subBlockId parameter)

Sequence Diagram

sequenceDiagram
    participant User
    participant Trigger UI
    participant SubBlockStore
    participant API Routes
    participant Webflow API

    User->>Trigger UI: Select Webflow credential
    Trigger UI->>SubBlockStore: Store credential ID
    
    User->>Trigger UI: Open site dropdown
    Trigger UI->>SubBlockStore: getValue(blockId, 'triggerCredentials')
    SubBlockStore-->>Trigger UI: credential ID
    Trigger UI->>API Routes: POST /api/tools/webflow/sites
    API Routes->>Webflow API: GET /v2/sites
    Webflow API-->>API Routes: sites array
    API Routes-->>Trigger UI: formatted sites
    Trigger UI-->>User: Display site options
    
    User->>Trigger UI: Select site
    Trigger UI->>SubBlockStore: Store site ID
    
    User->>Trigger UI: Open collection dropdown
    Trigger UI->>SubBlockStore: getValue(blockId, 'triggerCredentials')
    SubBlockStore-->>Trigger UI: credential ID
    Trigger UI->>SubBlockStore: getValue(blockId, 'siteId')
    SubBlockStore-->>Trigger UI: site ID
    Trigger UI->>API Routes: POST /api/tools/webflow/collections
    API Routes->>Webflow API: GET /v2/sites/{siteId}/collections
    Webflow API-->>API Routes: collections array
    API Routes-->>Trigger UI: formatted collections
    Trigger UI-->>User: Display collection options
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

field: 'selectedTriggerId',
value: 'webflow_collection_item_changed',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition in apps/sim/blocks/types.ts:302-305.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_changed.ts
Line: 45:45

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition in `apps/sim/blocks/types.ts:302-305`.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

field: 'selectedTriggerId',
value: 'webflow_collection_item_changed',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_changed.ts
Line: 111:111

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

field: 'selectedTriggerId',
value: 'webflow_collection_item_created',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_created.ts
Line: 58:58

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

field: 'selectedTriggerId',
value: 'webflow_collection_item_created',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_created.ts
Line: 124:124

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

field: 'selectedTriggerId',
value: 'webflow_collection_item_deleted',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_deleted.ts
Line: 45:45

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

field: 'selectedTriggerId',
value: 'webflow_collection_item_deleted',
},
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/collection_item_deleted.ts
Line: 111:111

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

required: true,
options: [],
mode: 'trigger',
fetchOptions: async (blockId: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: fetchOptions signature is missing the required subBlockId parameter. Should be async (blockId: string, subBlockId: string) to match the SubBlockConfig type definition.

Suggested change
fetchOptions: async (blockId: string) => {
fetchOptions: async (blockId: string, subBlockId: string) => {
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/triggers/webflow/form_submission.ts
Line: 37:37

Comment:
**syntax:** `fetchOptions` signature is missing the required `subBlockId` parameter. Should be `async (blockId: string, subBlockId: string)` to match the `SubBlockConfig` type definition.

```suggestion
      fetchOptions: async (blockId: string, subBlockId: string) => {
```

How can I resolve this? If you propose a fix, please make it concise.

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