> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/workflows/create-a-workflow.md).

# Create a workflow

Automated workflows help to monitor, control and remediate data access across your SaaS applications. In DoControl's drag-and-drop canvas, you can create these types of workflows:

<table><thead><tr><th width="238">Workflow type</th><th>Description</th></tr></thead><tbody><tr><td><a href="#playbooks">Playbook</a></td><td>Create a workflow from a predefined template</td></tr><tr><td><a href="#event-based-workflow">Event-based</a></td><td>Create a workflow that's triggered by a single event in a specific SaaS app</td></tr><tr><td><a href="/docontrol-user-guide/workflows/scheduled-workflows.md">Scheduled</a></td><td>Create a workflow that's triggered by a future date. <br>Note that scheduled workflows is a beta feature available by customer request. </td></tr><tr><td><a href="#aggregated-workflow">Aggregated</a></td><td>Create a workflow that's triggered by multiple events for the same actor occurring within a 30-second timeframe</td></tr><tr><td><a href="#import-workflow">Import</a></td><td>Import an existing workflow as a JSON file</td></tr></tbody></table>

{% hint style="info" %}

* You can create and maintain up to 100 workflows at a given time.
* You can add up to 40 action steps to a workflow.
  {% endhint %}

#### To create a new workflow:

1. Click **Workflows** in the left navigation bar.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FrjKLSvV8VDJgs2kslpd8%2Fnew%20workflow%20modal.png?alt=media&amp;token=7bc61f07-3163-44d7-9859-836ae69c0ec9" alt="" width="563"><figcaption></figcaption></figure></div>
2. Create a new workflow in one of these ways:
   * Click the **Playbooks** button to choose a predefined playbook, OR
   * Click the **New workflow** button, select one of these workflow types, and click **Create workflow**:
     * Event-based&#x20;
     * Aggregated&#x20;
     * Scheduled
   * OR click the **Import** <img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FXiUb5i1bPbl6TQXNod7F%2Fimport%20workflow%20icon.png?alt=media&amp;token=2066c045-d28f-4ba1-aec6-42ed1c2b79df" alt="" data-size="line"> button to import a workflow as a JSON file.

## Playbooks

Playbooks are predefined workflows for use cases based on well known threat models. Playbooks are set with specific event fields, but they can be customized. Some playbooks are ready to be used, others require the user to enter some values.&#x20;

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FPh6fXrVBbYdZU0G691sD%2Fplaybooks.png?alt=media&amp;token=f19bf2bf-6b82-47ea-8e97-481e2b387649" alt=""><figcaption><p>Use any workflow from a set a predefined playbooks</p></figcaption></figure>

#### To create a workflow from a playbook:

1. Go to **Workflows** > **Playbooks**. The predefined playbooks are displayed according to threat model category. Click **Show more** to see more playbooks in each category.&#x20;

2. You can filter playbooks by:

   * **App** - SaaS apps that are integrated with DoControl.&#x20;
   * **Category** - [Threat model use cases](/docontrol-user-guide/risk-management/threat-model-coverage.md), such as encryption key sharing, external collaborator sharing, and public sharing.
   * **Type** - Characteristic of playbook: alert-related, aggregated, or inventory action.

3. Select a playbook. The workflow appears with the trigger and actions partially defined.

4. Select the workflow mode: active or inactive.

5. Click **Save workflow**. The workflow now appears in the Workflow list.

{% hint style="info" %}

* Playbooks with an **Inventory action** tag are used to support on-demand remediation actions (such as, Remove public sharing, and Remove collaborator).&#x20;
* For more information on editing workflows, see [trigger settings](/docontrol-user-guide/workflows/define-workflow-settings/trigger-settings.md) and [action settings](/docontrol-user-guide/workflows/define-workflow-settings/action-settings.md).
  {% endhint %}

## Event-based workflow

An event-based workflow is triggered by a single event in a specific SaaS app.

1. Click **Workflows** in the left navigation bar.&#x20;
2. Click **New workflow** > **Event-based**.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FQFbkxBbri5gzA4As1tEb%2Fevent-based%20WF.png?alt=media&amp;token=821c109c-bf6d-46a1-a1e4-824c85a68323" alt=""><figcaption></figcaption></figure></div>
3. Enter a name for the workflow.
4. Click **Create workflow**.
5. Select the workflow mode: active or inactive.
6. Define the [trigger settings](/docontrol-user-guide/workflows/define-workflow-settings/trigger-settings.md).&#x20;
7. Define the [action settings](/docontrol-user-guide/workflows/define-workflow-settings/action-settings.md).
8. Click **Save workflow**.  The workflow now appears in the Workflow list. &#x20;

## Aggregated workflow

An aggregated workflow is triggered by multiple events for the same actor that occur within a 30-second timeframe. DoControl processes these multiple events in a single workflow execution.

You can leverage aggregated workflows when a single user action produces multiple event triggers. For example:

* When sharing a folder in Google Drive, multiple events are usually triggered for sharing each of the files in the folder. An aggregated workflow consolidates all those file shares into a single event, with one DoControl notification.
* If a user shares 100 files, an event is usually triggered for each file share. An aggregated workflow consolidates all those events into a single event, with one DoControl notification.

{% hint style="warning" %}

* Aggregated workflows can be executed for all events of a specific actor in a 30-second timeframe for up to 5000 events.
* If there are more than 5000 events, a separate execution will be run with the same rules.
* The execution log is available after the 30-second period.
  {% endhint %}

{% hint style="info" %}
When the event aggregation is enabled, although the triggering event is triggered once, other actions in the workflow referring to the event produce multiple executions for each of the aggregated events. For example, the **Remove public sharing** remediation action produces executions for each of the files in the folder.&#x20;
{% endhint %}

#### To create a workflow with event aggregation:

1. Click **Workflows** in the left navigation bar.&#x20;
2. Click **New workflow** > **Aggregated.**<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FiVN5QU7xdKbdUsd0xwWr%2Fnew%20aggreg%20WF.png?alt=media&amp;token=ef1d3bf7-3ccc-495a-93db-74cae4bcdfb4" alt=""><figcaption></figcaption></figure></div>
3. Enter a name for the workflow.
4. Click **Create workflow**.
5. Select the workflow mode: active or inactive.
6. Define the [trigger settings](/docontrol-user-guide/workflows/define-workflow-settings/trigger-settings.md).&#x20;
7. Define the [action settings](/docontrol-user-guide/workflows/define-workflow-settings/action-settings.md).
8. Click **Save workflow**. The workflow now appears in the Workflow list. &#x20;

{% hint style="info" %}

* For this workflow type, **Event aggregation enabled** is highlighted at the top of the workflow canvas. The event aggregation label also appears next to the workflow in the Workflows list.&#x20;
* You cannot change an event-aggregated workflow to a non-aggregated workflow.
  {% endhint %}

## Import workflow

DoControl allows you to import workflows so you can:

* Receive customized workflows, created exclusively per customer request.
* Get assistance in creating workflows.
* Share workflows across different community platforms (for example, GitHub).

{% hint style="info" %}
You can import multiple workflows in one instance. The files must be in JSON format.
{% endhint %}

#### To import workflows:

1. Click **Workflows** in the left navigation bar.&#x20;
2. Click the **Import workflow** <img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FDCD2WdVqQl8mFamIjAAS%2Fimport%20workflow%20icon.png?alt=media&amp;token=5473ad51-98df-4300-be41-8763295a25f7" alt="" data-size="line"> icon.
3. Click the **Plus**![](https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FK0ncZjipARsUpRD6bFVT%2Fimage.png?alt=media\&token=84249afd-6933-41c7-b9e4-85ca1d78fa4e)icon and add the files, or drag the JSON files to the gray area.
4. Click **Import**. The imported workflows appear in the Workflow list.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2F3OePzJgR9eCOgrfDh58l%2Fimport%20workflow.png?alt=media&amp;token=164f20c3-fd79-4c74-8441-95759adce025" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/workflows/create-a-workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
