Actions48
- Account Actions
- Authentication Actions
- Blocks Actions
- Bookmarks Actions
- Favourites Actions
- Featured Tags Actions
- Follow Requests Actions
- Media Actions
- Mutes Actions
- Notifications Actions
- Polls Actions
- Status Actions
- Timeline Actions
Overview
The Mastodon node allows interaction with the Mastodon social network API. Specifically, the "Upload Media" operation under the "Media" resource enables users to upload media files (such as images or videos) to a specified Mastodon instance. This is useful for automating content publishing workflows where media needs to be attached to posts or statuses.
Common scenarios include:
- Automatically uploading images or videos from other sources to Mastodon.
- Integrating media uploads into broader social media automation pipelines.
- Enhancing accessibility by adding descriptions and focus points to media.
Example: Uploading an image stored in binary form within n8n to a Mastodon instance, optionally providing a description and focus coordinates for better presentation.
Properties
| Name | Meaning |
|---|---|
| Mastodon URL | The URL of the Mastodon instance to which the media will be uploaded (e.g., https://mastodon.social). |
| Binary Property | The name of the binary property in the input data that contains the file to be uploaded. |
| Additional Fields | Optional fields including: - Description: Text description of the media for accessibility. - Focus: Coordinates (two floating points between -1.0 and 1.0) indicating the focal point of the media (format: "x,y"). |
Output
The output JSON contains the response from the Mastodon API after uploading the media. This typically includes metadata about the uploaded media such as its ID, URL, type, and any additional information returned by the Mastodon server.
If the node supports binary data output, it would represent the uploaded media or related content, but in this case, the main output is JSON metadata describing the uploaded media.
Dependencies
- Requires an API authentication token credential configured in n8n to authenticate requests to the Mastodon instance.
- Needs access to the Mastodon instance URL provided by the user.
- Input data must contain the binary file data under the specified binary property name.
Troubleshooting
Common issues:
- Incorrect Mastodon instance URL can cause connection failures.
- Missing or incorrect binary property name leads to failure in locating the file to upload.
- Authentication errors if the API token is invalid or missing.
- Invalid format for the "Focus" field (should be two floats between -1.0 and 1.0 separated by a comma).
Error messages:
"The operation "upload" for resource "media" is not implemented!"— indicates a misconfiguration or unsupported operation.- Network or authentication errors usually indicate problems with credentials or instance URL.
- Validation errors on additional fields may occur if values are out of expected ranges.
To resolve these, verify the Mastodon URL, ensure the binary property exists and contains valid file data, and confirm that the API authentication token is correctly set up.