Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Need to pass raw payload through for integration triggers + generic webhook

Type of Change

  • Bug fix

Testing

Tested with @aadamgough

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 Nov 4, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 4, 2025 3:52am

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.

Greptile Overview

Greptile Summary

This PR fixes a bug where integration triggers and generic webhooks were not properly passing through the raw payload data.

Key Changes:

  • Added new StartBlockPath.EXTERNAL_TRIGGER enum value for webhook/schedule triggers
  • Created buildIntegrationTriggerOutput() function that preserves raw workflowInput payload by spreading it first as the base, then merging finalInput on top
  • Enhanced classifyStartBlockType() to accept optional category and triggerModeEnabled parameters, routing webhooks, schedules, and blocks with category='triggers' or triggerMode=true to the new EXTERNAL_TRIGGER path
  • Updated buildResolutionFromBlock() to extract and pass category/triggerMode metadata to the classifier

Impact:
The fix ensures that webhook payloads retain all their original data (like provider-specific fields) while still processing the structured input, which is critical for integration triggers to work correctly.

Confidence Score: 4/5

  • This PR is safe to merge with one minor logic issue that should be reviewed
  • The changes correctly implement the payload pass-through for integration triggers. However, there's a logic issue in buildIntegrationTriggerOutput at line 375-377 where non-object finalInput values could be discarded if workflowInput already contains an input property. The conditional check should be removed to ensure finalInput always overwrites the input field.
  • apps/sim/executor/utils/start-block.ts (line 375-377) - review the conditional logic

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/executor/utils/start-block.ts 5/5 Added buildIntegrationTriggerOutput to preserve raw webhook payload data for integration triggers and generic webhooks. Updated classifyStartBlockType call to pass category and triggerMode context.
apps/sim/lib/workflows/triggers.ts 5/5 Added EXTERNAL_TRIGGER path and enhanced classifyStartBlockType to support webhook/schedule triggers and blocks with category='triggers' or triggerMode=true.

Sequence Diagram

sequenceDiagram
    participant WH as Webhook Request
    participant BS as buildStartBlockOutput
    participant CSB as classifyStartBlockType
    participant BIT as buildIntegrationTriggerOutput
    participant EX as Executor

    WH->>BS: workflowInput (raw payload)
    BS->>CSB: type, category, triggerMode
    
    alt webhook/schedule OR category='triggers' OR triggerMode=true
        CSB-->>BS: EXTERNAL_TRIGGER
        BS->>BIT: finalInput, workflowInput
        Note over BIT: Spread workflowInput as base
        Note over BIT: Merge finalInput on top
        Note over BIT: Set base.input to finalInput
        BIT-->>BS: NormalizedBlockOutput
    else other trigger types
        CSB-->>BS: Other paths
        Note over BS: Use appropriate builder
    end
    
    BS->>EX: Output with raw payload preserved
Loading

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 changed the title fix(external-triggers): was not passing payload through fix(external-triggers): not passing payload through + incorrect resolver logic Nov 4, 2025
@icecrasher321 icecrasher321 changed the title fix(external-triggers): not passing payload through + incorrect resolver logic fix(external-triggers): not passing payload through + incorrect server-side resolver logic Nov 4, 2025
@icecrasher321 icecrasher321 merged commit 0363f8a into staging Nov 4, 2025
9 checks passed
waleedlatif1 pushed a commit that referenced this pull request Nov 4, 2025
…r-side resolver logic (#1801)

* fix integration triggers

* ignore text readonly subblocks

* fix

* fix to ignore readOnly vals

* fix var references

* simplify

* cleanup code
@waleedlatif1 waleedlatif1 deleted the fix/integration-trigger-parsing branch November 6, 2025 01:25
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
…r-side resolver logic (#1801)

* fix integration triggers

* ignore text readonly subblocks

* fix

* fix to ignore readOnly vals

* fix var references

* simplify

* cleanup code
@waleedlatif1 waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
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