---
sourceDocument: Australia Build workflows
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/build-workflows

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Build workflows

ft:clusterId :

    - crworkflow

bundleId :

    - crworkflow

workflow :

    - Creator


---

# Archive process contexts

# Archive process contexts {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

Improve database query performance by archiving unneeded records for playbooks that are in a Complete, Error, or Cancelled state.

## Before you begin

Role required: admin or playbook.admin

## About this task

Depending on how many playbooks you have run, you may have hundreds or thousands of records in your database that aren't used anymore. Reduce the number of records that your database queries have to search through by
archiving the records for playbooks that are in a Complete, Error, or Cancelled state.  
By default, context records are automatically archived for process executions that are:

* In Complete, Skipped, or Cancelled state
* For a playbook that hasn't been edited within 14 days.  
  Note:  
  You can adjust the number of days. To learn more about configuring archive settings, see [Configure archive settings for process contexts](https://servicenow-prod.fluidtopics.net/LxdFfOnMrt6C4fuOuQCe2A "Change the default settings for the automated archiving feature for process contexts.").
{#archive-process-executions__ul_kt2_v24_kbc}

If you don't want context records to automatically be archived, see [Turn off automated archiving](https://servicenow-prod.fluidtopics.net/DKYqKn9kvgBfN0Z06XtphA "Turn off the automatic archiving of context records for your complete and cancelled playbooks.").  
Contexts for process executions that are in an Error state must be archived manually.  
Note:  
If you no longer need logs for a process execution that ended in an error, archive the context records.  
When you archive context records for a process execution, the following records are compressed into a single JSON record:

* Element mapping \[`sys_element_mapping`\]
* Context log \[`sys_pd_context_logs`\]
* Variable value \[`sys_variable_value`\]
* Activity context \[`sys_pd_activity_context`\]
* Stage context \[`sys_pd_lane_context`\]
{#archive-process-executions__ul_nbs_45m_d1c}  
The JSON record can be viewed, but not edited. To learn more about viewing the JSON record for archived context data, see [View archived process contexts](https://servicenow-prod.fluidtopics.net/3FfEl48hsZkbN6R9GybCgg "Configure the form layout for a process execution so that you can see the JSON record for archived context records.").  
Warning:  
Archiving cannot be undone. If you need context logs or reports that use these records, don't archive. If automated archiving creates report problems, turn off the feature. To learn how to turn off automated archiving, see [Turn off automated archiving](https://servicenow-prod.fluidtopics.net/DKYqKn9kvgBfN0Z06XtphA "Turn off the automatic archiving of context records for your complete and cancelled playbooks.").Agents can still open playbooks to see historical data, such as why a playbook was canceled or who an activity was assigned to.

Flow context (`sys_flow_context`) records are also deleted automatically 2 weeks after completion. For more information about flow data retention, see [Flow execution details retention](https://servicenow-prod.fluidtopics.net/h2t10962GS3p9ueV1V_q6Q "Due to the large amount of data consumed by flow execution details, your instance uses data retention policies to delete this data after a set time period.").

## Procedure

Manually archive context records for a process execution

1. Navigate to All, and enter sys_pd_context.list in the Filter field to open the \[sys_pd_context\] table.
2. Select the check boxes next to the executions that you want to archive context records for.
3. In the upper right corner, select Archive Process Contexts from the action menu.
4. Confirm that you want to archive the process contexts.

## Result

The context records are archived for your selected process executions.
If you have a large number of context records to archive, records are archived in limited batches on an hourly basis, to avoid slowing down the instance.

## Archive context records for an execution {#archive-process-executions__example_l4q_nn4_kbc}

<br />

<br />

## What to do next

Configure the form layout for process executions so that you can see the archived data. To learn more about configuring the form layout for a process execution, see [View archived process contexts](https://servicenow-prod.fluidtopics.net/3FfEl48hsZkbN6R9GybCgg "Configure the form layout for a process execution so that you can see the JSON record for archived context records.").
* **[Configure archive settings for process contexts](https://servicenow-prod.fluidtopics.net/LxdFfOnMrt6C4fuOuQCe2A)**   
  Change the default settings for the automated archiving feature for process contexts.
* **[Turn off automated archiving](https://servicenow-prod.fluidtopics.net/DKYqKn9kvgBfN0Z06XtphA)**   
  Turn off the automatic archiving of context records for your complete and cancelled playbooks.
* **[View archived process contexts](https://servicenow-prod.fluidtopics.net/3FfEl48hsZkbN6R9GybCgg)**   
  Configure the form layout for a process execution so that you can see the JSON record for archived context records.

