Portal Community

file/get

Retrieve metadata for a single file stored in your Slack workspace by its file ID. Returns details such as file name, size, type, uploader identity, and upload timestamp.

When to Use

Configuration

Connection

FieldRequiredDescription
botTokenRequiredSlack Bot Token starting with xoxb-. Must have the files:read OAuth scope to retrieve file metadata.

Operation Fields

FieldRequiredDescription
fileIdRequiredThe Slack file identifier, always starting with F (e.g. F08ABCDEFGH). Typically captured from a previous file/upload node output or from a Slack event payload.

Sample Configuration

{
  "operation": "file/get",
  "connection": {
    "botToken": "{{ $credentials.slackBot.token }}"
  },
  "fileId": "{{ $output.uploadReport.fileId }}"
}

Validation Errors

Error CodeCauseResolution
file_not_foundNo file with the given fileId exists, or the bot does not have visibility of the file.Confirm the file ID is correct and the bot is in at least one channel where the file was shared.
invalid_authThe bot token is invalid or has been revoked.Regenerate the token in your Slack App settings and update the stored credential.
missing_scopeBot token lacks the files:read scope.Add files:read under OAuth & Permissions in your Slack App and reinstall.
file_deletedThe file existed but has been deleted (free workspace age limit or manual deletion).Handle via the error port and log or notify as appropriate.

Output

Success Port

FieldTypeDescription
fileIdstringThe Slack file identifier (echoed from input).
fileNamestringThe name of the file as stored in Slack.
fileSizenumberFile size in bytes.
fileTypestringSlack file type string (e.g. pdf, csv, png).
uploadedBystringUser ID of the workspace member who uploaded the file.
uploadedTimestampnumberUnix timestamp (seconds) when the file was uploaded.
statusstring"success" on successful retrieval.
errorCodestringEmpty on success. Contains the Slack API error code on failure.
payloadobjectFull raw Slack API response for advanced field access.

Error Port

Activated when the file is not found, has been deleted, or the token lacks read permissions. Inspect errorCode to distinguish between not-found and access-denied scenarios.

Sample Output

{
  "fileId": "F08XYZ12345",
  "fileName": "monthly-sales-report.pdf",
  "fileSize": 204800,
  "fileType": "pdf",
  "uploadedBy": "U01UPLOADER",
  "uploadedTimestamp": 1748221200,
  "status": "success",
  "errorCode": "",
  "payload": {
    "ok": true,
    "file": {
      "id": "F08XYZ12345",
      "name": "monthly-sales-report.pdf",
      "mimetype": "application/pdf",
      "size": 204800,
      "user": "U01UPLOADER",
      "created": 1748221200,
      "permalink": "https://yourworkspace.slack.com/files/U01UPLOADER/F08XYZ12345/monthly-sales-report.pdf"
    }
  }
}

Expression Reference

ExpressionResult
{{ $output.getFile.fileId }}Slack file ID for use in downstream nodes.
{{ $output.getFile.fileName }}File name for display in confirmation messages.
{{ $output.getFile.fileSize }}File size in bytes for capacity or validation checks.
{{ $output.getFile.fileType }}File type string for routing to the correct processing pipeline.
{{ $output.getFile.uploadedBy }}User ID of the uploader for attribution or notification.
{{ $output.getFile.uploadedTimestamp | date:'yyyy-MM-dd' }}Formatted upload date for audit records.

Node Policies & GuardRails

Policy AreaRecommendation
Scope MinimizationUse a token with only files:read for read-only metadata operations. Do not reuse upload tokens for read-only flows.
Error HandlingAlways wire the error port. A file_not_found error may indicate a deleted file; log and notify rather than failing the entire workflow.
Free Workspace RetentionFiles on free workspaces may be purged after 90 days. If file_deleted is received for a recent file ID, check workspace plan limits.
Sensitive File AccessBe aware that retrieving file metadata does not check channel-level visibility for all bots. Confirm the bot has been added to the channel where the file was shared.
Permalink UsageThe payload.file.permalink URL requires authentication. Do not share it publicly or embed it in unauthenticated systems.

Examples

Verify File Before Generating a Shareable Reference

Before creating a message that references an uploaded file, confirm it exists and retrieve its display name.

{
  "operation": "file/get",
  "fileId": "{{ $trigger.event.fileId }}"
}

Audit Trail — Capture Uploader and Timestamp

After a file upload event, fetch metadata and write the uploader ID and timestamp to an external audit database.

{
  "operation": "file/get",
  "fileId": "{{ $trigger.slackEvent.file_id }}"
}
// Then in WriteAuditRecord node:
// uploadedBy: {{ $output.getFile.uploadedBy }}
// uploadedAt: {{ $output.getFile.uploadedTimestamp }}

Route by File Type

Fetch file metadata then use a branch node to route PDFs to a compliance archive and CSVs to a data pipeline.

{
  "operation": "file/get",
  "fileId": "{{ $input.fileId }}"
}
// Branch condition: {{ $output.getFile.fileType }} == "pdf"