Set a Cache Variable Value

PagerDuty AIOps

📘

Availability

This workflow action is available to AIOps customers on our Business and Enterprise for Incident Management pricing plans. Please contact our Sales Team to upgrade to an account with this action.

Description

Use the REST API to set the value of an existing Event Orchestration Cache Variable. This will overwrite any existing value and reset the TTL counter.

📘

Requirements

In order to publish a usable action, you must have API access with WRITE permissions for the Event Orchestration that the Cache Variable belongs to.

🚧

Action Limitations

Examples

See how you can use this action within a larger use case to stop system events from auto-resolving high priority incidents.

Prerequisites

  1. Create a new API Access Key with WRITE access to the relevant Event Orchestration. Ensure that you save this API Key during the creation process, as you will not have access to the value again.
  2. Create a Web API Workflow Integration. The fields within the Web API Workflow Integration must follow specific configurations for this action:
    1. Authentication Headers: Use the exact format below and replace “VALUE OF API KEY HERE” with the API Access Key generated above:
      1. Authentication: Token token={VALUE OF API KEY HERE}
    2. Allowed Hostnames: Ensure that you include your PagerDuty account’s subdomain as one of the hostnames:
      1. *.pagerduty.com
  3. In an existing Event Orchestration, create a Cache Variable with an External Data Variable Type.

Instructions

  1. If you have not done so already, please follow our instructions to Create an Incident Workflow.
  2. Select a Conditional or Manual Trigger, depending on if you’d like the Cache Variable value to be updated automatically or manually by a user.
  3. When you are prompted to add actions, select this action.
  4. Enter the following Inputs and then click Save. Continue following instructions to Publish the Workflow. When the action runs, you will see the Outputs listed below.

Inputs

📘

Field References

Fields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter {{, and select relevant fields. Please see our Field References article for more information.

NameDescription
Authentication HeadersSelect the connection created in Prerequisites.
Event Orchestration TypeSelect the type of Event Orchestration (Global or Service) the Cache Variable belongs to
Event OrchestrationSelect the type of Event Orchestration (Global or Service) the Cache Variable belongs to
Cache VariableBased on the selected Event Orchestration, select the Cache Variable whose value the workflow will update. Note: You can only select variables with the External Data Variable Type.
ValueEnter the value this Cache Variable will be set to. This value must match the Cache Variable's data format (string, number, or boolean).

Outputs

NameDescription
ValueA string representation of the new value of this Cache Variable. Ex: "42" or "true".
DetailsDetails about the new value of this Cache Variable. Example: { "cache_variable_data": 42, "updated_at": "2025-02-21T23:46:08Z" }.
ResultValue that shows if the action was successful or not. Either "Success" or "Failed".
Result SummaryBrief description of what the action did or if it failed.
ErrorBrief description that is populated if the action failed.