# Flows

> Flows enable custom, event-driven data processing and task automation within Directus.

Flows enable custom, event-driven data processing and task automation within Directus. Each flow is composed of one trigger, a series of operations, and a data chain that is passed between each step.

Flows live in the **Flows** module in the module bar and are available to users with admin access. See [Manage Flows](/guides/flows/manage-flows) to organize, search, duplicate, import, and export them.

<callout icon="i-lucide-info">

Flows run arbitrary code with elevated accountability. See [Security Best Practices](/guides/security/best-practices#flows) for guidance on restricting who can create, edit, or trigger them.

</callout>

## Fields

- **Name (required)** — The displayed name of the Flow.
- **Status** — Sets the flow to active or inactive.
- **Icon** — Adds an icon to help quickly identify the flow.
- **Description** — Sets a brief verbal description of the flow.
- **Color** — Sets a color to help identify the flow.
- **Folder** — Shows which folder holds the flow on the Flows page. This is read-only. A new flow goes into whichever folder you have open when you create it, and you move it afterwards with **Move to Folder**. See [Manage Flows](/guides/flows/manage-flows#organize-flows-into-folders).
- **Activity and Logs Tracking** — Selects whether the flow should be tracked in both the [activity log](/guides/auth/accountability) and the flow's logs, only in the activity log, or neither.

## Logs

![Logs from one flow execution. It shows the trigger payload and accountability, and the operation options and payload.](/img/222e9acb-ae30-47be-b59f-0125c10fc58f.webp)

Accessible from the sidebar, logs store information for each flow execution. Each log will display information from
triggers as well as each operation in the flow.

Logs are not a 1:1 mapping to the data chain. Each trigger and operation gets its own dropdown, which stores its
relevant data. Here's what you'll get from each of these:

### Trigger

- **Options** — The values you input when you configured the trigger.
- **Payload** — Displays the data appended under `$trigger`, which includes the data passed into the flow itself.
- **Accountability** — Displays data appended under `$accountability`, which is a breakdown of the permissions and request information of the user that triggered that event.

Note that `$accountability` is not nested under the `$trigger` key. However, it is listed under the trigger in the log
because `$accountability` is generated by the trigger.

### `<OperationKey>`

- **Options** — The values you input when you configured the operation.<br />

*(These configuration options are not stored on the data chain)*.
- **Payload** — Displays the data appended under this `<operationKey>`.

<callout icon="i-lucide-triangle-alert" color="warning">

**Logs are stored in the database**
Flows configured to tracks will store this information in the database, which may require occasionally deleting.

</callout>

<callout icon="i-lucide-info">

**Where is $last?**`$last` constantly updates to store the data of the most recently executed operation. Since the log shows the results of the entire flow, `$last` would only be the final
operation in the flow.

</callout>

<video-embed video-id="511b1967-c04f-42db-b515-911de7981d33">



</video-embed>
