Quick overview
This workflow runs every five minutes to fetch new Mastodon bookmarks and save them to Wallabag, tracking the last processed bookmark ID in an n8n Data Table and checking Wallabag first to prevent duplicate saved URLs.
How it works
- Runs every 5 minutes on a schedule.
- Reads the last processed Mastodon bookmark ID (min_id) from an n8n Data Table and falls back to a default value on first run.
- Calls the Mastodon API (/api/v1/bookmarks) with min_id to fetch only newer bookmarks and stops if none are returned.
- Extracts pagination values (including the newest min_id) from the Mastodon Link response header and stores the updated min_id back to the Data Table.
- Processes each bookmarked post individually and decides whether to use the link preview card URL or the first non-mention/non-hashtag link in the post (or the post URL if no link is found).
- Checks in Wallabag whether the chosen URL already exists and, if not, creates a new Wallabag entry with metadata such as title, author, language, content, origin URL, and published date.
Setup
- Install the community node package
n8n-nodes-wallabag in your n8n instance.
- Create a Mastodon access token with the
read:bookmarks scope and add it as an HTTP Bearer Auth credential used by the Mastodon HTTP request.
- Replace
YOUR_MASTODON_INSTANCE in the Mastodon bookmarks request URL with your server domain.
- Create and select a Wallabag API credential for the Wallabag “exists” and “create” operations.
- Create an n8n Data Table named
mastodon_sync_state with string columns source and min_id, and select it in the nodes that read and upsert the sync state.
- Optionally adjust the DEFAULT_MIN_ID value (0 starts from your oldest bookmarks) and run the workflow once to initialize state before activating it.
Requirements
- ⚠️ Requires the community node n8n-nodes-wallabag and n8n with Data Tables.