Upload File

mattermost.upload_file
ActionChat & messagingconnection required

Calls the Mattermost API with the connection's credentials.

Upload a file to a channel and return its file id, which mattermost.create_post attaches to a post through its file_ids field.

Connection

Required
Yes — the node will not save without one
Auth type
Bearer token
Providers
Mattermost
Secret shape
the personal access token, or {"token": "…"}
Config it needs
base_url, team_id
Resolved by
config.connection_id, else node.connection_id

Configuration

5 fields, 3 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
channel_id
The channel id (not its name) — use mattermost.get_channel_by_name to resolve one.
stringYes———
filename
The name to store the file under, e.g. 'report.pdf'.
stringYes——report.pdf
file_content
The file contents — base64 from an upstream file node, or plain text.
stringYes———
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.
stringNo—one of "text", "base64"—
content_type
MIME type sent with the upload; defaults to application/octet-stream.
stringNo———

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "filename": "report.pdf"
}

Output

One shape.

result

FieldTypeExample
file_ids
The uploaded file ids, ready for create_post's file_ids.
array—
file_infos
The FileInfo objects Mattermost stored.
array—
count
How many files were stored.
number—
{
  "count": 0,
  "file_ids": [],
  "file_infos": []
}

Notes

  • An upload is only attached once a post references its id; upload first, then pass file_ids to mattermost.create_post.

See Upload File run in a workflow.

In a technical demo we add the Mattermost connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.