Upload File
rocketchat.upload_file
ActionChat & messagingconnection required
Calls the Rocket.Chat API with the connection's credentials.
Attach a file to a room. Rocket.Chat uploads and sends in two steps, so this reports the file id from the upload and a 'confirmed' flag saying whether it was actually posted; an unconfirmed upload is discarded after 24 hours.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Rocket.Chat
- Secret shape
- the personal access token, or {"token": "…", "user_id": "…"}
- Config it needs
- base_url, user_id
- Resolved by
- config.connection_id, else node.connection_id
Configuration
9 fields, 3 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
room_id The room id (not its name) — use rocketchat.get_channel_info to resolve one. | string | Yes | — | — | — |
filename The name the file is stored and shown under. | string | Yes | — | — | report.pdf |
file_content The file itself — base64 when content_encoding is 'base64', otherwise text. Wire an upstream file node's file_content straight in. | string | Yes | — | — | — |
content_encoding Set to 'base64' when body is a base64 blob (e.g. from a download_archive node). Defaults to the upstream file's encoding, else text. | string | No | — | one of "text", "base64" | — |
content_type The file's MIME type, e.g. application/pdf. | string | No | application/octet-stream | — | — |
msg A message to post alongside the file. | string | No | — | — | — |
description A caption stored on the file itself. | string | No | — | — | — |
tmid Post as a reply inside this thread; leave blank to start a new message. | string | No | — | — | — |
confirm Send the file to the room after uploading it. Set false to upload only and post it later; Rocket.Chat discards an unsent upload after 24 hours. | boolean | No | true | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"confirm": true,
"content_type": "application/octet-stream",
"filename": "report.pdf"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
file_id The uploaded file's id. | string | — |
file_url The path Rocket.Chat serves the file from. | string | — |
room_id The room the file was uploaded to. | string | — |
filename The name the file was stored under. | string | — |
confirmed True when the file was sent to the room; false when only uploaded. | boolean | — |
message The message that carries the file, or null when confirm was false. | object | — |
note Empty once the file was sent; when confirm was false, what still has to happen and when the upload expires. | string | — |
{
"confirmed": false,
"file_id": "",
"file_url": "",
"filename": "",
"message": {},
"note": "",
"room_id": ""
}Notes
- The two calls are POST /rooms.media/{rid} then POST /rooms.mediaConfirm/{rid}/{fileId}.
- Rich message cards are the 'attachments' array on post_message; this node is for real files.
See Upload File run in a workflow.
In a technical demo we add the Rocket.Chat connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.