Skip to main content
Directus Flows is a powerful automation engine that allows you to create complex workflows triggered by events, schedules, webhooks, or manual execution.

Flow Triggers

Flows can be triggered by different events:

Event Trigger

Run flows when data changes occur:

Available Events

  • items.create - After item creation
  • items.update - After item update
  • items.delete - After item deletion
  • auth.login - User login
  • files.upload - File upload

Schedule Trigger

Run flows on a schedule using cron syntax:
Cron examples:
  • */5 * * * * - Every 5 minutes
  • 0 9 * * 1 - Every Monday at 9 AM
  • 0 0 1 * * - First day of every month

Webhook Trigger

Create HTTP endpoints that trigger flows:
Access webhook:

Manual Trigger

Allow users to trigger flows from the App:

Operation Trigger

Trigger flows programmatically from other flows or extensions:
Call from another flow:

Operations

Operations are the building blocks of flows. Chain operations together to create workflows.

Condition

Branch flow based on conditions:

Create Item

Create records in collections:

Update Item

Modify existing records:

Read Item

Fetch data from collections:

Delete Item

Remove records:

Send Email

Send emails with templates:

HTTP Request

Call external APIs:

Transform Data

Manipulate data with JSONata:

Execute Script

Run custom JavaScript/TypeScript:

Log Message

Write to system logs:

Sleep/Delay

Pause flow execution:

Throw Error

Stop flow execution with error:

Send Notification

Create in-app notifications:

Flow Variables

Access data within operations using template variables:

$trigger

Data from the flow trigger:

$last

Result from the previous operation:

$accountability

Information about the user who triggered the flow:

$env

Environment variables (must be allowlisted):

Special Functions

  • {{$NOW}} - Current timestamp
  • {{$NOW('+1 day')}} - Relative time
  • {{$NOW('-7 days')}} - Past time

Flow Execution

Flows execute operations in order with error handling:

Example Workflows

Auto-publish Scheduled Content

Sync to External CMS

Best Practices

Add condition operations to prevent unnecessary operations and handle edge cases.
Use reject branches to handle failures and log errors for debugging.
Email operations are rate-limited. Use conditions to prevent spam.
Set async: true on webhook triggers that perform time-consuming tasks.