Configure component actions
This page describes StackState version 4.2.
The StackState 4.2 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.2 version range to upgrade to a more recent release.
This how-to describes the steps to create a Component Action that can be executed from the component context menu in a Topology View.
To start working with Component Actions, go to the Settings page and then in Actions, select "Component Actions". There you can add a new Component Action or edit one that already exists.
Component Actions

1. Provide a name and description

A Component Action requires a name that is displayed in the Actions context menu; it is mandatory to provide a name. The Description, on the other hand, is optional. However, it is a good practice to provide a bit of explanation that gives more context about your Action.
Please note that the Component Action name is case-sensitive.

2. Bind components to your Action with an STQL query

In this step, you determine which components of your topology are going to be able to use this Action. To do that, provide an STQL query that selects all components that should have access to this specific Action. You can find more about queries in StackState on our page about using STQL.
The below example binds an Action to all components in the "Production" domain that are present in the "databases" layer.
(domain IN ("Production") AND layer IN ("databases"))

3. Write a script for your Action to execute

This step determines Action's behavior when it is executed from the component context menu. The scripting language here is Groovy, and you can script almost any action you need, from redirecting to another View with context, restarting remote components, to calling predictions for components.
Find more about the possibilities of scripting in StackState.

4. Provide a valid Identifier (optional)

A valid Identifier for an Action is a URN that follows the below convention:


Actions have access to a component object, representing the component the Action was invoked on.
Component properties can be accessed directly:
def podName =
Component labels can be accessed via the labels property:
def cluster = (component.labels.find {it ->"cluster-name") }).name.split(':')[1]
Using GraphQL, it is possible to access a specific StackPack's metadata:
def k8sSync = component.synced.find { s ->
def containerId =

Showing a topology query

The Action can direct StackState to open a new topology query:
def componentId =
UI.showTopologyByQuery("withNeighborsOf(direction = 'both', components = (id = '${componentId}'), levels = '15') and label = 'stackpack:openshift'")
The Action can direct StackState to navigate to a specific URL:
def awsSync = component.synced.find { s ->
def region =
def url = "https://${region}${region}#Instances:sort=instanceId"

Making HTTP requests

The Action can invoke an HTTP request to a remote URL:"")