> ## Documentation Index
> Fetch the complete documentation index at: https://docs.casebender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows

> Create and manage automated workflows to streamline your case management processes in CaseBender.

## Overview

The Workflow Settings section allows you to create automated workflows that execute actions based on specific triggers in your CaseBender instance. This guide will walk you through the process of setting up and configuring workflows.

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/1-dashboard--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=51adf819fa393ea40c4d9a3f9c471688" alt="Workflow Dashboard Light" width="2866" height="1722" data-path="images/settings/workflows/1-dashboard--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/1-dashboard--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=e685a6ed853f81ad4fc48c13ebe59a54" alt="Workflow Dashboard Dark" width="2866" height="1722" data-path="images/settings/workflows/1-dashboard--dark.png" />

## Creating a New Workflow

### Step 1: Basic Configuration

Start by clicking the "Create" button and filling out the basic workflow information:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/2-create-form--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=4b25518b917d6ced7149fad0fccd1725" alt="Create Workflow Form Light" width="2866" height="1722" data-path="images/settings/workflows/2-create-form--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/2-create-form--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=f6f819067a3ee4c2fca507797e11af5e" alt="Create Workflow Form Dark" width="2866" height="1722" data-path="images/settings/workflows/2-create-form--dark.png" />

### Step 2: Workflow Details

Configure the detailed settings for your workflow:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/3-create-form-full--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=b45b031dd51c5673a69e9111619d5079" alt="Workflow Details Form Light" width="2866" height="1722" data-path="images/settings/workflows/3-create-form-full--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/3-create-form-full--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=6a30c43e7daecb296c5654b5c6e3ee81" alt="Workflow Details Form Dark" width="2866" height="1722" data-path="images/settings/workflows/3-create-form-full--dark.png" />

Fill out the required information such as:

* Workflow name
* Description
* Priority level
* Execution settings

### Step 3: Organization Settings

Specify which organizations can access and use this workflow:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/4-create-form-org--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=26254b94ffb207bec9d257f0c8dd04a1" alt="Organization Settings Light" width="2866" height="1722" data-path="images/settings/workflows/4-create-form-org--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/4-create-form-org--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=bb624fbdd956d4d8ece1ee3a7dcde302" alt="Organization Settings Dark" width="2866" height="1722" data-path="images/settings/workflows/4-create-form-org--dark.png" />

* Select applicable organizations
* Configure organization-specific settings
* Set access permissions

## Configuring Workflow Logic

### Step 1: Select Trigger

Choose the event that will initiate your workflow:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/5-select-trigger--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=b2312a72c1184d80b8d2706014a71fab" alt="Select Trigger Light" width="2866" height="1722" data-path="images/settings/workflows/5-select-trigger--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/5-select-trigger--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=858f5ba2474b1ff8d2281a32deae38df" alt="Select Trigger Dark" width="2866" height="1722" data-path="images/settings/workflows/5-select-trigger--dark.png" />

Available triggers may include:

* Case creation or updates
* Task assignments
* Status changes
* Custom events

### Step 2: Add Actions

Click the plus button on flow edges to add actions to your workflow:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/6-add-action--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=fbc9dd33e303661bf8bd7a9143b0072a" alt="Add Action Modal Light" width="2866" height="1722" data-path="images/settings/workflows/6-add-action--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/6-add-action--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=26773ac5f95ede5feec6df3005482fe1" alt="Add Action Modal Dark" width="2866" height="1722" data-path="images/settings/workflows/6-add-action--dark.png" />

### Step 3: Configure Action

Select and configure each action in your workflow:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/7-action-form--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=483f926b61a0f62a58321c97bdc0f045" alt="Action Configuration Light" width="2866" height="1722" data-path="images/settings/workflows/7-action-form--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/7-action-form--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=ee08396941d2a9685edd18865d818bd4" alt="Action Configuration Dark" width="2866" height="1722" data-path="images/settings/workflows/7-action-form--dark.png" />

### Step 4: Action Details

Provide detailed configuration for each action:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/8-action-form-full--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=3986558b63938a40ccc15e9e26fe6627" alt="Action Details Light" width="2866" height="1722" data-path="images/settings/workflows/8-action-form-full--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/8-action-form-full--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=8e8a0d49d0dd4dbfcc792ab126b2456f" alt="Action Details Dark" width="2866" height="1722" data-path="images/settings/workflows/8-action-form-full--dark.png" />

Configure settings such as:

* Action type specific parameters
* Conditional logic
* Input/output mapping
* Error handling

## Update Trigger Safety

Workflows triggered by case or alert updates include safeguards that prevent an
action from repeatedly triggering the same workflow:

* Updates that only change the internal `updatedAt` timestamp do not emit a new
  workflow event.
* Assignment, status, severity, title, description, PAP, and case type actions
  skip writes when the requested value is already present.
* A duplicate source event is processed only once.
* An update event is suppressed while the same workflow is already executing
  for that case or alert.
* A per-entity circuit breaker suppresses excessive repeated executions.

Suppressed runs are retained in workflow execution history with a `suppressed`
status and loop-guard details. This provides an audit trail without executing
the workflow actions again.

### Circuit Breaker Configuration

The workflow processor uses safe defaults that can be adjusted with environment
variables:

* `WORKFLOW_LOOP_MAX_EXECUTIONS` — maximum executions for one workflow and
  entity within the configured window. Default: `10`.
* `WORKFLOW_LOOP_WINDOW_MS` — circuit-breaker window in milliseconds. Default:
  `60000`.
* `WORKFLOW_LOOP_ACTIVE_WINDOW_MS` — how long an unfinished execution is
  considered active for recursive-event suppression. Default: `900000`.

<Warning>
  Increasing these limits can allow a misconfigured update workflow to perform
  repeated side effects. Test changes in a non-production environment and
  monitor execution history after activation.
</Warning>

### Step 5: Review Workflow

Review your complete workflow with all configured actions:

<img className="block dark:hidden h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/9-workflow--light.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=68bfa5eb548b2365bcde22b57e55ec36" alt="Complete Workflow Light" width="2866" height="1722" data-path="images/settings/workflows/9-workflow--light.png" />

<img className="hidden dark:block h-96 object-cover w-full rounded-lg" src="https://mintcdn.com/casebender/kzW53TJunB3_tHaF/images/settings/workflows/9-workflow--dark.png?fit=max&auto=format&n=kzW53TJunB3_tHaF&q=85&s=ca4feb6baa9b5af915dc3ea023529fd6" alt="Complete Workflow Dark" width="2866" height="1722" data-path="images/settings/workflows/9-workflow--dark.png" />

## Best Practices

### Workflow Design

* Keep workflows focused and specific
* Use clear, descriptive names
* Document the purpose and expected outcomes
* Test workflows thoroughly before activation
* Avoid pairs of workflows that repeatedly reverse each other's changes
* Use conditions that describe the intended transition, not only the current state

### Performance Considerations

* Optimize action sequences
* Consider execution time and resources
* Monitor workflow performance
* Handle errors appropriately
* Investigate repeated `suppressed` executions before increasing safety limits

### Maintenance

* Regularly review and update workflows
* Monitor execution logs
* Keep documentation current
* Validate triggers and actions periodically
