Umbraco Automate Workflows

Calculating...

Umbraco Automate

Umbraco Automate is the latest open-source product out of Umbraco HQ. I got to see it at the Umbraco MVP summit last month and immediately started thinking about how I could use it on my own site.

What is Umbraco.Automate?

Straight from the docs:

Umbraco Automate is an event-driven automation engine built into the Umbraco backoffice. Build workflows with triggers and actions, no external platforms required.

You build workflows on a visual canvas, combining triggers (the thing that kicks everything off) with actions (the things that actually happen). No third-party automation tools, no leaving the backoffice.

What I've Built So Far

I've put together a couple of connections. A connection, in Automate terms, is a named, reusable credential set for an external service. Think Slack, an SMTP server, an OAuth provider, that sort of thing. The idea is that your credentials live separately from your automation definitions, so you can safely move workflows between environments.

So far I have OC.Automate.Mastodon and OC.Automate.Bluesky up and running. OC.Automate.LinkedIn is in the pipeline but the OAuth side of things for LinkedIn is taking a bit longer to untangle.

The end goal is simple: publish a blog, it goes out to socials automatically. No copying URLs. No remembering to post. Done.

But that's not really what I want to talk about today. I want to show you the power of the workflows themselves.

The Problem

My first attempt at this had a flaw. Every time I published a blog post, it would push out to all my social channels. Sounds fine, until you spot a spelling mistake or a broken link and hit publish again. Cue every notification firing a second time.

My first instinct was to grab the source code (Automate is open-source, after all) and build a custom trigger I could eventually PR back into the project. That didn't go well. I couldn't get my code to work and, in a moment of honesty, posted on the Umbraco Discord asking for help.

A few people jumped in and pointed me toward a no-code approach instead, which is what I want to show you now.

Big thanks to Mike Chambers, Warren Buckley and Paul Wright for joining the conversation.

The Two Approaches

1 - Push on every publish

flowchart TD A([TRIGGER: Content Published]) --> B B["**Get Content Property**\ngetContentProperty\n25a5801b-6240-4ca6-b44a-4b8133e20a43"] --> C C["**Log Message**\nlogMessage\nc3787444-ac0a-4a92-ac38-91b88dda2772"]

Trigger fires on any Blog publish, grabs the content, and does whatever you've set it up to do. Simple, but it fires on every single publish. Spelling mistake? Surprise, you've just posted again.

2 - Push only on first publish

flowchart TD A([TRIGGER: Content Published]) --> B B["**Get Content Property**\ngetContentProperty\n25a5801b-6240-4ca6-b44a-4b8133e20a43"] --> C C{IF} -->|true| D C -->|false| E D["**Log Message**\nlogMessage\nc3787444-ac0a-4a92-ac38-91b88dda2772"] E["**Log Message**\nlogMessage2\n1fe4d701-5c5d-45d3-a715-3bf5d0f072c0"] --> F F["**Update Content Property**\nupdateContentProperty\n07cc8c80-5981-4175-bd32-7be4faa50958"] --> G G["**Log Message**\nlogMessage3\nf0ee688c-ebe6-4e92-873c-ae4c70ef84ac"]

This one adds an IF condition into the mix. I added a toggle property to the Blog document type called hasBeenPublished.

When the workflow fires, it checks that toggle. If it's already true, the workflow does nothing and logs a message. If it's false, it sets the toggle to true and then posts to socials.

The bonus here is flexibility. If I genuinely want to push something out to socials again, I just flip the toggle back and the workflow does its thing. No code changes, no fiddling around.

Zero code. Works perfectly.

This is only the beginning for me with Umbraco.Automate but I think it shows what the product is capable of, and we haven't even scratched the surface yet. If you want to copy this workflow for your own site, I've made a more detailed video on my YouTube channel.