Rock U - Workflows - Deconstructing a Sample Workflow

Transcribed Video Content

The fastest way to learn workflow building is to take apart one that already exists and works. So we'll look at one together and see how activities, actions, and more fit together so that when you build your first workflow, it doesn't feel so abstract and instead it feels easy. Okay, buckle in as we step through this workflow, there's gonna be a lot of information, but hopefully it will help you understand why a workflow that's following best practices is set up in a certain way. So we're gonna go to admin tools, settings, then we're gonna go to workflow configuration and let's use an example here of position approval. So this is a workflow that's been put together really well. And if we go to edit it, there's some settings that are worth covering. So first of all, in the details, adding a name that is very simple but makes sense, then a well written description that really helps you understand what's a part of this workflow. And if there's any context that's needed, it should be added in this description. The workflow is active, meaning it can be selected to run under certain conditions. You'll be able to see it in lists, for example. Then automatically persisted, when you persist, it basically starts saving where you're at in the process of a workflow. And in this workflow, we don't actually wanna automatically persist. I'll show you why in a moment. Then work term, this is basically what you're gonna call the instances of this workflow. So each one of these instances will be a position request. Then each one of these will have a number. So you could have a position request 345. If you wanted to add a prefix to that such as PR, for example, you could do that easily. Also picking a category is nice. We're in the samples category here. It's just nice to start building out a structure for these workflows. Then you can pick an icon CSS class to show up here. You can see the user one. It's easy to find this once there's a long list of workflows in the future. Then also the slug for this workflow. Then the advanced settings, this is, it says more advanced and the processing interval, for example, is the minimum length of time that will pass before the same instance can be processed again. So this is sixty minutes. That's how long between the same basically, the workflow engine coming back and processing the same workflow instance. Then you can select whether you want logging to be a little bit less, you're just logging things at the workflow level or activity or action. And you'll usually use logging while you're debugging and building out a workflow. In this case, we've got it built out already, so we'll say none. Then you can also pick how long a workflow can live for before it's basically archived or completed and the log retention period. So if you are logging, how long that stays in your database, then completed workflow, how long that stays in your database as well. Also, if there's no action or, yeah, if there's no action, you can pick a message that shows up and also a summary view to help you understand what is in this workflow basically. So it's displayed when a workflow of this type has no user entry form or the workflow has been completed already, and you're looking at a workflow instance. Then attributes, so these are super important. They're set at, the workflow level. You can also set them, in a different place. I'll show you that in a moment, but you'll see these falling throughout this process. So keep them in mind. We've got a lot of different field types. We have the requester position title, which is just text. We have some more complex things the job description file, for example, and we have a salary range, which includes a decimal range, then you can reorder these if you want. But let's get into the actual activities. This first one is green because we've selected to activate it with the workflow. Meaning when the workflow starts, this will happen first. We have a nice name and description for it. We have no attributes, but this is the other place you can add attributes if you want to add them at the activity level. Then, we have all of our actions here. So let's step through them. The first one is using a very common action type, which is a form, and this is getting an input from the user. And we've got a nice header here that's really simple so that when this form is received, it's easy to tell what it is, position details. Then we've basically picked some of the attributes that we have and selected whether they're visible, editable, and required on the form. So when this workflow starts and someone fills it out, they're gonna have to fill out the position title, description, and type. Then, they'll have a button to submit it. And when they submit it, we'll get a response text that says your information has been submitted successfully. You can also select whether this, action will activate an activity, but we want to continue within the same activity. Now once that happens, that's when we actually know the workflow is worth saving and that's why we have an action type that we've selected under workflow control called workflow persist, and it will start persisting it, at this point. You can also pick whether you want it to basically pause and immediately save this workflow, but we're not gonna do that. We'll let it wait until later at a more convenient time, but the workflow will now be persisted. Then we'll pull from that form that was just submitted, see who submitted it using this workflow attribute of attribute set to current person, and they will have their name basically added to this requester attribute. Then the workflow name will be created as well using the attribute value of position title. So based on whatever was entered in that form, that will be a part of the workflow name. Then this is the first conditional action here. So the condition is basically that if the type is equal to full time, then we're going to run this action. And you get the details for this. So it says get full time details, and there's another form here, and it's sending out a workflow form notification. This is a really nice notification email that will probably suit your needs and it includes, actions here. So, it's going to show the position title, description, and type, and it's going to have job description as the thing that you can edit and it's required. So this will continue that activity. Let's actually close-up some of these things as, we don't want this to be overwhelming. If you take it action by action, these workflows are actually pretty simple and, it looks pretty similar here. So we've got this form, Then if the type is full time, we will actually set the attribute value and the attribute being being number of hours to forty. Then if the type was actually part time, then we have a different form which is showing similar things, but you'll set the number of hours and you'll enter the number of hours this employee will be working per week because we're not gonna assume we did with a full time position that it's going to be 40. Then we'll pull up the last action here in the activity. It's basically going to activate the next activity, which is HR entry. So this is a really nice clean activity. We know exactly what's happening here. We're doing an initial entry, and now we're moving on to HR entry, which is much simpler. We have a nice description, no attributes here, but it's going to assign to an HR member, which is just a hard coded person or admin here. And the action type is simply workflow control activity assigned to person. It's a nice way to keep track of who's responsible to complete a workflow. Then we have another form here, an HR entry form, and we're using the workflow form notification again. You can see all these fields that have already been filled out potentially are visible. And I say potentially because, it depends on whether the job description is filled out, for example, but you can see all those fields and then you'll be able to set the salary range and the approver. That's because this is going to a different person that we trust to complete this approval or complete this process of HR entry, and this person is in HR. And then once this is submitted, the activity of approval process is activated. So let's close this up and we'll move to approval process. Now we're going to assign to an approver. Pretty simple activity assigned from attribute value, and we'll use the attribute of approver, then approval entry will have a form, and we're gonna use that form notification. They'll be able to see basically everything that's been filled out up to this point, and so they can add approval notes, then they have two different options and these are two different buttons. They can pick whether they want to approve this position or deny it. And this is super helpful because it changes, what happens with the rest of the workflow depending on which one they pick. So if the approver selected approved, they'd get routed to the approved activity, and this would set the attribute saying this is approved. The requester, the original requester will get emailed from info@rocksolidchurchdemo. We have a subject that has lava in it and a body just saying exactly what the approval notes were, and there's really no action to be taken at this point. It's just saying, great. This is approved and we're done. Then it will also email HR with an email that's relevant to them using this email send action type. So it looks pretty similar here. Then once those things have happened, the entire workflow will be marked complete, and there we have a full cycle of the workflow. But let's trace it if something else were to have happened, if it wasn't approved and instead it was denied. We'll go to denied, and the position attribute will be marked or changed to denied. The requester will be emailed, basically letting them know that this has been denied and we won't save the communication history here. There's so many things you can change on all of these all these different actions, by the way. We're just covering some basic use of them. Then it will email HR and it will say, also this has been denied and it will close out this workflow. And there you go. Once you have a workflow, it's easy to look back and see exactly what the activities are in this summary view, and you can launch a workflow from here. You can look at workflow instances, secure, duplicate a workflow, and more. Now that you've seen a working workflow, hopefully you can see how it breaks down into its parts and it feels simpler to you and you're getting ready to create your first workflow.