# Workflow engine

All entities in the system have workflow / lifecycle model attached to them. In addition all records will have a status field, indicating the records place in its workflow. Each step in a workflow is called a status, and influences how records behave in that step (status).

- What new status can be assigned from here
- What automated actions should be carried out (see below)
- What permissions do the users have in this step
- What fields should be shown or hidden
- What are the time constraints on this part of the process

## <span class="mw-headline" id="bkmrk-automated-actions-1">Automated actions</span>

Entering, leaving or staying in a certain status can trigger certain actions in the system.

Trigger summary

- Enter
- Leave
- Timed

Timed actions are defined as an amount of time, relative to some date fields.

> Send an email 1 day before the date defined in the BIRTHDAY field
> 
> Execute code 7 days after this status was reached

Actions include

- Notifications
- Task creation
- Code execution (this can do anything)
- Change status
- Export data
- Delete data (GDPR compliance)

Learn more about [Status action configuration](https://docs.tsnocode.com/books/features/page/status-action "Status actions")

## <span id="bkmrk-"></span><span class="mw-headline" id="bkmrk-performance-measures-1">Performance measures (LEAN)</span>

For each record in the system it is possible to measure the time spent in a status.

This can be compared to performance targets on

- The whole flow
- A single status

The targets consists of two values

- Goal
- Tolerance

> After submitting a ticket, the service desk should optimally respond within 4 hours (goal). We can however accept if it takes 24 hours (tolerance).

We can now easily mark up records depending on their time usage

- Green: Better than goal
- Yellow: Better than tolerance, worse than goal
- Red: Worse than tolerance

This can be visualized on each record using Gauge fields, or in aggregated form via a list report.

### <span class="mw-headline" id="bkmrk-instructions-1">Instructions</span>

Setting up measures

- Entity &gt; Advanced 
    - Set checkmark in
    - Define goal and tolerance
- For each Entity &gt; Status 
    - Define goal and tolerance
    - If the status is the last part of a measured workflow check Final

Adding Gauges to an entity

- Visual extra: Visual: Target gauge Step
- Visual extra: Visual: Target gauge Total