-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(slack): add file attachment support to slack webhook trigger #3151
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. |
Greptile OverviewGreptile SummaryAdded file attachment support to Slack webhook trigger, matching the established pattern from Gmail trigger. Slack events now extract Key changes:
Issues found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Slack as Slack API
participant Webhook as Webhook Handler
participant Utils as formatWebhookInput
participant Download as downloadSlackFiles
participant Security as validateUrlWithDNS
participant Fetch as secureFetchWithPinnedIP
participant Processor as processTriggerFileOutputs
participant Attachment as WebhookAttachmentProcessor
participant Storage as uploadFileFromRawData
participant Workflow as Workflow Execution
Slack->>Webhook: POST /webhook (event with files)
Webhook->>Utils: formatWebhookInput(webhook, workflow, body)
alt Has files && includeFiles && botToken
Utils->>Download: downloadSlackFiles(rawFiles, botToken)
loop For each file (max 10)
Download->>Download: Validate file.url_private host
Download->>Download: Check file size <= 50MB
Download->>Security: validateUrlWithDNS(url_private)
Security-->>Download: resolvedIP
Download->>Fetch: secureFetchWithPinnedIP(url, resolvedIP, botToken)
Fetch-->>Download: file arrayBuffer
Download->>Download: Verify downloaded size
Download->>Download: Convert to base64 string
end
Download-->>Utils: files array [{name, data: base64, mimeType, size}]
end
Utils-->>Webhook: {event: {files, hasFiles, ...}}
Webhook->>Processor: processTriggerFileOutputs(input, outputSchema)
Processor->>Processor: Detect outputs.event.properties.files (type: file[])
Processor->>Attachment: processAttachments(files)
loop For each file
Attachment->>Storage: uploadFileFromRawData({name, data, mimeType})
Storage->>Storage: Convert base64 to Buffer
Storage->>Storage: Upload to execution storage
Storage-->>Attachment: UserFile
end
Attachment-->>Processor: UserFile[]
Processor-->>Webhook: Processed trigger input
Webhook->>Workflow: Execute with file attachments as UserFile[]
|
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.
2 files reviewed, 1 comment
6fe1d1c to
bce7d5a
Compare
|
@greptile |
|
@cursor review |
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.
3 files reviewed, 2 comments
|
@cursor review |
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.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
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.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
* feat(skills): added skills to agent block * improvement(skills): audit fixes, docs, icon, and UX polish * fix(skills): consolidate redundant permission checks in POST and DELETE * more friendly error for duplicate skills in the same workspace * fix(executor): loop sentinel-end wrongly queued (#3148) * fix(executor): loop sentinel-end wrongly queued * fix nested subflow error highlighting * fix(linear): align tool outputs, queries, and pagination with API (#3150) * fix(linear): align tool outputs, queries, and pagination with API * fix(linear): coerce first param to number, remove duplicate conditions, add null guard * fix(resolver): response format and evaluator metrics in deactivated branch (#3152) * fix(resolver): response format in deactivated branch * add evaluator metrics too * add child workflow id to the workflow block outputs * cleanup typing * feat(slack): add file attachment support to slack webhook trigger (#3151) * feat(slack): add file attachment support to slack webhook trigger * additional file handling * lint * ack comment * fix(skills): hide skill selection when disabled, remove dead code --------- Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Summary
event.filesmetadata and optionally download file contentbotTokenandincludeFilesfields to trigger config for authenticated file downloadsWebhookAttachmentProcessorpipeline →UserFile[]objects available to downstream blocksType of Change
Testing
Tested manually
Checklist