Rock U - Workflows - Components of a Workflow
Transcribed Video Content
So let's talk about the components that make up a workflow. The first thing we're gonna look at is activities. So when a workflow launches, at least one activity will launch with it. And the activity is basically a set of actions that run-in a given order. Now, it's possible in a workflow launches more than one activity could be activated, but typically just one is.
So when this activity is, run, it'll just go down the order of actions and fulfill each action one at a time. Now, it'll do that until one action can't complete. So there might be some logic in one of these actions that says, what, I I just can't finish right now. I'm waiting for something something to change or to get back to me and so I can't finish right now. At that point, the workflow processing for this activity will just pause and wait till it gets run again in the future.
Once all the actions on an activity run and and finish, the activity will be marked as complete. And when all the activities that are in a workflow are completed, then the workflow itself is completed. Now, likely that one of these actions within an activity might spawn a new activity of a different type or maybe even the same type. And so when that happens, then the new activity is launched and then again it starts at the top and works its way down to the bottom. Now, it's not uncommon for one activity to actually spawn multiple different activities and that's how you start to get workflows that can become, , a little complex.
So, again, all of these will just keep running until all these activities are marked complete, then the workflow be marked complete. It is possible that maybe one of these actions though could mark the workflow complete itself in which case any activities that are still running will be marked complete and the workflow will be done. Now, are on many different entities within Rock and workflows are no different. So these are the activities for the sample workflow of position approval. And so if you're familiar with that workflow, some of these will make a lot of sense the request or the position, the position title, description, and type.
So it's important to note that workflows have attributes and any one of these actions can read or write to these attributes and can use them for filtering and conditional logic. But you can also have attributes on activities. Now, when would you do this versus putting on the workflow? It really is it depends. You could, in a lot of cases, put these attributes on the workflow and just have these actions read and write from them.
But sometimes you really wanna keep the values of these attributes unique to the activity, in which case having attributes on activity is very powerful. Now, if we go to the position approval detail, you'll see a listing here of all the different activities and actions, for that workflow. This is a very handy way of just kind of getting an idea of what this workflow is doing without having to drill down and, see all of the gory details of the edit surface. Now, talked about actions and there's a lot of actions, that you can use within your workflow. This is a list of it's not a complete list, but it's a list of a lot of the actions that are available to you.
I've bolded some of them here, some of the ones that are maybe a little bit more important. But in doing so, the more you bold, the more you realize they're all kind of important. But let's just kind of go through and look at some of the ones that are more useful and more common. So we mentioned that one of the actions might activate another activity. And so, of course, there's an action that just does just that.
If you have a person in your workflow, you can assign them to a specific group. You can add a note to your workflow. You can, activate, the activity to a group or person. We're gonna be talking a lot about that in in another video on, using user entry forms. As I noted too, an action can actually complete the workflow itself and that's what this, action here does.
But other actions that you might be interested in is you can add a note to a person. You can tag a person, put a tag on a person, you can send email, you can set person attributes. And another very common one is this user entry form. And again, there's a whole video just on this one because it's so key, to workflows. There's other other also other actions that if you have a first name, last name and email, you can go and send that to the database and get back that actual person record.
If that person's record doesn't exist, it'll actually create the person for you. So as you can see these actions are really the backbone of of workflows and understanding them is super key to to knowing what you can do with workflows.