# Workflows

A Workflow represents a predefined series of actions initiated by specific conditions. These Workflows are instrumental in automating responses to various incidents. For example, you can establish a Workflow for addressing P1/P2 incidents and another for managing security incidents.

{% @storylane/embed subdomain="app" url="<https://app.storylane.io/share/fjsma7cptada>" linkValue="fjsma7cptada" %}

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark> This feature will be available in the [<mark style="color:blue;">Premium and Enterprise plans only</mark>](https://www.squadcast.com/pricing).
{% endhint %}

## Workflow Components

A Workflow comprises two fundamental components: Triggers and Actions. By tailoring these triggers and actions to your specific requirements, you can tailor a Workflow to suit your unique use case.

### Triggers

Triggers are events that dictate when actions should be executed. You can add multiple trigger conditions within each Workflow.

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark> In the case of multiple trigger conditions, all the conditions should be met in order to execute the actions.
{% endhint %}

**Here is a list of supported triggers:**

* When an Incident is Triggered
* When Incident is Acknowledged
* When Incident is Reassigned
* When the Incident is Resolved
* When Incident Tags are updated
* When Incident Priority is updated
* When Incident Note is added

### **Trigger Properties/Filters**

For each of the triggers, here are the available filters and their conditions:

* **Service** - is/is-not/contains/does not contain
* **Alert Source** - is/is-not/contains/does not contain
* **Tags** - is/is-not
* **Priority** - is/is-not

To emphasize once more, it's essential for all conditions to be satisfied for the actions to be executed.

### Actions

Each Workflow includes a predefined sequence of actions that determine the progression of the Workflow. These actions may involve tasks such as attaching Runbook(s) or marking an incident as SLO-affecting.

**Here is a list of the supported Squadcast actions:**

* [<mark style="color:blue;">**Attach Runbook(s)**</mark>](https://support.squadcast.com/actions#attach-runbook-s)
* [<mark style="color:blue;">**Add Communication Channel**</mark>](https://support.squadcast.com/actions#add-communication-channel)
* [<mark style="color:blue;">**Add Incident Note**</mark>](https://support.squadcast.com/actions#add-incident-note)
* [<mark style="color:blue;">**Mark Incident as SLO affecting**</mark>](https://support.squadcast.com/actions#mark-incident-as-slo-affecting)
* [<mark style="color:blue;">**Make an HTTP call**</mark>](https://support.squadcast.com/actions#make-an-http-call)
* [<mark style="color:blue;">**Send an Email**</mark>](https://support.squadcast.com/actions#send-an-email)
* [<mark style="color:blue;">**Trigger Manual Webhook**</mark>](https://support.squadcast.com/actions#trigger-manual-webhook)
* [<mark style="color:blue;">**Update Priority**</mark>](https://support.squadcast.com/actions#update-priority)
* <mark style="color:blue;">**Add**</mark>[ <mark style="color:blue;">**Status Page**</mark>](https://support.squadcast.com/actions#add-status-page-issue) <mark style="color:blue;">**Issue**</mark>

**Here is a list of the supported Slack actions:**

* [<mark style="color:blue;">**Create Incident-Specific Slack Channel**</mark>](https://support.squadcast.com/actions#create-incident-specific-slack-channel)
* [<mark style="color:blue;">**Archive Incident-Specific Slack Channel**</mark>](https://support.squadcast.com/actions#archive-incident-specific-slack-channel)
* [<mark style="color:blue;">**Send a Message to a Specific Slack Channel**</mark>](https://support.squadcast.com/actions#send-a-message-to-a-specific-slack-channel)
* [<mark style="color:blue;">**Send a Direct Message to a Slack User**</mark>](https://support.squadcast.com/actions#send-a-direct-message-to-a-slack-user)

**Here is a list of the supported Jira actions:**

* [<mark style="color:blue;">**Create a Jira Ticket**</mark>](https://support.squadcast.com/actions#create-a-jira-ticket)

**Here is a list of the supported MS Teams actions:**

* [<mark style="color:blue;">**Send a message to a Microsoft Teams Channel**</mark>](https://support.squadcast.com/actions#send-a-message-to-a-microsoft-teams-channel)

{% hint style="warning" %} <mark style="color:orange;">**Important:**</mark> When selecting the "Mark Incident as SLO Affecting" action, please ensure that you choose an active SLO that is associated with the same service as your incident.
{% endhint %}

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark>

* Each action will be executed serially, and all actions executed by a Workflow will be recorded in the Incident timeline.
* A Workflow will continue to run irrespective of the success/failure of a specific action.
  {% endhint %}

## Prerequisite

* To effectively create and manage Workflows, the user assigned to the Team must possess the appropriate permissions corresponding to their User Role.

## Add Workflows

To create a new workflow using the web app,

1. Navigate to the **Workflows page** -> **Create Workflow.**
2. Enter the **Title**, *optional* **Description**, **Workflow Owner**, and **Tags**.

<div><figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-cb330e43a7ad702c5a8fe1cbf85d540c87530dca%2FScreenshot%202023-11-08%20at%2011.55.41%20AM.png?alt=media" alt=""><figcaption><p>Image. Create Workflow</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-de39820bdee8d5a1bfd8c1d6cb5a1e428787cf1c%2FScreenshot%202023-11-08%20at%2011.55.56%20AM.png?alt=media" alt=""><figcaption><p>Image. Add Details on Title, Description, Owner, and Tags</p></figcaption></figure></div>

{% hint style="info" %} <mark style="color:blue;">**How to Pick an Owner?**</mark>

A Workflow Owner is the designated contact for clarifications, adjustments, or removal of a Workflow. By default, the Team is assigned as the owner, but you can modify it using the drop-down menu.\
\ <mark style="color:blue;">**How to use Tags?**</mark>

Choose tags to organize, classify, and add context to your Workflows. For instance, adding tags like Environment, Cluster/Team name, and Priority can help structure and add more context to your Workflows.
{% endhint %}

3. Next, select the **Trigger** and its **filters**:

   1. You can select between the following triggers:
      1. **When incident is Triggered**
      2. **When incident is Acknowledged**
      3. **When incident is Reassigned**
      4. **When incident is Resolved**
      5. When Incident Tags are updated
      6. When Incident Priority is updated
      7. When Incident Note is added
   2. For each of the trigger events, here are the available **filters** and their **conditions**:
      1. **Service** - is/is-not/contains/does not contain
      2. **Alert Source** - is/is-not/contains/does not contain
      3. **Tags** - is/is-not
      4. **Priority** - is/is-not

   You can add a group of Triggers which all must hold true to set off the actions. Additionally, you can add a collection of filters using OR/AND conditions to consolidate their effects.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e52e95ba99c8f4e33a69267e8b9110e71ed7de76%2FScreenshot%202023-11-08%20at%2011.58.12%20AM.png?alt=media" alt="" width="563"><figcaption><p>Image. Define Tigger and its Filters</p></figcaption></figure>

4. Next, select the **Actions** you want the Workflow to execute. These actions will execute one after the other.
   1. You can select between the following Squadcast actions:
      1. [<mark style="color:blue;">**Attach Runbook(s)**</mark>](https://support.squadcast.com/actions#attach-runbook-s)
      2. [<mark style="color:blue;">**Add Communication Channel**</mark>](https://support.squadcast.com/actions#add-communication-channel)
      3. [<mark style="color:blue;">**Add Incident Note**</mark>](https://support.squadcast.com/actions#add-incident-note)
      4. [<mark style="color:blue;">**Mark Incident as SLO affecting**</mark>](https://support.squadcast.com/actions#mark-incident-as-slo-affecting)
      5. [<mark style="color:blue;">**Make an HTTP call**</mark>](https://support.squadcast.com/actions#make-an-http-call)
      6. [<mark style="color:blue;">**Send an Email**</mark>](https://support.squadcast.com/actions#send-an-email)
      7. [<mark style="color:blue;">**Trigger Manual Webhook**</mark>](https://support.squadcast.com/actions#trigger-manual-webhook)
      8. [<mark style="color:blue;">**Update Priority**</mark>](https://support.squadcast.com/actions#update-priority)
      9. <mark style="color:blue;">**Add**</mark>[ <mark style="color:blue;">**Status Page**</mark>](https://support.squadcast.com/actions#add-status-page-issue) <mark style="color:blue;">**Issue**</mark>
   2. Or, you can select between the following Slack actions:
      1. [<mark style="color:blue;">**Create Incident-Specific Slack Channel**</mark>](https://support.squadcast.com/actions#create-incident-specific-slack-channel)
      2. [<mark style="color:blue;">**Archive Incident-Specific Slack Channel**</mark>](https://support.squadcast.com/actions#archive-incident-specific-slack-channel)
      3. [<mark style="color:blue;">**Send a Message to a Specific Slack Channel**</mark>](https://support.squadcast.com/actions#send-a-message-to-a-specific-slack-channel)
      4. [<mark style="color:blue;">**Send a Direct Message to a Slack User**</mark>](https://support.squadcast.com/actions#send-a-direct-message-to-a-slack-user)
   3. Or, you can select between the following Jira actions:
      * [<mark style="color:blue;">**Create a Jira Ticket**</mark>](https://support.squadcast.com/actions#create-a-jira-ticket)
   4. Or, you can select between the following MS Teams actions:
      * [<mark style="color:blue;">**Send a message to a Microsoft Teams Channel**</mark>](https://support.squadcast.com/actions#send-a-message-to-a-microsoft-teams-channel)

<div><figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-133326481c1fe1a5f3e15741c6c4c8422c71a424%2FScreenshot%202023-11-08%20at%2011.58.51%20AM.png?alt=media" alt=""><figcaption><p>Image. Define Actions</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-5dd8bc9c1449d2d7dfd678171d209014afa5ae0f%2FScreenshot%202023-11-08%20at%2011.59.06%20AM.png?alt=media" alt=""><figcaption><p>Image. Add Details for Sequence of Actions</p></figcaption></figure></div>

{% hint style="warning" %} <mark style="color:orange;">**Important:**</mark> When selecting the "Mark Incident as SLO Affecting" action, please ensure that you choose an active SLO that is associated with the same service as your incident.
{% endhint %}

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark>

* Each action will be executed serially, and all actions executed by workflows will be recorded in the Incident timeline.
* The workflow will continue to run irrespective of the success/failure of a specific action.
  {% endhint %}

5\. Once all details have been added, click **Done**.

After creating the Workflow, you will be automatically directed to the details page of the newly created Workflow. Here, you can access more information and logs related to this Workflow.

Additionally, you have the option to edit, update, or delete the Workflow directly from this details page.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-646a31dc9902e50cfc4e1befee6df8278f1d0f6e%2FScreenshot%202023-11-08%20at%2012.20.43%20PM.png?alt=media" alt="" width="563"><figcaption><p>Image. Workflow Details Page</p></figcaption></figure>

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark> Please note that you have access to the execution logs (audit logs) for the Workflow from the last 30 days.
{% endhint %}

## Edit Workflows

To edit a workflow,

1. Navigate to the **Workflows** page -> Click on the Workflow you want to edit, and you'll be directed to its details page.
2. From the three-dot menu, select **Edit**. -> The Workflows form, containing all the entered details, will appear. Once you've made the necessary updates, click **Close**.

<div><figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a72d8eb61450a070997abd696aa189dc9bda78b0%2FScreenshot%202023-11-08%20at%2011.41.19%20AM.png?alt=media" alt=""><figcaption><p>Image. Select Workflow</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a152bfe0d34dfb13ba663712102b395b774fda3d%2FScreenshot%202023-11-08%20at%2011.52.52%20AM.png?alt=media" alt=""><figcaption><p>Image. Edit Workflow</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a72817f2d3ed521b73596c6824b04c685950c35a%2FScreenshot%202023-11-08%20at%2011.53.04%20AM.png?alt=media" alt=""><figcaption><p>Image. Update Workflow Details</p></figcaption></figure></div>

{% hint style="info" %} <mark style="color:blue;">**Note:**</mark> The changes you make to the Workflow will be auto-saved.
{% endhint %}

## Delete Workflows

To delete a workflow,

1. Navigate to the **Workflows** page -> Click on the Workflow you want to remove, and you'll be directed to its details page.
2. From the three-dot menu, select **Delete** -> A confirmation modal will appear, click on **Delete** again to confirm.

Alternatively, you have the option to delete the Workflow directly from the listing page.

<div><figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a72d8eb61450a070997abd696aa189dc9bda78b0%2FScreenshot%202023-11-08%20at%2011.41.19%20AM.png?alt=media" alt=""><figcaption><p>Image. Select Workflow</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-338c8c187c8936b69ee1a1f1c21289d9b27da4bd%2FScreenshot%202023-11-08%20at%2011.49.11%20AM.png?alt=media" alt=""><figcaption><p>Image. Delete Workflow</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-6bc418bdb56da442976424795bd1860fa2e3e2b8%2FScreenshot%202023-11-08%20at%2011.50.09%20AM.png?alt=media" alt=""><figcaption><p>Image. Confirm Deletion</p></figcaption></figure></div>

## Logs

Show the logs of the workflows that have been executed and all of their corresponding details.

<table><thead><tr><th width="192">Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Execution Date &#x26; Time</strong></td><td>Displays the date and time when the workflow was executed.</td></tr><tr><td><strong>Log ID</strong></td><td>Displays the log id of the executed workflow.</td></tr><tr><td><strong>Status</strong></td><td>Displays where it was executed successfully or not.</td></tr><tr><td><strong>Incident</strong></td><td>Displays the incident that triggered the workflow.</td></tr><tr><td><strong>Actions Executed</strong></td><td>Displays the no. of actions executed under it.</td></tr></tbody></table>

To view further details about the executed actions,

1. Within the **Workflows** details page, navigate to the **Logs** section.
2. On hover, click on **View Log Detail** -> Here you can find the list of actions executed as part of the Workflow along with their individual timestamp.

<div><figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-1e3f0989dc8a0b146c460e61f358836516b403fc%2FScreenshot%202023-11-22%20at%201.57.21%20PM.png?alt=media" alt=""><figcaption><p>Image. View Logs</p></figcaption></figure> <figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-aaf6f7f933cce475900b68386922c909c15208ee%2FScreenshot%202023-11-22%20at%201.57.29%20PM.png?alt=media" alt=""><figcaption><p>Image. View Log Details</p></figcaption></figure></div>

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
