Package Exports
- n8n-nodes-the-mastodon
- n8n-nodes-the-mastodon/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n8n-nodes-the-mastodon) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
n8n Community Node: Mastodon
A community maintained n8n node pack for interacting with the Mastodon API. This package provides full CRUD operations across Mastodon resources, including statuses, accounts, timelines, media, polls, bookmarks, lists, and more—all seamlessly integrated into your n8n workflows.
Table of Contents
- Features
- Prerequisites
- Installation
- Configuration & Credentials
- Usage Examples
- Available Resources & Operations
- Testing
- Development & Contributing
- License
- References
Features
- Statuses: Create, delete, edit, search, favourite, boost (reblog), bookmark, and manage scheduled statuses.
- Accounts: Follow, unfollow, block, mute, view profile, and manage relationships.
- Timelines: Retrieve public, home, hashtag, list, and link timelines with advanced query options.
- Media: Upload and manage media attachments.
- Polls: Fetch poll data and cast votes.
- Bookmarks: Add and remove bookmarks from statuses.
- Lists: Create, update, delete lists and manage list membership.
- Notifications: Fetch and dismiss notifications.
- Administration: Admin level endpoints for reports, retention metrics, cohorts, and more.
- Customizable: Leverage query parameters and additional fields for fine grained control.
Prerequisites
Installation
# From your n8n project root:
npm install n8n-nodes-the-mastodonThe node will automatically be detected by n8n after installation. Restart your n8n instance if it is running.
Configuration & Credentials
Before using the Mastodon node, you must configure OAuth2 credentials for your target Mastodon instance:
In your Mastodon instance, navigate to Settings > Development and create a new application.
- Name: e.g.,
n8n - Redirect URI:
http://localhost:5678/rest/oauth2-credential/callback - Scopes: Select
read,write, andpushas needed. - Note down Client ID and Client Secret.
- Name: e.g.,
In your n8n UI:
- Go to Credentials > New > Mastodon OAuth2 API.
- Fill in:
- Instance URL:
https://mastodon.social(or your custom instance) - Client ID: from step 1
- Client Secret: from step 1
- Scope:
read write push
- Instance URL:
- Save and Connect. Authorize when prompted.
Note about deprecated scopes and server compatibility
Some Mastodon instances have deprecated or removed scopes such as follow (and may not accept push in some configurations). If you see an error like:
The requested scope is invalid, unknown, or malformed.It usually means the authorization URL requested scopes the server doesn't support. If that happens you can:
- Edit the Scope value in the credential to only request
read writebefore initiating the Connect flow. - Or, after the Connect URL opens, remove unsupported scopes from the
scopequery param (e.g. changeread write follow push→read write) and continue.
The node will try to prefer the currently granted scopes when available to avoid requesting deprecated/unsupported scopes automatically.

Usage Examples
Post a Status
- Add a Mastodon node.
- Resource: Status, Operation: Create.
- Set Status text, and optionally add attachments or additional parameters.
- name: Post Status
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
parameters:
resource: status
operation: create
status: 'Hello from n8n and Mastodon!'
additionalFields:
visibility: 'public'Fetch Public Timeline
- Resource: Timeline, Operation: Public.
- Use Additional Fields to filter
local,remote,only_media, or paging parameters.
- name: Get Public Timeline
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
parameters:
resource: timeline
operation: public
additionalFields:
limit: 20
local: trueManage Lists
- Create List:
- Resource: Lists, Operation: createList; set
titleand optionalreplies_policy.
- Resource: Lists, Operation: createList; set
- Add Account:
- Resource: Lists, Operation: addAccountsToList; set
listIdandaccountIds.
- Resource: Lists, Operation: addAccountsToList; set
- name: Create and Update List
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
parameters:
resource: lists
operation: createList
title: 'My Favorite Authors'
- name: Add Accounts
type: n8n-nodes-community/n8n-nodes-the-mastodon:Mastodon
parameters:
resource: lists
operation: addAccountsToList
listId: '12345'
accountIds:
- '42'
- '99'Available Resources & Operations
| Resource | Operations |
|---|---|
| Status | create, delete, edit, search, favourite, unfavourite, boost, unboost, bookmark, removeBookmark, view, viewEditHistory, viewSource |
| Account | follow, unfollow, block, mute, unmute, verifyCredentials, viewProfile, getFollowers, getFollowing, searchAccounts |
| Timeline | public, hashtag, home, list, link |
| Bookmarks | getBookmarks, addBookmark, removeBookmark |
| Favourites | favourite, unfavourite |
| Lists | getLists, getList, createList, updateList, deleteList, getAccountsInList, addAccountsToList, removeAccountsFromList |
| Media | upload, update, delete, get (and more) |
| Polls | getPoll, votePoll |
| Notifications | getAll, dismiss |
| Reports | listReports, create, resolveReport |
| Retention | viewStatistics |
| Markers | get, save |
| ... | (see full properties in code) |
For a full list of fields and parameter descriptions, refer to the code under nodes/Mastodon/*.
Testing
Automated tests are provided using Jest.
# Install dev dependencies
npm install
# Run tests
npm testTest files are located in the __tests__ directory, covering each resource and operation.
Development & Contributing
Contributions are welcome! Please abide by our Code of Conduct.
- Fork the repository & clone locally.
- Create a feature branch:
git checkout -b feature-name. - Install dependencies:
npm install. - Build & lint:
npm run build && npm run lint. - Run tests:
npm test. - Commit & push your changes, then open a Pull Request.
Code style: ESLint and Prettier are configured. Run:
npm run lint
npm run formatLicense
This project is licensed under the MIT License. See LICENSE.md for details.
References
- Mastodon API Docs: https://docs.joinmastodon.org/api/
- n8n Community Nodes Docs: https://docs.n8n.io/integrations/community-nodes/
- OAuth2 Setup Guide: https://docs.joinmastodon.org/client/token/