# Recipes

> Six complete automations to copy, from a weekly report to a project traffic light with if and else. Each with every setting and the reason it is built that way.

These automations run at Brandt & Söhne, the machine builder from [How automations work](/automations/overview/). Jana Brandt runs the IT and the information security, Tom Keller is the information security officer. The first four are tenant automations under <MenuPath to="Settings > Operations > Automations" />, the last two are Jana's own, under <MenuPath to="My profile > Automations" />.

Names of sources, fields and values come from the server and are in German for now. They are quoted as they appear, with the meaning in brackets.

| Recipe | Trigger | Steps |
|---|---|---|
| [Critical security incident](#critical-security-incident) | <Ui>A record is created</Ui> | notify, task, mail |
| [More than 3 open incidents](#more-than-3-open-incidents) | <Ui>A condition holds</Ui>, count | notify |
| [Weekly report: measures](#weekly-report-measures) | <Ui>On a schedule</Ui> with a source | notify |
| [Project status changes](#project-status-changes) | <Ui>A record is changed</Ui> | if and else |
| [New high risks](#new-high-risks) | <Ui>A condition holds</Ui>, every record | notify |
| [Mondays: open incidents](#mondays-open-incidents) | <Ui>On a schedule</Ui> without a source | notify |

## Critical security incident

Tells the information security officer within seconds when a critical incident is recorded, puts a task on the board and informs the management by mail. [Build your first automation](/automations/first-automation/) builds it step by step.

| Part | Setting |
|---|---|
| When | <Ui>A record is created</Ui> · <Ui>Sicherheitsvorfälle</Ui> (security incidents) |
| Only if | <Ui>Schwere</Ui> (severity) <Ui>is</Ui> <Ui>Kritisch</Ui> (critical) |
| Step 1 | <Ui>Notify</Ui> Tom Keller, <Ui>Bell and e-mail</Ui>. Title `Critical incident: {{record.title}}`, text `Detected on {{record.detectedAt}}. Please assess within one hour: {{record.link}}` |
| Step 2 | <Ui>Run an action</Ui> <Ui>Aufgabe anlegen</Ui> (create task): <Ui>Name</Ui> `Assess incident: {{record.title}}`, <Ui>Board</Ui> `2`, <Ui>Priorität</Ui> `high`, <Ui>Zuständig</Ui> Tom Keller (`3`) |
| Step 3 | <Ui>Send mail</Ui> to `management@example.com`, subject `Critical security incident: {{record.title}}` |

## More than 3 open incidents

Tells Jana and Tom when open incidents pile up, reminds them every week while it lasts, and says so once it is over.

| Part | Setting |
|---|---|
| When | <Ui>A condition holds</Ui> · <Ui>Sicherheitsvorfälle</Ui> |
| What triggers | <Ui>the count reaches a threshold</Ui>, <Ui>When the count is</Ui> <Ui>more than</Ui> 3 |
| Options | <Ui>Also run when it stops holding</Ui> on, <Ui>Repeat every … days</Ui> 7 |
| Condition | <Ui>Status</Ui> <Ui>is one of</Ui> <Ui>Neu</Ui>, <Ui>In Analyse</Ui> (new, in analysis) |
| Step 1 | <Ui>Notify</Ui> Jana (<Ui>Jana Brandt, who it runs as</Ui>) and Tom Keller, <Ui>Bell and e-mail</Ui>. Title `Many open security incidents`, text empty |

**Why the text stays empty.** The steps run in three situations: when the count crosses 3, every 7 days while it stays above, and when it drops back. The standard text says which one it is and how many incidents are open, for example <Ui>Mehr als 3 Datensätze aus „Sicherheitsvorfälle“ treffen zu, gerade sind es 4.</Ui> A text of your own would read the same in all three. If you write one, `{{count}}` gives the current number.

## Weekly report: measures

Every Monday at 08:00, one notification to Jana listing every measure whose review is due within the next two weeks.

| Part | Setting |
|---|---|
| When | <Ui>On a schedule</Ui> · <Ui>Weekly</Ui>, every 1 week on Monday at 08:00 · <Ui>For every record from (optional)</Ui> <Ui>ISMS-Maßnahmen</Ui> (measures) |
| Only if | <Ui>Erste Fälligkeit</Ui> (first due date) <Ui>until</Ui> <Ui>today + 14 days</Ui>, and <Ui>Status</Ui> <Ui>is not</Ui> <Ui>Überholt</Ui> (obsolete) |
| Step 1 | <Ui>Notify</Ui> <Ui>Jana Brandt, who it runs as</Ui>, <Ui>Bell and digest</Ui>. Title `Reviews due in the next two weeks`, text empty |

**Why the date is relative.** <Ui>today + 14 days</Ui> is worked out again on every Monday. A fixed date would have to be changed every week.

**Why the title has no placeholder.** All measures of one Monday arrive in one notification, which lists them by name. It keeps your title only when the title is the same for every measure. With `{{record.title}}` in it, the notification would be titled with the name of the automation and the number of measures instead.

**Why the digest.** The list is not urgent. The bell shows it on Monday morning, and a mail only follows if Jana has not read it after four working hours.

## Project status changes

Reacts to the traffic light of a project. Red: a mail to the project lead and an escalation task. Yellow: a note in the bell. Back to green: nothing.

| Part | Setting |
|---|---|
| When | <Ui>A record is changed</Ui> · <Ui>Projekte</Ui> (projects) · <Ui>Only on changes to</Ui> <Ui>Ampel</Ui> (traffic light) |
| Only if | <Ui>Aktiv</Ui> (active) <Ui>is</Ui> <Ui>yes</Ui> |
| Step 1 | <Ui>If / else</Ui>: <Ui>If the record</Ui> <Ui>Ampel</Ui> <Ui>is</Ui> <Ui>Kritisch</Ui> (red) |
| Step 2, in Then | <Ui>Notify</Ui>, <Ui>Person from the record</Ui> <Ui>Projektleitung</Ui> (project lead), <Ui>Bell and e-mail</Ui>. Title `Project turned red: {{record.title}}`, text `Please add an escalation plan by tomorrow: {{record.link}}` |
| Step 3, in Then | <Ui>Run an action</Ui> <Ui>Aufgabe anlegen</Ui>: <Ui>Name</Ui> `Escalation: {{record.title}}`, <Ui>Board</Ui> `2`, <Ui>Priorität</Ui> `high`, <Ui>Zuständig</Ui> `{{record.projektleitung}}` |
| Step 4, in Else | <Ui>If / else</Ui>: <Ui>If the record</Ui> <Ui>Ampel</Ui> <Ui>is</Ui> <Ui>Gefährdet</Ui> (yellow) |
| Step 5, in its Then | <Ui>Notify</Ui>, <Ui>Person from the record</Ui> <Ui>Projektleitung</Ui>, <Ui>Bell only</Ui>. Title `Project turned yellow: {{record.title}}` |

**Why the field under Only on changes to.** Without it, every edit of a red project, a new description or a changed date, would send another escalation.

**Why `{{record.projektleitung}}` stands alone.** Alone in the field it gives the number of the project lead, which is what <Ui>Zuständig</Ui> needs. Inside a sentence it would give the name. Projects without a project lead get no notification from steps 2 and 5, and the history says <Ui>Niemand, der die Meldung bekommen darf.</Ui>

## New high risks

Jana's own automation: a note in the bell whenever an open risk becomes high, in impact or in likelihood.

| Part | Setting |
|---|---|
| When | <Ui>A condition holds</Ui> · <Ui>ISMS-Risiken</Ui> (risks) · <Ui>every record that starts to match</Ui> |
| Condition | <Ui>Status</Ui> <Ui>is</Ui> <Ui>Offen</Ui> (open), and a group with <Ui>at least one</Ui> of: <Ui>Auswirkung</Ui> (impact) <Ui>at least</Ui> 4, <Ui>Eintrittswahrscheinlichkeit</Ui> (likelihood) <Ui>at least</Ui> 4 |
| Step 1 | <Ui>Notify</Ui> <Ui>me</Ui>, <Ui>Bell only</Ui>. Title and text empty |

**Why a condition and not a change trigger.** A risk can become high in several ways: someone raises the impact, someone raises the likelihood, or a closed risk is opened again. The condition catches all of them, and a risk that stays high does not notify again. Risks that were already high when the automation was saved do not notify at all.

## Mondays: open incidents

Jana's own reminder at the start of the week, without looking at any data.

| Part | Setting |
|---|---|
| When | <Ui>On a schedule</Ui> · <Ui>Weekly</Ui>, every 1 week on Monday at 08:00 · <Ui>For every record from (optional)</Ui> <Ui>none, once per date</Ui> |
| Step 1 | <Ui>Notify</Ui> <Ui>me</Ui>, <Ui>Bell only</Ui>. Title `Start of the week: review open security incidents` |

**Why no source.** The reminder is the same every week, whatever the data says. To be told only when there is something to do, combine the two ideas: the source <Ui>Sicherheitsvorfälle</Ui> with the condition "status is one of new, in analysis". Then the Monday notification lists the open incidents, and there is no notification on a Monday without any.

## Next steps

<CardGrid>
  <LinkCard title="Build your first automation" href="/automations/first-automation/" description="The first recipe, step by step." />
  <LinkCard title="Steps and placeholders" href="/automations/steps/" description="Every step and placeholder in detail." />
</CardGrid>