-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(external-triggers): not passing payload through + incorrect server-side resolver logic #1801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this 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_TRIGGERenum value for webhook/schedule triggers - Created
buildIntegrationTriggerOutput()function that preserves rawworkflowInputpayload by spreading it first as the base, then mergingfinalInputon top - Enhanced
classifyStartBlockType()to accept optionalcategoryandtriggerModeEnabledparameters, routing webhooks, schedules, and blocks withcategory='triggers'ortriggerMode=trueto the newEXTERNAL_TRIGGERpath - 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
buildIntegrationTriggerOutputat line 375-377 where non-objectfinalInputvalues could be discarded ifworkflowInputalready contains aninputproperty. The conditional check should be removed to ensurefinalInputalways 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
2 files reviewed, 1 comment
…r-side resolver logic (#1801) * fix integration triggers * ignore text readonly subblocks * fix * fix to ignore readOnly vals * fix var references * simplify * cleanup code
…r-side resolver logic (#1801) * fix integration triggers * ignore text readonly subblocks * fix * fix to ignore readOnly vals * fix var references * simplify * cleanup code
Summary
Need to pass raw payload through for integration triggers + generic webhook
Type of Change
Testing
Tested with @aadamgough
Checklist