workflow:
  id: tiered-alert-escalator
  name: Tiered Alert Escalator
  description: Manages alert escalation through different tiers based on alert duration with targeted Slack notifications.
  triggers:
    - type: alert
      filters:
        - key: name
          value: "server-is-down"
  actions:
    - name: send-slack-message-tier-1
      if: "keep.get_firing_time('{{ alert }}', 'minutes') > 15  and not keep.get_firing_time('{{ alert }}', 'minutes') < 30"
      provider:
        type: slack
        config: "{{ providers.slack }}"
        with:
          message: |
            "Tier 1 Alert: {{ alert.name }} - {{ alert.description }}
            Alert details: {{ alert }}"
    - name: send-slack-message-tier-2
      if: "keep.get_firing_time('{{ alert }}', 'minutes') > 30"
      provider:
        type: slack
        config: "{{ providers.slack }}"
        with:
          message: |
            "Tier 2 Alert: {{ alert.name }} - {{ alert.description }}
            Alert details: {{ alert }}"
