Rollback a service during an incident
You can use a Cortex Workflow to roll back services, allowing quick remediation in the event of incidents.
How to rollback a service with a Cortex Workflow
Step 1: Start creating the Workflow
Follow the steps in the documentation to create a Workflow and configure its basic settings.
This Workflow is scoped to the "service" entity type.
Step 2: Add blocks to the Workflow
The instructions on this page describe how to create this Workflow in the Cortex UI, but it is also possible to copy the Workflow YAML and add it to your workspace via the Cortex CLI. This allows you to quickly set up the example configuration then iterate on it for your own use case. Expand the tile below to learn more.
Expand the tiles below to learn about each block in this Workflow and how to configure them in the Cortex UI:
Step 3: Run the Workflow
At the top of the page, click Run Workflow.
When you run the Workflow, the following events happen:
The Workflow pauses to collect a response from the user during the User Input block. The user enters a name and severity for the incident, and chooses whether to create a Slack channel
Some incidents require additional team work and collaboration, while others can be easily mitigated and may not require a dedicated channel.
The "List deployments for entity" block runs, fetching a list of deployments associated with the entity.
The JavaScript block runs, which formats the deployment data.
The next User Input block runs, which uses the formatted data from the previous block to provide a commit ID to rollback to.
The second JavaScript block runs, which extracts the SHA from the output of the previous block.
The GitHub workflow is triggered to roll back the affected service.
The Branch block runs:
If the user selected to create a Slack channel: An HTTP request runs to create an incident Slack channel, and an HTTP block runs to send a Slack message into the channel including the incident name, the service being rolled back, and the commit ID.
If the user selected to not create a Slack channel: The "Do not create Slack channel" path runs. A Slack block runs, which sends a Slack message to an existing team channel to let them know a separate incident channel was not created.
Last updated
Was this helpful?