---
title: "Archive incident channel after resolve | Grafana Cloud documentation"
description: "Archive an incident's Slack channel a day after it's resolved, with a heads-up first."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Archive incident channel after resolve

> Note
> 
> Grafana Workflows is currently in [public preview](https://grafana.com/docs/release-life-cycle/). Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

Archive an incident’s Slack channel a day after it’s resolved, with a heads-up first.

This Grafana Workflows blueprint is in the **Incidents** category of the Blueprints library.

## Before you begin

To use this blueprint, you need:

- Grafana IRM set up on your stack.
- Slack connected to Grafana IRM. For details, refer to [Configure Slack for Grafana IRM](https://grafana.com/docs/grafana-cloud/alerting-and-irm/irm/integrations/chat-and-collaboration/slack/).

## Steps

Steps run in order from first to last. A step inside a switch branch runs only when Workflows chooses that branch.

Expand table

| Step                  | ID           | Type                    | Description                                                                                                                |
|-----------------------|--------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------|
| Warn before archiving | `heads-up`   | `slack.message.post`    | Tells the channel it will be archived. Keep the wording in sync with the wait time.                                        |
| Wait 24 hours         | `wait-a-day` | `wait`                  | Waits before archiving. Change seconds to adjust, for example 604800 for 7 days, and update the heads-up message to match. |
| Archive the channel   | `archive`    | `slack.channel.archive` | Archives the incident Slack channel. No changes needed.                                                                    |

For the inputs and outputs of each step type, refer to [Step and trigger types reference](https://grafana.com/docs/grafana-cloud/platform/workflows/reference/step-trigger-types).

Before you turn on the workflow, customize any steps that need input from you, such as a channel ID or a schedule name. Each step’s description says what to set.

## Workflow definition

Save this definition as a YAML file to create the workflow with gcx, the Workflows API, or Terraform, or give it to a coding agent as an example. Replace *FOLDER\_UID* with the UID of the folder for the workflow. Blueprints start disabled, so finish customizing the steps before you set `enabled` to `true`. For details, refer to [Manage workflows as code](https://grafana.com/docs/grafana-cloud/platform/workflows/as-code).

YAML ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
apiVersion: workflows.ext.grafana.app/v1alpha1
kind: Definition
metadata:
  name: archive-incident-channel
  annotations:
    grafana.app/folder: <FOLDER_UID>
spec:
  name: Archive incident channel after resolve
  enabled: false
  runOnceFor: 'archive-channel:${inputs.data.incidentID}'
  startWhen:
    matchingRules:
      - eventNameRegex: 'grafana_irm_app\.incident\.updated'
        filter: "inputs.data.eventKind == 'incident_updated_status' && inputs.data.newStatus == 'resolved' && has(resources.incident.event.slackChannelID)"
    schedules: []
  steps:
    - id: heads-up
      type: slack.message.post
      name: Warn before archiving
      description: Tells the channel it will be archived. Keep the wording in sync with the wait time.
      inputs:
        channelID: '${resources.incident.event.slackChannelID}'
        messageText: ':file_cabinet: This incident is resolved. This channel will be archived in 24 hours. Save anything you need, such as links and files, before then.'
    - id: wait-a-day
      type: wait
      name: Wait 24 hours
      description: Waits before archiving. Change seconds to adjust, for example 604800 for 7 days, and update the heads-up message to match.
      inputs:
        seconds: '86400'
    - id: archive
      type: slack.channel.archive
      name: Archive the channel
      description: Archives the incident Slack channel. No changes needed.
      inputs:
        channelID: '${resources.incident.event.slackChannelID}'
```

## How it works

This section explains when the workflow runs and how its steps work together.

### When it runs

This blueprint starts on the `grafana_irm_app.incident.updated` event.

Its trigger filter starts a run only when this CEL expression is true:

text ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```text
inputs.data.eventKind == 'incident_updated_status' && inputs.data.newStatus == 'resolved' && has(resources.incident.event.slackChannelID)
```

It runs at most once for each run-once key. This blueprint’s key is `archive-channel:${inputs.data.incidentID}`, so a later event with the same key doesn’t start another run. For details, refer to [Deduplicate workflow runs](https://grafana.com/docs/grafana-cloud/platform/workflows/build/triggers/#deduplicate-workflow-runs).

### How the steps fit together

These notes cover how the steps connect and which Workflows behaviors the blueprint relies on.

- Triggers on `eventKind` `incident_updated_status` when `newStatus` is resolved and the incident has a linked Slack channel (`resources.incident.event.slackChannelID`).
- `runOnceFor` keys on the incident ID so the channel is handled once.
- It posts a heads-up in the channel, waits 24 hours, then archives the channel.
- Waits are durable timers, so long waits are fine.
- Customize the wait time and the heads-up message.

## Next steps

- [Blueprints](https://grafana.com/docs/grafana-cloud/platform/workflows/reference/blueprints)
- [Start from a blueprint](https://grafana.com/docs/grafana-cloud/platform/workflows/build/use-blueprints)
- [Manage workflows as code](https://grafana.com/docs/grafana-cloud/platform/workflows/as-code)
- [Step and trigger types reference](https://grafana.com/docs/grafana-cloud/platform/workflows/reference/step-trigger-types)
