Rock U - Workflows - Text To Workflow Performance
Transcribed Video Content
Okay. So let's talk about some performance tips for text to workflow. Now, when we're talking about text to workflow, we have to be very careful about performance because our our members and attendees are actually experiencing these these text to workflows in real time. And the first thing you have to ask yourself is what kind of text to workflow are you going to use? Is it the kind of text to workflow that's maybe this lone pigeon, on the wire where it's gonna be one or two people interacting it throughout the day, maybe texting in to sign up for some specific content or specific group.
But you're really gonna get maybe a couple hundred of these over the day. Or is it the type of text to workflow where the pastor is gonna stand on the stage and say, hey, everybody, pull out your phone right now and text this to this number. That's a very different type of experience. And so there's gonna be lots of birds all trying to get access to these text to workflows at once. And it's this use case here that is really important that we tune and and create our text to workflows in a very performant way.
So let's look at an analogy before we get into some of the technology. Let's just say that I'm gonna open up a coffee bar and I'm gonna put the put it in this regional neighborhood here. Now, as the business owner, I can really kind of keep this a nice casual, a nice personalized experience. I won't be making the coffee of course until the person comes in. I can I can, have the time to customize the coffee and the drink especially for them?
And I'm not going to make it ahead of time. I'm just going to wait till they till they get there and make each drink for each person and keep it really nice and customized. Now, that's great, and that works. But if I'm gonna do the same thing, sell coffee at the stadium for the big game, that's gonna drastically change how I create my service and how I, deliver, the experience to the customer. At the the stadium, I don't have time to wait.
I've got to make sure that I'm prepared ahead of time, that I'm doing the minimal amount of of work, per customer, and that I'm able to engage a lot of people all at once. And and the same thing is true for text workflow and through technology. So let's take a look about what that means. Now when we talk about delivering applications to people, there's a few things that we need to think about. Okay?
So first of all, computing is not limitless. Computers have a finite amount of resources. And so how we tune our application is gonna be dependent on a couple factors. The first factor is how many people are going to be interacting with the service. So I mean, this makes sense.
Right? If we have 10,000 people visiting our website, we're probably going to need a bigger server than if there's only 10. The same thing in our analogy with the coffee bar. What really drove how we're going to tailor our service is really how many people are gonna be interacting with it at any given time. Okay.
So that's one facet. The other facet is how long does it take for us to service each one of these people. Okay. So back to the coffee bar example. Is it gonna take us ten seconds per person or is it gonna take ten minutes per person?
That's going to drastically change how many people we can serve if we're making a drink that takes ten minutes versus a drink that takes only ten seconds. And so taking that back into the technology example is is our workflow gonna take ten minutes to run or maybe even in a better case in technology, is it gonna take ten seconds to run or is it gonna take ten milliseconds to run? And the the difference is is gonna drastically change how many people we can service. If our workflow is very complex and takes ten seconds, we're only gonna be able to service maybe 10 people, in a given, , period of time. But if we can get it really down into, , small small, increment ten milliseconds, now we can handle a lot more.
Okay. Now the other aspect to think about is how big is our server? , if we have a very small server, , we can maybe take ten ten people with ten seconds processing time. But if we have a big server, maybe we could do a hundred. So our server scale kind of is dependent upon that too.
Now, as we're trying to make this this solution work, we often can't change how many people are gonna , hitting our our our text to workflow, but we can change a few other things. Right? So we can make sure that maybe our server's bigger. , we could add some more horsepower to our server. Oftentimes, that's that's something that we can do.
So if we're using maybe a cloud experience, we could on the weekend that we know that we're gonna have this large text to workflow, we can increase the size of our server. We could also get more servers. Right? So we could put Rock into a a clustered environment where we have multiple Rock servers all working together. I I would say that this is much more complex, that it can work this way, but there's some things that you need to configure and to, , really get experienced with.
It's not something that you just want to say, well, I'll just get more Rock servers. , that's probably the last thing you want to scale up. But the other thing that we can, affect and and it's probably the easiest thing to do is just really reduce the amount of time that that processing is gonna take. Okay? And that's what we're gonna talk about, for the rest of the time here.
So again, our text to workflow should feel sprinters. We wanna be very fast, very lean. , a sprinter when he's running, he's not carrying a lot of extra weight. , he's really reducing down everything he's taking with him on this trip, , versus a backpacker who is, , laden down with lots of stuff. So we wanna make sure our workflows are really tight a sprinter and, that we're not carrying around a lot of extra weight.
Okay? Now how do we do that? It's it's all through planning. So if you're familiar with the movie The Founder, , these are the guys who invented McDonald's. They spent tons and tons of time just really working through their workflow of how they were gonna make burgers.
We need to do the same thing with our workflows. We need to make sure that we are really kind of managing what's going on in these workflows because again, we're trying to keep them very very fast and very very performant. And we wanna make sure that we're not doing anything that we don't need to do. Okay? So if the person's coming at us with all of these text to workflows and we're trying to, , put back a response, we only wanna do what we have to do in that moment.
Okay? So let's think of it as a as a conveyor belt just this animated GIF. We only want to do, the minimal amount of effort for each one of these text to workflows coming down the line. Okay? We don't have time to do stuff that's not immediately needed in that moment.
So what's an example? I've seen an example where someone said, hey, on this text to workflow, I need to add someone to a group. Okay. Good. Yeah.
We need to do that. Absolutely. But then they had another action that ran that actually went to that group member and then set an attribute of that group member to the person's campus. , we don't need to do that. We can already know the person's campus because person has a campus.
And we can later on, after the text to workflow runs, we can actually look up that campus later on a report or something. So in this case, they added it to the group member just because it was a little easier later that, , that information would be right on the group member. Well, , that's that's okay. But that that actually took another database read and a database write to actually store that. And that takes time.
So again, in this case, I'd say don't do that. You can get that later. When everybody's gone home for the for the evening, you can go back and write a report that would give you this information. So don't do what you don't need to do in the moment. Also, don't persist your workflow unless you absolutely need to.
Okay? So persisting sounds, , oh, well, I'll just hit the save button on the workflow. Well, it's a lot more than that. Okay? So the first time you persist that workflow, you're basically gonna save the workflow, all the workflow attributes.
So say you have five or six or maybe 10 workflow attributes, that's 10 different saves of all those attributes. You also have to save all the activated activities that you did. You also have to save their attributes if there were any. And you have to save all the actions. So whenever you persist that workflow, it sounds , oh, that won't take long.
No, it does. There's a lot of saves. This could mean 50 to 60 database writes every single time you persist it. So if you don't need to save the fact that this , what happened here, , again, if you're trying to save someone to a group, you don't need to persist the workflow. You save them to the group.
that they're in the group and you have that later on to go back to. So I would say when you're using text to workflow and you and you wanna make ones that are gonna scale and be fast, don't persist the workflow unless you absolutely have to. A case of when you might have to is if you need to kind of continue the logic and the flow later on. So maybe you need to wait a day or two and then email them. Again, you could probably put them into a group that would be a little bit faster and then email from the group.
But there might be some logic that you might need to keep in the workflow. That's fine. I'm just saying don't persist it unless you absolutely have to. So what are some persistent alternatives? So , hey, you need to I wanna keep the fact that this happened, , else can I do?
Well, we talked about the group and option. Storing them into a group is actually pretty fast. That's one database right versus, , 10 to 50. You can also write an interaction record. Record.
So there is a workflow action that will save interaction record. And again, that's very fast because it's only saving once. It's only one saving one record versus again, maybe 50. Also keep your text to workflows very small and single use. There's a a tendency to want to write one workflow that might be able to process, , ten, twenty, 30 different keywords.
And those keywords aren't related. They're just, , it's just maybe in in their mind, it's easier just to write one. That's okay. But you're gonna have a ton more attributes that you're gonna have to save, especially if you wanna persist it. It would be much better to create these, very small single use workflows that only have one purpose, one per keyword.
They're a lot faster to run, especially if you need to persist them. So don't create the one man band of workflows to try to process a ton of them. Just do small single use workflows. And whatever you do, do not enable logging on these workflows. If you're trying to process hundreds or thousands of workflows that are that are gonna happen in a very short time, you want to make sure that you disable logging.
Logging is great while you're creating your workflows and you're trying to debug them, but it is time consuming if if left on during you you while you're running them a production. So those are the tips to keep your workflows running very quick, especially in these text to workflow scenarios when you have real people that you're interacting with, especially if you're gonna be asking your senior pastor to get up there and have lots of different people run them. The the other last tip is that I would say is test them. Don't just create this workflow and, , cross your fingers. Get a whole bunch of people to start texting in and making sure that everything is looking good on the on the server as you do that.
And hopefully, over the future, we'll be able to create some some tools that help you kind of performance test them at load. Okay. So there's some ideas and I hope that they help you create the fastest workflows possible.