Skip to main content
Photo of DeepakNess DeepakNess

From RSS feed to Bluesky and Mastodon via n8n

Unproofread notes

I am consistently taking notes in the raw section of my blog and wanted to keep posting new posts on Mastodon and Bluesky as URLs. I used n8n to achieve this automation successfully – even though n8n doesn't have an official Mastodon and Bluesky node.

In this post, I will explain how I set this up:

At first, I used the RSS Feed Trigger node in n8n so that it auto-triggers every time a new raw note is published. It gives me the most recent post in the below format, and I can use the data from here to publish on both platforms.

[
  {
    "title": "",
    "link": "",
    "pubDate": "",
    "content": "",
    "contentSnippet": "",
    "id": "",
    "isoDate": ""
  }
]

From RSS feed to Mastodon

I needed the following 3 things for this automation via n8n:

  1. RSS feed URL: it's deepakness.com/feed/raw.xml in my case
  2. Mastodon URL instance: my account is at mastodon.social
  3. Your Mastodon access token: visited [INSTANCE_URL]/settings/applications, created a new application with full write scope, and got the access token

After the previous RSS Feed Trigger node in n8n, I created another HTTP Request node, and entered the following information:

  1. Authentication: None
  2. Request Method: POST
  3. URL:
    https://[INSTANCE_URL]/api/v1/statuses?access_token=[ACCESS_TOKEN]
  4. Ignore SSL Issues (Insecure): OFF
  5. Response Format: JSON
  6. JSON/RAW Parameters: OFF
  7. Options: Nothing
  8. Body Parameters: Nothing
  9. Headers: Nothing
  10. Query Parameters:
    1. Name: status
    2. Value: [POST_CONTENT] from previous nodes

And this simply worked, I didn't have to do anything else at all. If you're interested, you can learn more by going through their documentation.

From RSS feed to Bluesky

First, I needed to create a Bluesky Session and then only I was able to publish. For this, I needed the following things:

  1. App password: Created a new app and got the app password from bsky.app/settings/app-passwords page
  2. Profile identifier: Your profile identifier [username].bsky.social

Node 1: HTTP Request

First, you need to create a HTTP Request node to get the Session ID. Fill in the following info:

  1. Authentication: None
  2. Request Method: POST
  3. URL:
    https://bsky.social/xrpc/com.atproto.server.createSession
  4. Ignore SSL Issues (Insecure): OFF
  5. Response Format: JSON
  6. JSON/RAW Parameters: OFF
  7. Options
  8. Body Parameters:
    1. Name: identifier
    2. Value: deepakness.bsky.social
    3. Name: password
    4. Value: [APP_PASSWORD]
  9. Headers: Nothing
  10. Query Parameters: Nothing

From here, you need to get the accessJwt token in the next node to be able to publish the post.

Node 2: Date & Time

Yes, the date parameter is required in the Bluesky API so you need to add the Date & Time node and get the current time:

Node 3: HTTP Request

Now, I needed another HTTP Request node to be able to actually publish. Below are the options:

  1. Method: POST
  2. URL: https://bsky.social/xrpc/com.atproto.repo.createRecord
  3. Authentication: None
  4. Send Query Parameters: OFF
  5. Send Headers: ON
    1. Specify Headers: Using Fields Below
    2. Header Parameters:
      1. Name: Authorization
      2. Value: Bearer [accessJwt_from_previous_node]
  6. Send Body: ON
    1. Body Content Type: JSON
    2. Specify Body: Using JSON
    3. JSON: see here
    4. Options: Nothing

So far, it's working for me but I might further improve it in the future.

Comment via email