Replacing n8n with a local script for Typefully drafts

I previously wrote about how I publish blog posts and notes so fast, where I mentioned using simple terminal scripts and background automations to remove friction. One part of that workflow was an n8n automation connecting RSS feeds to Typefully to automatically draft new posts to social media.

While n8n worked, it relied on polling RSS feeds after Netlify finished deploying, and didn't give me fine-grained control over which social platforms a specific post should go to.

So I replaced the n8n setup with a small Node.js script scripts/sync-typefully.js built directly into my existing pnpm blog:push and pnpm raw:push workflow commands.

Here's how it works:

  1. Whenever I publish a post, git commits and pushes the code to GitHub first.
  2. The script polls the live post URL on deepakness.com until Netlify returns a 200 OK status. This ensures no broken 404 links on social media.
  3. Mastodon and Bluesky are enabled by default so I don't have to specify them.
  4. If I want to send the draft to extra channels like Threads, X, or LinkedIn, I can pass a flag like pnpm raw:push --platforms=threads,x.
  5. Once live, it calls the Typefully API to schedule the draft for the next free slot.

And the output in the terminal is shown like this:

[Typefully Sync] Found target file: content/raw/typefully-local-sync/index.md
[Typefully Sync] Configured platforms: mastodon, bluesky
[Typefully Sync] Waiting for Netlify deploy... Polling https://deepakness.com/raw/typefully-local-sync/
[Typefully Sync] ✓ Live page confirmed! (HTTP 200 OK after 42s)
[Typefully Sync] Sending draft to Typefully API...
[Typefully Sync] 🎉 Draft successfully scheduled in Typefully!
  Draft ID: 10183778
  Draft Title: "Replacing n8n with a local script for Typefully drafts"
  Platforms: mastodon, bluesky
  Schedule: next-free-slot

Now there are no external n8n workflows to maintain, zero broken link issues, and full control over social distribution directly from the terminal.

Absolutely love it.

Webmentions

What’s this?