# Workflows: Automate File Transfers

> Create, save, and manage workflows in Blober to automate repeatable file transfers between any two storage providers.

Workflows are the core of Blober. A workflow defines **what** to transfer, **where** it goes, and **what action** to perform. Once created, you can run a workflow any time to execute the transfer.

## What is a Workflow?

A workflow is a saved configuration with three parts:

1. **Source** - Where files come from (provider + path + credentials)
2. **Destination** - Where files go (provider + path + credentials)
3. **Action** - What to do (copy, move, sync, or delete)

## Creating a Workflow

### Step 1: Open the Workflow Modal

1. Go to the **Workflows** page
2. Click **New Workflow** button
3. The workflow creation modal opens

### Step 2: Configure the Source

1. **Select Provider** - Choose where files come from (e.g., Local, Google Drive, AWS S3)
2. **Enter Credentials** - Provide the required authentication (see [Storage Providers](/kb/docs/providers))
3. **Browse Location** - Click **Browse** to select files or folders
4. **Apply Filters** (optional) - Limit which files are included

#### Source Options

| Field       | Description                       |
| ----------- | --------------------------------- |
| Provider    | The storage provider to use       |
| Credentials | Authentication for the provider   |
| Path        | Starting folder or specific files |
| Filters     | Include/exclude patterns          |

### Step 3: Configure the Destination

1. **Select Provider** - Choose where files will go
2. **Enter Credentials** - Authentication for destination
3. **Set Base Path** - The folder where files will be placed
4. **Path Template** (optional) - Dynamic path based on file metadata

#### Destination Options

| Field         | Description                       |
| ------------- | --------------------------------- |
| Provider      | The storage provider to use       |
| Credentials   | Authentication for the provider   |
| Base Path     | Root folder for transferred files |
| Path Template | Dynamic subfolder structure       |

### Step 4: Choose an Action

| Action     | Description                         | Source Files           |
| ---------- | ----------------------------------- | ---------------------- |
| **Copy**   | Copy files to destination           | Unchanged              |
| **Move**   | Copy files, then delete from source | Deleted after transfer |
| **Sync**   | Mirror source to destination        | Unchanged              |
| **Delete** | Remove files from source            | Deleted                |

### Step 5: Save the Workflow

1. Give the workflow a name
2. Click **Save**
3. The workflow appears in your list

## Path Templates

Path templates let you organize destination files dynamically based on file metadata. Use placeholders in curly braces `{variable}` that get replaced with actual values.

### Available Variables

| Variable                   | Description                                                                                                              | Example               |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------- |
| `{current_date}`           | Current date                                                                                                             | `2025-10-25`          |
| `{current_datetime}`       | Current date and time                                                                                                    | `2025-10-25_14-30-00` |
| `{file_created_date}`      | File creation date                                                                                                       | `2024-12-15`          |
| `{file_created_datetime}`  | File creation date/time                                                                                                  | `2024-12-15_09-15-30` |
| `{file_modified_date}`     | File modification date                                                                                                   | `2025-01-20`          |
| `{file_modified_datetime}` | File modification date/time                                                                                              | `2025-01-20_16-45-22` |
| `{file_accessed_date}`     | Last accessed date                                                                                                       | `2025-10-25`          |
| `{file_accessed_datetime}` | Last accessed date/time                                                                                                  | `2025-10-25_12-00-15` |
| `{filename}`               | Complete filename with extension                                                                                         | `document.pdf`        |
| `{filename_no_ext}`        | Filename without extension                                                                                               | `document`            |
| `{file_ext}`               | File extension (no dot)                                                                                                  | `pdf`                 |
| `{file_size}`              | File size in bytes                                                                                                       | `1048576`             |
| `{file_size_mb}`           | File size in MB                                                                                                          | `1.50`                |
| `{file_dir}`               | Directory path relative to the selected source folder; empty for directly selected files and files at that folder's root | `project/camera-a`    |

### Path Template Examples

#### Organize by Date

```plaintext
photos/{file_created_date}/{filename}
```

**Result:** `photos/2024-12-15/IMG_0001.jpg`

#### Organize by Year and Month

```plaintext
backup/{file_modified_date}/{filename}
```

**Result:** `backup/2025-01-20/report.pdf`

#### Organize by File Type

```plaintext
documents/{file_ext}/{filename}
```

**Result:** `documents/pdf/invoice.pdf`

#### Archive with Timestamp

```plaintext
archive/{current_date}/{file_dir}/{filename}
```

**Result:** `archive/2025-10-25/uploads/data.csv`

`{file_dir}` depends on the source selection. If you select `Projects` and the file is `Projects/client-a/final/report.pdf`, its value is `client-a/final`. If you select `report.pdf` directly, or it sits at the root of the selected folder, the value is empty. A custom path template replaces automatic subdirectory preservation, so include `{file_dir}` explicitly when the relative source hierarchy should remain.

For worked examples of every variable, see the [complete path-template guide](/kb/articles/blober-path-templates-complete-guide/). For a deeper look at `{file_dir}`, read [how the file\_dir variable works](/kb/articles/blober-file-dir-path-template/). You can also organize files [by date](/kb/articles/organize-files-by-date-path-templates/), [by type](/kb/articles/organize-files-by-type-extension/), or [by size](/kb/articles/organize-files-by-size/).

## Source Filters

Filters let you include or exclude specific files from the transfer.

### Filter Patterns

| Pattern           | Matches                       |
| ----------------- | ----------------------------- |
| `*.jpg`           | All JPEG files                |
| `*.{jpg,png,gif}` | All image files               |
| `report-*`        | Files starting with "report-" |
| `documents/**`    | All files in documents folder |

### Example Filter Configuration

**Include only images:**

```plaintext
*.jpg
*.png
*.gif
*.webp
```

**Exclude temporary and system files:**

```plaintext
**/*.{tmp,log}
```

Enter exclusion patterns in the dedicated **Exclude Pattern** field; a leading `!` is not required.

For include/exclude glob recipes and how selection narrows a transfer, see [file selection and glob filters](/kb/articles/blober-file-selection-glob-filters/) and [organizing storage that has no practical search](/kb/articles/organize-blob-storage-without-search/).

## Managing Workflows

### View Workflows

The Workflows page shows all saved workflows in a list with:

* Workflow name
* Source provider and path
* Destination provider and path
* Action type
* Last run time

### Edit a Workflow

1. Click on a workflow in the list
2. Modify any settings in the modal
3. Click **Save**

### Delete a Workflow

1. Click the delete icon on a workflow
2. Confirm deletion

> **Note:** Deleting a workflow does not delete any transferred files. It only removes the saved configuration.

## Workflow Examples

### Backup Documents to S3

| Setting       | Value                                 |
| ------------- | ------------------------------------- |
| Source        | Local: `/Users/you/Documents`         |
| Destination   | AWS S3: `my-backup-bucket/documents/` |
| Action        | Copy                                  |
| Path Template | `{file_modified_date}/{filename}`     |

### Archive Photos by Date

| Setting       | Value                            |
| ------------- | -------------------------------- |
| Source        | Local: `/Users/you/Pictures`     |
| Destination   | Azure Blob: `photos-archive/`    |
| Action        | Move                             |
| Path Template | `{file_created_date}/{filename}` |
| Filters       | `*.jpg, *.png, *.heic`           |

### Sync Google Drive to Local

| Setting     | Value                             |
| ----------- | --------------------------------- |
| Source      | Google Drive: `My Files/Projects` |
| Destination | Local: `/Users/you/Projects`      |
| Action      | Sync                              |

## Tips

### Preview Before Running

Before starting a workflow, use the **Preview** feature to see which files will be transferred and where they'll go.

### Test with a Small Folder

Start with a small folder to verify your path templates and filters work as expected.

### Use Copy Before Move

If you're unsure, use **Copy** first. Once you've verified the transfer, you can use **Move** to remove source files.

### Credential Storage

Credentials are saved with the workflow and stored securely in your local database. You won't need to re-enter them each time.