PlaybookExperience - Scoped
-
- UpdatedJan 30, 2025
- 9 minutes to read
- Yokohama
- API reference
The PlaybookExperience API provides methods for handling playbook executions.
This API requires the Playbook Experience Core plugin (com.glide.playbook_experience.config)
and is provided within the sn_playbook
namespace.
This API requires at least one playbook in the Process Definition [sys_pd_process_definition] table. To use this API, you must have the roles required to view and cancel a running process in Process Automation Designer. For more information, see Process Automation Designer.
PlaybookExperience - cancelPlaybooksByParentRecord(GlideRecord parentRecord, String cancellationReason, String scopedName, String playbookExperienceId)
Cancels playbook executions for a given parent record.
Example
This example shows how to cancel all executions of a specific playbook (in this case, the
Playbook Experience Demo) for a given interaction record. To use this method in a UI action
or business rule, pass the current
object as the parentRecord instead.
Output:
PlaybookExperience - getPlaybooksForParentRecord(GlideRecord parentRecord)
Gets a list of playbook executions for a given parent record.
Name | Type | Description |
---|---|---|
parentRecord | GlideRecord | The parent record to get playbook executions for. The parent record can be any record that can have playbook executions, such as an interaction record or an onboarding case record. |
Example
This example shows how to get playbook executions for a given interaction record. To use
this method in a UI action or business rule, pass the current
object as the
parentRecord instead.
Output:
PlaybookExperience - parentRecordContainsPlaybook(GlideRecord parentRecord, String scopedName)
Checks whether a parent record has playbook executions.
Name | Type | Description |
---|---|---|
parentRecord | GlideRecord | The parent record to check for playbook executions. The parent record can be any record that can have playbook executions, such as an interaction record or an onboarding case record. |
scopedName | String | Optional. The scoped name of the playbook to check for. The scoped name is from
the Process Definition [sys_pd_process_definition] table in the format
scope.name . If provided, only executions of this playbook are
checked for. If not provided, executions of all playbooks are checked for. |
Type | Description |
---|---|
Boolean | Flag that indicates whether the parent record has playbook executions. Valid values:
|
Example
This example shows how to check if a given interaction record has executions of a specific
playbook (in this case, the Playbook Experience Demo). To use this method in a UI action or
business rule, pass the current
object as the parentRecord instead.
Output:
PlaybookExperience - restartPlaybook(String playbookContextId, String laneContextId, String activityContextId, String playbookExperienceId)
Restarts an execution from the beginning (the entire playbook) or from a specific stage or activity of a playbook.
Example
This example shows how to restart an entire playbook run with the Process Executions [sys_pd_context] record ID 98e4fe04591b4caca59583f7b8e30b0a.
Output:
PlaybookExperience - triggerPlaybook(String scopedName, GlideRecord parentRecord)
Initiates a playbook for a parent record.
Name | Type | Description |
---|---|---|
scopedName | String | The scoped name of the playbook to initiate. The scoped name is from the
Process Definition [sys_pd_process_definition] table in the format
scope.name . |
parentRecord | GlideRecord | The parent record to initiate a playbook for. The parent record can be any record that can have playbook executions, such as an interaction record or an onboarding case record. |
Type | Description |
---|---|
String | Sys_id of the playbook execution from the Process Executions [sys_pd_context] table that was created for the parent record. Null if a playbook execution wasn't successfully created. |
Example
This example shows how to initiate a playbook for a given interaction record. To use this
method in a UI action or business rule, pass the current
object as the
parentRecord instead.
Output:
On this page
- PlaybookExperience - cancelPlaybooksByParentRecord(GlideRecord parentRecord, String
cancellationReason, String scopedName, String playbookExperienceId)
- PlaybookExperience - getPlaybooksForParentRecord(GlideRecord parentRecord)
- PlaybookExperience - parentRecordContainsPlaybook(GlideRecord parentRecord, String
scopedName)
- PlaybookExperience - restartPlaybook(String playbookContextId, String laneContextId, String activityContextId, String playbookExperienceId)
- PlaybookExperience - triggerPlaybook(String scopedName, GlideRecord parentRecord)