> Source: https://docs.cyberelements.io/bastion/4.7/Usage/Reference/AdminConsole/Workflows/

# Workflows

The **Workflow** module handles access to **restricted applications**. An application marked as restricted in its [access contract](https://docs.cyberelements.io/bastion/4.7/Usage/Reference/AdminConsole/AccessContracts/) is not launched directly by the user: the user must first send a **request** from the portal. The administrator accepts or refuses this request from this module, which produces a **workflow** attached to the user/application pair with optional time-based restrictions.

The module is organised in three tabs:

- **Workflow**: existing workflows (already granted accesses).
- **Users' requests**: requests waiting, accepted or refused.
- **History**: everything that has happened to a request, read-only.

Accepting a request automatically creates the matching workflow. Deleting a request also deletes the linked workflow.

---

## Workflow tab

### Workflows list

| Column | Description |
|---|---|
| **Name** | Workflow name. |
| **Domain** | Authentication domain of the user. |
| **User** | Account to which access is granted. |
| **Applications** | Application concerned. Beyond one, a **+ 1 other application** or **+ *n* other applications** counter is added. |

Each row can be expanded to show the restrictions (date range, time window, maximum session duration, one-time access, mandatory comment). When a workflow wraps several sub-workflows, the detailed list of sub-workflows is displayed, each with an individual delete button.

The toolbar offers:

| Action | Description |
|---|---|
| **×** (Delete) | Deletes the selected workflow after confirmation. Multi-selection is supported. |
| Search field | Filters by substring, under the **Search** placeholder. As long as there is no workflow, the grid shows **No Workflow**. |
| **Pagination** | 15, 25 or 50 rows per page. |

### Delete a workflow

Select a workflow and click **×**. When deleting a workflow triggers a user notification (see notification profiles), the confirmation window offers an optional **Administrator comment** field; that comment is included in the notification.

Deleting a workflow also deletes the associated user request.

> **Automatic deletion**
>
> Obsolete workflows (expired validity period, exhausted one-time access, maximum session duration reached) are deleted automatically by the system.

---

## Users' requests tab

### Requests list

The requests sent from the user portal appear here.

| Column | Description |
|---|---|
| **Status** | Icon whose tooltip gives the state: **Waiting**, **Accepted** or **Refused**. |
| **User** | Account that submitted the request. |
| **Domain** | Authentication domain of the account. |
| **Applications** | Requested application. Beyond one, the same counter as in the previous tab is added. |
| **Submission date** | Timestamp of the request, in `DD/MM/YYYY - HH:MM` format followed by the time zone. |
| **Workflow** | Name of the workflow created for this request, if any. |

A collapsible **Filters** block restricts the list by status (Waiting, Accepted, Refused) through check-boxes. A **Filter** button applies the selection.

A search field filters by substring.

### Accept a request

Select a **Waiting** request, then click **Accept the request**. A workflow creation window opens, pre-filled with the user, the domain and the requested resource.

The form contains:

| Section | Description |
|---|---|
| **Name** | Name of the workflow. Mandatory. Maximum 256 characters. A name already in use triggers an error message. |
| **Applications** | Category tree of the resources covered by the request. At least one resource must be checked. |
| **Domain / User** | Read-only fields showing the values from the request. |
| **Administrator comment** | Free text; its content is forwarded in the notification sent to the user, when applicable. |

The available **restrictions** stack:

| Restriction | Description |
|---|---|
| **Unique usage** | The application can be launched only once. |
| **Mandatory comment** | Asks the user to enter a comment before launch. |
| **Date** | Date range (start / end). The end date must be ≥ start date. |
| **Hour** | Time window `HH:MM`. If a date range is active and start and end fall on the same day, the end time must be strictly after the start time. |
| **Maximum session duration** | Duration `HH:MM` after which the session is closed. Not available for a **Generic tunnel** application. |

If the access contract asks the user to fill a form, the **Show user request** button displays the submitted details. The window then contains a **Pre-fill with this data** button that copies the values into the acceptance form (after confirmation).

> **Creation without restrictions**
>
> Validating a form without ticking **Unique usage**, **Date**, **Hour** or **Session duration** produces a workflow without time limit. A dialog asks for an extra confirmation before creation.

### Refuse a request

Only **Waiting** requests can be refused. Select the request and click **Refuse the request**. If action notifications are enabled and the request is concerned, an optional comment can be entered before confirmation.

> **A refusal does not prevent a new request**
>
> The user can request the same application again right away. On the new request, the refused request is **purged automatically**: the application is removed from it, and the request itself disappears if it carried only that one.
>
> What does prevent a new request is a **workflow already granted** for that application, or a request **still awaiting an answer**: in both cases the application is simply dropped from the new request.

### Delete a request

Only **Accepted** or **Refused** requests can be deleted. Select the request(s) and click the **×** (Delete) button. Multi-selection is supported when every selected request has already been answered.

- Deleting an **accepted** request revokes the authorisation and deletes the associated workflow.
- Deleting a **refused** request only removes the row from the list: the user could already submit a new request (see section [Refuse a request](#refuse-a-request)).

If action notifications are enabled and at least one of the deletions will trigger a mail, an optional administrator comment is offered before confirmation.

---

## History tab

Read-only. Where the two other tabs show the **current** state of a request, this one keeps the **whole trail**: who asked, who answered, when, and under which conditions the access was granted.

### History list

One row per request. The grid is paginated and holds a search field.

| Column | Description |
|---|---|
| **Date / origin** | Date of the **last** event of the request, then the requester. A coloured left border repeats the state. |
| **Request ID** | Identifier of the request, the one that ties the events together. |
| **Type** | State reached: **Request**, **Accepted**, **Refused**, **Manual deletion** or **Automatic removal**. |
| **Applications** | Applications the request covers. |
| **Workflow name** | Name of the workflow the request produced. |

When nothing matches, the grid displays *No history entry*.

> **One colour per state**
>
> The state is shown in colour, and the same colour draws the left border of the row and of each event in the detail: blue for **Request**, green for **Accepted**, red for **Refused**, pink for the two deletions. It is what lets a long history be read at a glance.

### Entry details

Expanding a row lists the **events** of the request, in order. Each one carries its type, its date and its actor, then the details that apply to it.

| Line | Shown for |
|---|---|
| **Applications** | Every event except the two deletions. |
| **User comment** | The **Request** event, when the user wrote one. |
| Validity dates | Every event except the two deletions, when the access is time-boxed. |
| **Time window** | Same, when the access is restricted to a daily time range. |
| Session duration | Same, when a maximum duration applies. |
| **Unique usage** | Same, when the access can only be used once. |
| **Administrator comment** | Every event except **Request**, when the administrator wrote one. |
| **Processing delay** | The answer events and the deletions (see below). |

> **What the processing delay measures**
>
> It is not the same reference for every event. For **Accepted** and **Refused**, it is counted from the **request**; for the two deletions, from the **answer**. The delay is written in a readable form and in seconds, for instance `2h 15m (8100 s)`.

### Filtering and exporting

The **Filter** panel is collapsed by default and offers five criteria.

| Field | Description |
|---|---|
| **Starting date:** / **Ending date:** | Bounds of the period. |
| **Requester** | The user who asked. |
| **Approver** | The administrator who answered. |
| **Request ID** | Exact identifier of a request. |
| **Types** | Check boxes, one per state: **Request**, **Accepted**, **Refused**, **Manual deletion**, **Automatic removal**. |

**Display** applies the criteria and returns to the first page, **Reset** clears them. The **Export** button of the toolbar downloads the result as a CSV file.
