- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Hi community! In this post I'll be detailing the steps needed to create an automated Custom Playbook Activity. It's great for those instances where you need records to be created or updated in the background of a playbook after another playbook step. Even better, it uses Flow Designer - so no code needed!
This guide is geared towards building a custom playbook activity and presumes you are already familiar with Playbook and Flow Designer. I won't be going into much detail about either of these in the steps below, so if you're unfamiliar I'd recommend brushing up on those first.
Use Case
Sometimes, out-of-the-box playbook activities don't cover the specific use case you need in your playbook. Using Flow Designer, we can create a custom activity that can do just about any kind of automated backend work related to your playbook. In this use case, we'll be creating a custom playbook activity that will copy an attachment that we will add in User Form activity to all of the Case Tasks related to the parent record that triggered the playbook.
Create the Playbook
First, head into the Process Automation Designer and create a new playbook and have it trigger when a new Case (sn_customerservice_case) record is created. Once that's done, add a new lane, feel free to name it anything you like. The first activity that we're going to add in this lane is the User Form activity. The only config we need to update is setting the Show Attachments option to true by checking the checkbox. This config can be found under the Automation tab in the activity configuration pane.
Create the Subflow
Next, we'll need to head into Flow Designer to create our subflow that will be handling the work in our custom playbook activity. We'll be creating a new subflow and naming it Automated Add Attachment to Tasks. For the subflow inputs, we'll add a mandatory input called Parent Case ID.
Then we'll add a couple actions:
- Look up the most recently created attachment record associated with this case ID
- Look up all case task records that are associated with this case ID
- For each case task record copy the attachment found in step 1 to each task record
Once added, hit publish - we're done in Flow Designer!
Create Custom Activity
Next, we'll head back into Process Automation Designer and create our custom activity. Once you're back in, click the Add Activity button at the bottom of the first lane underneath our User Form activity. At the top right box of the activity modal click the Create a new activity button.
We'll name our custom activity Automated Add Attachment to Tasks.
At the bottom of the record under the Automation Plan tab, click the search icon to the right of the Flow or Action field. When the modal pops up, change the Table name dropdown to Flow. In the Document field search for the subflow we just created and add it. Click OK on the popup modal, and then click Submit in the activity modal.
Next, click the Add Activity button and search for the activity we just created. Once you've found it, add it to the playbook.
Open up the activity config and under the Automation tab (which may be found in different places depending on the release you're on) we'll insert the Trigger Case's Sys ID under the Parent Case ID field (note that this is the input we created for the subflow) and click Done.
Now hit that test button at the top right corner of the Process Automation Designer and test out the playbook! Once it's loaded up on a record, add an attachment in the User Form activity and click Mark Complete. When the activity is fully completed, head over to the case tasks related to the case record you tested on and see if that attachment you added to the case record was also added to each task. Nice!
Notes
This is a guide entirely to show the capabilities of custom activities and not meant to be used for production environments without the necessary testing and processing required for deployment in live instances. Use these steps as a template for automating specific backend work you need done that out-of-the-box activities can't meet. Where possible, always use out-of-the-box activities in order to minimize potential errors and conflicts in your playbook that can arise when creating custom activities.
Happy building!
- 3,304 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.