file/upload
Upload a file to your Slack workspace and optionally share it immediately to one or more channels. Accepts any file type up to 1 GB as base64-encoded content.
When to Use
- Attach a generated PDF report to a
#reportschannel at the end of a scheduled workflow run. - Upload a CSV export of processed data to an analyst channel for immediate review.
- Share an error log file to
#engineeringautomatically during an incident response workflow. - Distribute compiled documentation to a team channel after a build pipeline completes.
- Upload an audit report to a compliance channel as part of a regulatory workflow.
Note: Files shared to a channel appear in that channel's Files tab and are searchable by members. The
channelId field is optional — omit it to upload the file to the workspace without sharing it immediately. You can share it later using a message with the file ID.Configuration
Connection
| Field | Required | Description |
|---|---|---|
botToken | Required | Slack Bot Token starting with xoxb-. Must have the files:write OAuth scope. Obtained from your Slack App configuration under OAuth & Permissions. |
Operation Fields
| Field | Required | Description |
|---|---|---|
fileName | Required | The name to assign to the uploaded file, including extension (e.g. monthly-report.pdf). Shown in the Slack UI. |
fileContentBase64 | Required | The full binary content of the file encoded as a Base64 string. Binary files (PDFs, images, archives) must be encoded before passing to this field. Maximum size is 1 GB. |
channelId | Optional | Slack channel ID (e.g. C08ABCDEFGH) to share the file immediately after upload. Omit to upload without sharing. |
title | Optional | A human-readable title displayed above the file in Slack. Defaults to fileName if omitted. |
Sample Configuration
{
"operation": "file/upload",
"connection": {
"botToken": "{{ $credentials.slackBot.token }}"
},
"fileName": "monthly-sales-report.pdf",
"fileContentBase64": "{{ $output.generateReport.pdfBase64 }}",
"channelId": "C08REPORTS1",
"title": "Monthly Sales Report — {{ $now | date:'MMMM yyyy' }}"
}
Validation Errors
| Error Code | Cause | Resolution |
|---|---|---|
file_too_large | File content exceeds 1 GB after decoding. | Split the file or compress it before encoding to Base64. |
invalid_channel | The supplied channelId does not exist or is not accessible by the bot. | Verify the channel ID in Slack and ensure the bot has been added to that channel. |
not_in_channel | Bot is not a member of the specified channel. | Invite the bot to the channel with /invite @YourBot in Slack. |
invalid_auth | Bot token is invalid, expired, or revoked. | Regenerate the bot token in your Slack App settings and update the credential. |
missing_scope | Bot token lacks the files:write OAuth scope. | Add files:write under OAuth & Permissions in your Slack App and reinstall the app. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
fileId | string | Slack-assigned file identifier (e.g. F08ABCDEFGH). Use this to reference the file in subsequent nodes. |
fileName | string | The file name as stored in Slack, matching the input fileName. |
channelId | string | Channel ID the file was shared to. Empty string if no channel was specified. |
status | string | "success" on successful upload. |
errorCode | string | Empty on success. Contains the Slack API error code on failure. |
payload | object | Raw Slack API response object for advanced inspection. |
Error Port
Activated when the Slack API returns an error or the file content is invalid. The errorCode field in the output will contain the specific Slack error string.
Sample Output
{
"fileId": "F08XYZ12345",
"fileName": "monthly-sales-report.pdf",
"channelId": "C08REPORTS1",
"status": "success",
"errorCode": "",
"payload": {
"ok": true,
"file": {
"id": "F08XYZ12345",
"name": "monthly-sales-report.pdf",
"title": "Monthly Sales Report — May 2026",
"mimetype": "application/pdf",
"size": 204800,
"url_private": "https://files.slack.com/files-pri/T01ABC/F08XYZ12345/monthly-sales-report.pdf",
"permalink": "https://yourworkspace.slack.com/files/UBOT/F08XYZ12345/monthly-sales-report.pdf"
}
}
}
Expression Reference
| Expression | Result |
|---|---|
{{ $output.uploadFile.fileId }} | The Slack file ID, usable in subsequent message nodes to reference the uploaded file. |
{{ $output.uploadFile.fileName }} | The stored file name, useful for confirmation messages. |
{{ $output.uploadFile.channelId }} | Channel the file was shared to; empty if uploaded without sharing. |
{{ $output.uploadFile.status }} | Upload status string — "success" or error description. |
{{ $output.uploadFile.payload.file.permalink }} | Public permalink URL to the file in Slack. |
Node Policies & GuardRails
| Policy Area | Recommendation |
|---|---|
| File Size | Maximum file size is 1 GB per upload. Files approaching this limit should be compressed or split to reduce transfer time and API timeout risk. |
| Sensitive Content | Store files containing PII, credentials, or financial data only in private channels. Never upload unencrypted secrets files to public channels. |
| Base64 Encoding | All binary files (PDFs, images, archives, executables) must be Base64-encoded before passing to fileContentBase64. Plain text files may be passed as UTF-8 Base64. |
| Free Workspace Retention | Files on free Slack workspaces older than 90 days may be deleted automatically. Archive important files to external storage before this threshold. |
| Token Scope | Use a dedicated bot token with only files:write scope where possible. Avoid using admin tokens for routine file uploads. |
| Channel Membership | Ensure the bot has been invited to the target channel before the workflow runs. Automate bot invitation as part of channel provisioning workflows. |
Examples
Upload a PDF Report to a Reports Channel
At the end of a monthly reporting workflow, generate a PDF summary and deliver it directly to the #finance-reports channel.
{
"operation": "file/upload",
"fileName": "finance-summary-may-2026.pdf",
"fileContentBase64": "{{ $output.buildReport.pdfBase64 }}",
"channelId": "C08FINANCE1",
"title": "Finance Summary — May 2026"
}
Upload Without Sharing (Stage for Later Use)
Upload a file to the workspace without sharing it to any channel. Retrieve the fileId and attach it to a targeted DM in a later node.
{
"operation": "file/upload",
"fileName": "incident-log-2026-05-26.txt",
"fileContentBase64": "{{ $output.collectLogs.contentBase64 }}",
"title": "Incident Log — 2026-05-26"
}
Upload Audit CSV to Compliance Channel
After completing a nightly data audit, post the results CSV to #compliance for review.
{
"operation": "file/upload",
"fileName": "audit-results-{{ $now | date:'yyyy-MM-dd' }}.csv",
"fileContentBase64": "{{ $output.runAudit.csvBase64 }}",
"channelId": "C08COMPLIAN",
"title": "Nightly Audit Results — {{ $now | date:'yyyy-MM-dd' }}"
}