Microsoft flow

Automatically sharing new posts to Twitter using Microsoft Flow

Automatically sharing new posts to Twitter using Microsoft Flow

When I hosted my blog on WordPress I used a plugin to create a tweet when I published a new post. Which was neat, It meant I didn’t need to do anything, but my posts still got publicised. Hugo is a static site generator and I love it, but you don’t get anything fancy like that.

I had used Microsoft flow (Now PowerAutomate) before, but it didn’t occur to me use it for this until I suggested doing something similar with Instagram to a friend. To demonstrate the flexibility of flows and how easy they are to setup, I recreated the functionality of the WordPress plugin for my Hugo site. It works really well, so I thought i’d share.

How to set it up

The Power Automate Homepage has a template section, you’ll need to log in first. Don’t panic, its free for some flows and this type of flow falls into that category. Once your logged in type twitter into the search bar and press enter or click on the dudey looking magnifying glass

Enter twitter in the search bar

Near the top you should see a template called RSS feed news to Twitter, click on this.

Click on RSS feed news to Twitter template

The flow needs two connections, the first is RSS which you can ignore, the second is your twitter account.

Showing rss task required connections

Click the 3 dots and then add your account details, then click Continue

Click 3 dots, add twitter account and click continue

Now we can see the steps used in the flow including the inputs and fields it’s going to use. Enter the url for your rss feed, the default for Hugo is to add /index.xml to the end of your website url as documented here.

Enter your RSS url

Now we could just click save and our flow would work, but it would be nice to be notified when the tweet is posted, that way we won’t have to log in to check its worked.

Click the +New Step button and click on Notification

Click Net Step and select notification

Click Send me a mobile notification

Click Send me a mobile notification

Under each field there is a small blue square labelled Add dynamic content

Note the add dynamic content button

Click this and pick the fields shown below. You can pick your own, but if you’re not sure, go with what I have picked

untrusted cert

Click Save and then click the back arrow at the top of the section to go to overview page for the flow.

Note the add dynamic content button

This shows you the details of your flow along with the recent run history. The flow you just created won’t have any history, but below is the flow I created for reference.

untrusted cert

Now whenever you publish a post that appears in your RSS field, Power Automate will start the flow and you will get a tweet created. Yeh!

Next steps

This is a tiny example of the power of flows. I highly recommend you have a search through the templates, you’re bound to find something cool that will help you. Also if you’re into home automation, try ifttt. It’s similar to flow, but interacts with technology like Alexa, Phillips Hue lights, Nest and it can even interact with your Dominos pizza account - but I can never get that working :(