# Routines for testing

> Pre-built and custom routines available in Delegate for testing workflows, letting you replay or schedule recurring test sequences.

The **Test Cloud** plugin ships 1 pre-built routine, accessible directly from the **Delegate** sidebar under the **Routines** panel.

Routines capture an entire sequence of steps, decisions, and integrations so they can be replayed on demand or scheduled to run automatically at defined intervals, enabling continuous testing without manual intervention.

## Summarize nightly execution

**Goal**

Summarize the most recent overnight run of a test set: pass rate, top failing test cases, new failures compared to the prior run, and flaky test cases.

**Key workflow steps**

* Identifies last night's execution of the specified test set, filtered by the user's local time zone.
* Computes pass rate using execution statistics.
* Ranks failing test cases by failed-assertion count.
* Diffs against the previous execution to surface new failures.
* Detects flaky test cases by analyzing pass/fail flips across the last 3–5 executions.
* Offers to email or share the summary on completion.

**Sample prompt**

*Summarize last night's execution of [TESTSET NAME] in project [PROJECT NAME].*

:::note
For a worked example of this routine end-to-end, see [Summarizing nightly executions](summarizing-nightly-executions-use-case.md).
:::

## Creating your own routine

Any successful sequence of steps performed with **Delegate** — a manual test execution, a failure-analysis workflow, an environment setup/teardown pair — can be saved as a reusable routine and scheduled to run on specific dates or within an interval.

Ask **Delegate** to turn the sequence into a routine once it has completed successfully.
