--- title: PlaybookExperience - Scoped description: The PlaybookExperience API provides methods for handling playbook executions.Cancel an individual playbook.Cancels playbook executions for a given parent record.Gets a list of playbook executions for a given parent record.Checks whether a parent record has playbook executions.Restarts an execution from the beginning \(the entire playbook\) or from a specific stage or activity of a playbook.Initiates a playbook for a parent record. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/PlaybookExperienceScopedAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 17 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # PlaybookExperience- Scoped 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/process-automation-designer.md). **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## PlaybookExperience - cancelPlaybook\(String playbookContext, String cancellationReason, String playbookExperienceId, Boolean force\) Cancel an individual playbook.
| Name | Type | Description |
|---|---|---|
| playbookContext | GlideRecord | The \[sys\_pd\_context\] record that you want to cancel. |
| cancellationReason | String | The reason for canceling the playbook execution. This appears in the UI for runtime users as well. |
| playbookExperienceId | String | Optional. Sys\_id of the playbook experience record in the Playbook Experience \[sys\_playbook\_experience\] table to use for the cancellation. Use this parameter if you've defined custom activity state mappings. See [Playbook activity state mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/playbook-activity-state-mapping.md).Default: Sys\_id of the Global Playbook Experience record. |
| force | Boolean | Optional. If set to true, cancels the underlying flows for activities that are In Progress. The cancellationReason parameter is not used when this parameter is set to true. You can only force cancel activities after the playbook is cancelled and the sys\_pd\_context is in a Pending Cancel state.**Note:** The flow engine attempts to cancel all underlying flows without creating issues when a playbook is canceled, but we cannot guarantee that no issues will occur. |
| Type | Description |
|---|---|
| <Object>.canceledPlaybookContext | The cancelled playbook execution associated data, such as the reason why it was cancelled.Data type: Array ``` "canceledPlaybookContext": [ { "can_read": Boolean, "canceled_by": "String", "can_add_activity": Boolean, "snapshot_id": "string", "can_restart": Boolean, "can_cancel": Boolean, "cancellation_reason": "String", "errors": [Array], "parent_record": "String", "parent_table": "String", "playbook_id": "String", "playbook_table": "String", "scoped_name": "String", "variant_id": "String", "is_archived": Boolean, "state": {Object}, "sys_id": "String", "title": "String" } ] ``` |
| <Object>.canceledPlaybookContext.can\_add\_activity | Flag that indicates whether a user can add an optional activity to the playbook.Valid values: - true: Current user can add an optional activity to the playbook. - false: Current user can’t add an optional activity to the playbook. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_cancel | Flag that indicates whether a user can cancel a playbook.- true: The process definition for the deactivated playbook is active. - false: The process definition for the deactivated playbook is inactive. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_read | Flag that indicates whether the current user can read the playbook execution record. The current user must have read access to the parent record to be able to read the playbook execution record. Valid values: - true: Current user has read access to the playbook execution record. - false: Current user doesn't have read access to the playbook execution record. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_restart | Flag that indicates whether a user can restart a playbook, stage, or activity.- true: Current user can restart the playbook, stage, or activity. - false: Current user can’t restart the playbook, stage, or activity. Data type: Boolean |
| <Object>.canceledPlaybookContext.canceled\_by | The **User ID** of the user who cancelled the playbook execution.Data type: String |
| <Object>.canceledPlaybookContext.cancellation\_reason | The cancellation reason input by the user who cancelled the playbook execution.Data type: String |
| <Object>.canceledPlaybookContext.errors | List of cancellation errors. Each error is an object in the array.Data type: Array ``` "errors": [ { "message": "String", "type": "String" } ] ``` |
| <Object>.canceledPlaybookContext.errors.message | The error message.Data type: String |
| <Object>.canceledPlaybookContext.errors.type | The type of error.Data type: String |
| <Object>.canceledPlaybookContext.is\_archived | Flag that indicates whether playbook context records are archived. Set to true. This value can’t be modified.Possible values: - true: Playbook context records are archived. - false: Playbook context records aren’t archived. Data type: Boolean |
| <Object>.canceledPlaybookContext.parent\_record | Sys\_id of the parent record that playbook executions were cancelled for.Data type: String |
| <Object>.canceledPlaybookContext.parent\_table | The name of the table that the parent record is from.Data type: String |
| <Object>.canceledPlaybookContext.playbook\_id | Sys\_id of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Object>.canceledPlaybookContext.playbook\_table | The name of the table that the playbook is from, generally the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Object>.canceledPlaybookContext.scoped\_name | The scoped name of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table in the format `scope.name`.Data type: String |
| <Object>.canceledPlaybookContext.snapshot\_id | Sys\_id of the snapshot of the playbook execution from the \[sys\_pd\_snapshot\] table.Data type: String |
| <Object>.canceledPlaybookContext.state | The state of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: Object ``` "state": { "displayValue": "String", "value": "String" } ``` |
| <Object>.canceledPlaybookContext.state.displayValue | The display value of the playbook execution state.Data type: String |
| <Object>.canceledPlaybookContext.state.value | The value of the playbook execution state.Data type: String |
| <Object>.canceledPlaybookContext.sys\_id | Sys\_id of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| <Object>.canceledPlaybookContext.title | The label of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| <Object>.canceledPlaybookContext.variant\_id | Sys\_id of the playbook variant execution from the Process Executions \[sys\_pd\_context\] table. |
| Name | Type | Description |
|---|---|---|
| parentRecord | GlideRecord | The parent record to cancel playbook executions for. The parent record can be any record that has playbook executions, such as an interaction record or an onboarding case record. |
| cancellationReason | String | The reason for cancelling the playbook executions. |
| scopedName | String | Optional. The scoped name of the playbook to cancel. 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 cancelled for the given parent record. If not provided, all executions of all playbooks are cancelled for the given parent record. |
| playbookExperienceId | String | Optional. Sys\_id of the playbook experience record in the Playbook Experience \[sys\_playbook\_experience\] table to use for the cancellation. Use this parameter if you've defined custom activity state mappings. See[Playbook activity state mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/playbook-activity-state-mapping.md).Default: Sys\_id of the Global Playbook Experience record. |
| Type | Description |
|---|---|
| Object | Object containing the cancelled playbook executions and any skipped playbook executions that were unable to be cancelled. ``` { "canceledPlaybookContext": [Array], "skippedPlaybookContext": [Array] } ``` |
| <Object>.canceledPlaybookContext | List of the cancelled playbook executions. Each playbook execution is an object in the array.Data type: Array ``` "canceledPlaybookContext": [ { "can_read": Boolean, "canceled_by": "String", "cancellation_reason": "String", "errors": [Array], "parent_record": "String", "parent_table": "String", "playbook_id": "String", "playbook_table": "String", "scoped_name": "String", "state": {Object}, "sys_id": "String", "title": "String" } ] ``` |
| <Object>.canceledPlaybookContext.can\_add\_activity | Flag that indicates whether a user can add an optional activity to the playbook.Valid values: - true: Current user can add an optional activity to the playbook. - false: Current user can’t add an optional activity to the playbook. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_cancel | Flag that indicates whether a user can cancel a playbook.- true: The process definition for the deactivated playbook is active. - false: The process definition for the deactivated playbook is inactive. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_read | Flag that indicates whether the current user can read the playbook execution record. The current user must have read access to the parent record to be able to read the playbook execution record. Valid values: - true: Current user has read access to the playbook execution record. - false: Current user doesn't have read access to the playbook execution record. Data type: Boolean |
| <Object>.canceledPlaybookContext.can\_restart | Flag that indicates whether a user can restart a playbook, stage, or activity.- true: Current user can restart the playbook, stage, or activity. - false: Current user can’t restart the playbook, stage, or activity. Data type: Boolean |
| <Object>.canceledPlaybookContext.canceled\_by | The **User ID** of the user who cancelled the playbook execution.Data type: String |
| <Object>.canceledPlaybookContext.cancellation\_reason | The cancellation reason input by the user who cancelled the playbook execution.Data type: String |
| <Object>.canceledPlaybookContext.errors | List of cancellation errors. Each error is an object in the array.Data type: Array ``` "errors": [ { "message": "String", "type": "String" } ] ``` |
| <Object>.canceledPlaybookContext.errors.message | The error message.Data type: String |
| <Object>.canceledPlaybookContext.errors.type | The type of error.Data type: String |
| <Object>.canceledPlaybookContext.is\_archived | Flag that indicates whether playbook context records are archived. Set to true. This value can’t be modified.Possible values: - true: Playbook context records are archived. - false: Playbook context records aren’t archived. Data type: Boolean |
| <Object>.canceledPlaybookContext.parent\_record | Sys\_id of the parent record that playbook executions were cancelled for.Data type: String |
| <Object>.canceledPlaybookContext.parent\_table | The name of the table that the parent record is from.Data type: String |
| <Object>.canceledPlaybookContext.playbook\_id | Sys\_id of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Object>.canceledPlaybookContext.playbook\_table | The name of the table that the playbook is from, generally the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Object>.canceledPlaybookContext.scoped\_name | The scoped name of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table in the format `scope.name`.Data type: String |
| <Object>.canceledPlaybookContext.snapshot\_id | Sys\_id of the snapshot of the playbook execution from the \[sys\_pd\_snapshot\] table.Data type: String |
| <Object>.canceledPlaybookContext.state | The state of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: Object ``` "state": { "displayValue": "String", "value": "String" } ``` |
| <Object>.canceledPlaybookContext.state.displayValue | The display value of the playbook execution state.Data type: String |
| <Object>.canceledPlaybookContext.state.value | The value of the playbook execution state.Data type: String |
| <Object>.canceledPlaybookContext.sys\_id | Sys\_id of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| <Object>.canceledPlaybookContext.title | The label of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| <Object>.skippedPlaybookContext | List of the skipped playbook executions. Each playbook execution is an object in the array. For descriptions of the object properties, see the **canceledPlaybookContext** array. Data type: Array ``` "skippedPlaybookContext": [ { "can_read": Boolean, "canceled_by": "String", "cancellation_reason": "String", "errors": [Array], "parent_record": "String", "parent_table": "String", "playbook_id": "String", "playbook_table": "String", "scoped_name": "String", "state": {Object}, "sys_id": "String", "title": "String" } ] ``` |
| <Object>.canceledPlaybookContext.variant\_id | Sys\_id of the playbook variant execution from the Process Executions \[sys\_pd\_context\] table. |
| Type | Description |
|---|---|
| Array | List of playbook executions for the parent record. Each playbook execution is an object in the array.``` [ { "can_read": Boolean, "canceled_by": "String", "cancellation_reason": "String", "errors": [Array], "parent_record": "String", "parent_table": "String", "playbook_id": "String", "playbook_table": "String", "scoped_name": "String", "state": {Object}, "sys_id": "String", "title": "String" } ] ``` |
| <Array>.can\_read | Flag that indicates whether the current user can read the playbook execution record. The current user must have read access to the parent record to be able to read the playbook execution record. Valid values: - true: Current user has read access to the playbook execution record. - false: Current user doesn't have read access to the playbook execution record. Data type: Boolean |
| <Array>.canceled\_by | The **User ID** of the user who cancelled the playbook execution. Empty if the playbook is not cancelled.Data type: String |
| <Array>.cancellation\_reason | The cancellation reason input by the user who cancelled the playbook execution. Empty if the playbook is not cancelled.Data type: String |
| <Array>.errors | List of errors. Each error is an object in the array.Data type: Array ``` "errors": [ { "message": "String", "type": "String" } ] ``` |
| <Array>.errors.message | The error message.Data type: String |
| <Array>.errors.type | The type of error.Data type: String |
| <Array>.parent\_record | Sys\_id of the parent record.Data type: String |
| <Array>.parent\_table | The name of the table that the parent record is from.Data type: String |
| <Array>.playbook\_id | Sys\_id of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Array>.playbook\_table | The name of the table that the playbook is from, generally the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| <Array>.scoped\_name | The scoped name of the playbook from the Process Definitions \[sys\_pd\_process\_definition\] table in the format `scope.name`.Data type: String |
| <Array>.state | The state of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: Object ``` "state": { "displayValue": "String", "value": "String" } ``` |
| <Array>.state.displayValue | The display value of the playbook execution state.Data type: String |
| <Array>.state.value | The value of the playbook execution state.Data type: String |
| <Array>.sys\_id | Sys\_id of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| <Array>.title | The label of the playbook execution from the Process Executions \[sys\_pd\_context\] table.Data type: String |
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the parent record has playbook executions. Valid values: - true: Parent record has playbook executions. - false: Parent record doesn't have playbook executions. |
| Name | Type | Description |
|---|---|---|
| playbookContext | GlideRecord | The playbook context record for the playbook run or execution that you want to restart.Table: Process Execution \[sys\_pd\_context\] |
| laneContextId | String | Optional. The sys\_id of the stage context record for the stage run or execution that you want to restart from. **laneContextId** and **activityContextId** are mutually exclusive; only one of these values can be specified at a time, while the other should be either an empty string or null. **Note:** Only complete stages can be restarted. Table: Lane Executions \[sys\_pd\_lane\_context\] |
| activityContextId | String | Optional. The sys\_id of the activity context record for the activity run or execution that you want to restart from. **laneContextId** and **activityContextId** are mutually exclusive; only one of these values can be specified at a time, while the other should be either an empty string or null. **Note:** Only complete activities can be restarted. Table: Activity Executions \[sys\_pd\_activity\_context\] |
| playbookExperienceId | String | Optional. The sys\_id of the playbook experience that you want to use for the restarted run. Use this parameter if you have defined custom activity state mappings. See [Playbook activity state mapping](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/playbook-activity-state-mapping.md).Default: Global Playbook Experience Table: Playbook Experience \[sys\_playbook\_experience\] |
| Property | Description |
|---|---|
| Object | Object containing the restarted playbook execution details.``` { "can_add_activity": Boolean, "can_cancel": Boolean, "can_read": Boolean "can_restart": Boolean, "canceled_by": "String", "cancellation_reason": "String", "errors": [Array] "is_archived": Boolean "parent_record": "String", "parent_table": "String", "playbook_id": "String", "playbook_table": "String", "scoped_name": "String", "state": {Object}, "sys_id": "String", "title": "String", } ``` |
| can\_add\_activity | Flag that indicates whether a user can add an optional activity to the playbook.Valid values: - true: Current user can add an optional activity to the playbook. - false: Current user can’t add an optional activity to the playbook. Data type: Boolean |
| can\_cancel | Flag that indicates whether a user can cancel a playbook.- true: The process definition for the deactivated playbook is active. - false: The process definition for the deactivated playbook is inactive. Data type: Boolean |
| can\_read | Flag that indicates whether the current user can read the playbook execution record. The current user must have read access to the parent record to be able to read the playbook execution record.- true: Current user has read access to the playbook execution record. - false: Current user doesn't have read access to the playbook execution record. Data type: Boolean |
| can\_restart | Flag that indicates whether a user can restart a playbook, stage, or activity.- true: Current user can restart the playbook, stage, or activity. - false: Current user can’t restart the playbook, stage, or activity. Data type: Boolean |
| canceled\_by | **User ID** of the user who canceled the playbook execution.Data type: String |
| cancellation\_reason | Cancellation reason entered by the user who canceled the playbook execution.Data type: String |
| errors | List of restart errors. Each error is an object in the array.Data type: Array ``` "errors": [ { "message": "String", "type": "String" } ] ``` |
| is\_archived | Flag that indicates whether playbook context records are archived.Possible values: - true: Playbook context records are archived. - false: Playbook context records aren’t archived. Data type: Boolean |
| parent\_record | Sys\_id of the parent record that playbook executions were restarted for.Data type: String |
| parent\_table | Name of the table that the parent record is from.Data type: String |
| playbook\_id | Sys\_id of the playbook.Data type: String Table: Process Definitions \[sys\_pd\_process\_definition\] |
| playbook\_table | Name of the table that the playbook is from, generally the Process Definitions \[sys\_pd\_process\_definition\] table.Data type: String |
| scoped\_name | Optional. The scoped name of the playbook to restart. 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 restarted for the given parent record. If not provided, all executions of all playbooks are restarted for the given parent record.Data type: String |
| state | Indicates whether your request to activate was successful.Data type: Object Possible values: - SUCCESS: The playbook was successfully activated. - FAILURE: The ID for the playbook wasn’t found. ``` "state": [ { "displayValue": "String", "value": "String" } ] ``` |
| state.displayValue | Display value of the playbook execution state.Data type: String |
| state.value | Value of the playbook execution state.Data type: String |
| sys\_id | Sys\_id of the playbook execution.Data type: String Table: Process Executions \[sys\_pd\_context\] |
| title | Label of the playbook execution.Data type: String Table: Process Executions \[sys\_pd\_context\] |