> 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/scheduled-workflows.md).

# Scheduled workflows

Most security and IT departments follow recurring routines of periodic cleanup and scheduled tasks as part of their ongoing work and compliance obligations to maintain minimal attack surface. The smaller the attack surface, the easier it is to protect an organization’s data from over-exposure or exfiltration.&#x20;

Scheduled workflows allow customers to schedule recurring tasks to run automatically, instead of running these tasks manually, one at a time, via the DoControl platform.

{% hint style="info" %}

* Scheduled workflows is a beta feature that will be opened by request only. Please contact your Customer Success manager.
* As this is an advanced capability, scheduled workflows might require technical support to implement.&#x20;
  {% endhint %}

## Use cases

The first stage of scheduled workflows supports scheduling of workflows that do not contain remediation or query steps. Examples of use cases include scheduling a DoControl API step or HTTP request to trigger other remediation or query scan actions.

You can leverage the DoControl API step in scheduled workflows to support these use cases:

* Every day at the same hour, trigger an external sharing remediation workflow based on inventory filters. Daily scheduled workflows allow you to detect and respond to issues faster, without relying on manual execution.
* On the 1st day of each month, remediate access to files that were not viewed in the last 13 months.
* Remediate personal email access of deactivated users on the 15th day of every month.
* Run a Google external sharing assessment on the 1st day of every month and send me the report.

## Implement a scheduled workflow

1. Select **New workflow > Scheduled**.<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%2FmimKPbRjVqeQyHfyaRzu%2Fnew%20scheduled%20workflow.png?alt=media&amp;token=9b603b75-bac9-41e3-87f1-c85a858631eb" alt=""><figcaption></figcaption></figure></div>

2. Enter a name for your workflow.

3. Configure the recurrence for how often this workflow will trigger: every day, week, month or year:

   * **Every day -** Select an exact time (hh:mm)
   * **Every week** - Select one day of the week (Monday to Sunday)
   * **Every month -** Select a date (1-28 or end of month)&#x20;
   * **Every year** - Select the 1st day of a month (January to December)
   * **Select time zone** - The user’s browser is the default time zone <br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FxszPkV5F9FKrm3wFUcvP%2Fscheduled%20trigger%20date.png?alt=media&amp;token=c635f1db-aedc-4f66-ab7b-cc29c03969c6" alt=""><figcaption><p>In this scheduled trigger, the workflow will run on 1st day of every month at 8.00am (GMT +3)</p></figcaption></figure>

4. Add your workflow logic.

5. Connect a **Notify by email** step to let the admin know that the scheduled cleanup process has been initiated.

6. Connect a **DoControl API** action step to define the inventory filters in the API.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FdQfK5FfeynEQy3QSQ2fc%2FSW%20trigger3.png?alt=media&amp;token=a1faf2a7-ef05-4567-95f8-a7ed0aca86fc" alt=""><figcaption></figcaption></figure>

7. Collect the inventory filters saved inside a view to send to the remediation step using the `getViews` API and the `created view ID`.

8. Connect a **DoControl API** action step to trigger an inventory action.

9. In order to leverage remediation or query steps, create a second workflow that triggers an inventory action.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FedEED9aLuqlT06XYILhS%2FSW%20trigger2.png?alt=media&amp;token=bb3506ce-055e-4ccb-bdea-38b6c18369d4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note these limitations when creating scheduled workflows:

* The scheduled workflow type cannot be changed after it is created.
* Scheduled workflows currently do not support remediation or query action steps. In order to leverage remediation or query steps, use a **DoControl API** step to trigger another inventory action workflow.
* Scheduled workflows are counted in the monthly execution quota.
  {% endhint %}

## Filter scheduled workflows

In the Workflow list, you can filter for scheduled workflows.

1. In the workflow type filter, select **Scheduled**.<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%2FCdQd2iMZ9Vz7bgoecog1%2Fworkflow%20type%20filters.png?alt=media&amp;token=7acc3755-f801-4875-88a5-c52a973155e6" alt="" width="228"><figcaption></figcaption></figure></div>
2. All scheduled workflows are displayed in the workflow list with the Scheduled icon.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2F7ofHHCJ0BEV02vJ3QRc8%2Fworkflow%20list%20schedule.png?alt=media&amp;token=bd2d3d57-cca3-4948-ac31-7104c8875f21" 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/scheduled-workflows.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.
