Resources

Kelly O'Briant - Event Automation with Posit Connect

Talk by Kelly O'Briant - Blog post: https://posit.co/blog/ml-posit-connect-airflow/ - API cookbook: https://docs.posit.co/connect/cookbook/content/rendering-content/

Oct 31, 2024
5 min

image: thumbnail.jpg

Transcript#

This transcript was generated automatically and may contain errors.

Hey, I'm Kelly, I'm the product manager for a product here we sell commercially called Posit Connect. So, if you don't use Posit Connect or you never intend to, I'm sorry about this talk. Hopefully you can find my exaggerated use of hand gestures as I speak entertaining enough to stay in the audience.

I want to give you here three exciting announcements we have in relation to event automation in Connect, which is something that I've desperately wanted to talk about for a very long time.

And I'll start by positing that there are times when a document is better than an app. And by that I mean, there are times when you might want to consider creating batch or rendered content and publishing that to Connect instead of interactive applications.

Now, I love Shiny applications. I got into working with RStudio through learning Shiny, and I appreciate it very deeply. And I went through a period of my life when everything I did was a Shiny application. I'm sure lots of you can associate with that feeling.

But as you learn more about the user experience that you might want to give your viewing audience, there are times when something rendered is a little bit more interesting to explore. Because not everybody wants to come to Connect every day to interact with an application. There might be times when sending something to somebody's email is a better way to reach them, to interact with them, or to update them by two changes in the content that you want to deliver.

So think about the user experience that you'd like to deliver when you're thinking about what type of content you want to produce and put on Connect.

I love this feature in Connect because I love robotic process automation. I love automating things. It's very fun. I love scheduling content. And you can't schedule interactive content. You schedule something to run and render and then you can distribute it out to your audience, which is very cool. It can go out. You can create a custom email to send to them. And then everybody who you need to update about something on a set schedule can get that update.

The limits of cron-style scheduling

And that's very nice. But you might have experienced this when you start to move beyond scheduling a single thing and there are suddenly multiple things that have dependencies on each other. You might get in this situation, which is an actual project I did and put on Connect where I have a number of our Markdown documents that need to run. One runs at 3 a.m., one runs at 4 a.m., one runs at 5 a.m. By 6 a.m., if everything has run correctly and ended on time and everything, depending on the previous thing, is all going correctly and ran without an error, you should get an email in your inbox with the updated data.

But if you show somebody this document, they're going to think you're unhinged. So yes, you could create workflows that have different pieces of content running at different times that get chained together in Connect and you can do this with on-base scheduling. That's not actually what you want.

What you want is to be able to push that render-on-demand button programmatically with code. You don't want cron-job-style rendering all the time. Sometimes you want event-style rendering. I want to run this report if and only if my data pipeline succeeds. I don't care what time of day that is. I just want it to run now.

I want to run this report if and only if my data pipeline succeeds. I don't care what time of day that is. I just want it to run now.

Announcements

So this is announcement number one. Maybe you've already discovered this package out in the wild, but there's been a package that my colleagues in solutions engineering have maintained for a long time, and I want to announce that the Connect team is now taking over support and maintenance of the Connect API package. It had an experimental function called variant render, which you could use to do this execute or render-on-demand style execution for content in Connect. We've replaced it with a content render function and also a content restart function, which if you're getting really wild, you can use to restart interactive content as well.

That's something that you're interested in doing on demand. There are different user experience issues with that that you may experience, but it's also an option. So that's announcement number one.

Announcement number two, we've done the same thing for Python. And this is actually a bigger announcement. We've launched a Pythonic interface for developers to work against the public APIs of Posit's professional products. And this is the unofficial logo. Oh, no, announcement three, new cookbook. Announcement four, new blog post.