> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agent-drop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# n8n Integration: AgentDrop File Transfer in n8n Workflows

> Integrate AgentDrop with n8n using the HTTP Request node to send and receive end-to-end encrypted files inside any automation workflow. No custom node required.

AgentDrop works with n8n's HTTP Request node. No custom nodes required. Send and receive files as part of any n8n workflow.

## Prerequisites

* n8n instance (cloud or self-hosted)
* AgentDrop API key stored as an n8n credential

## Set Up Credentials

1. In n8n, go to **Credentials** and create a new **Header Auth** credential
2. Set the name to `AgentDrop API`
3. Set the header name to `Authorization`
4. Set the header value to `Bearer agd_live_xxxxxxxxxxxxxxxxxxxx`

## Upload a File

Use the HTTP Request node to send a file to AgentDrop.

### Node Configuration

| Setting               | Value                                     |
| --------------------- | ----------------------------------------- |
| **Method**            | POST                                      |
| **URL**               | `https://api.agent-drop.com/v1/transfers` |
| **Authentication**    | Header Auth (AgentDrop API)               |
| **Send Body**         | On                                        |
| **Body Content Type** | Form-Data/Multipart                       |

### Body Parameters

| Name         | Type   | Value                            |
| ------------ | ------ | -------------------------------- |
| `sender`     | String | `n8n-workflow`                   |
| `recipient`  | String | `processing-agent`               |
| `expires_in` | String | `24h`                            |
| `files`      | File   | (Binary data from previous node) |

### Connecting Binary Data

If the file comes from a previous node (like Read Binary File, Google Drive, or an email attachment):

1. Set the `files` parameter type to **File**
2. In the file field, reference the binary property from the previous node: `{{ $binary.data }}`

The transfer ID is available in the response at `{{ $json.id }}` for downstream nodes.

## Download a File

Use another HTTP Request node to download files from a transfer.

### Node Configuration

| Setting             | Value                                                                      |
| ------------------- | -------------------------------------------------------------------------- |
| **Method**          | GET                                                                        |
| **URL**             | `https://api.agent-drop.com/v1/transfers/{{ $json.transfer_id }}/download` |
| **Authentication**  | Header Auth (AgentDrop API)                                                |
| **Response Format** | File                                                                       |

The downloaded file is available as binary data for the next node (Write to Disk, Send Email, Google Drive upload, etc.).

## Check Transfer Status

Add a conditional check before downloading:

### Node Configuration

| Setting            | Value                                                             |
| ------------------ | ----------------------------------------------------------------- |
| **Method**         | GET                                                               |
| **URL**            | `https://api.agent-drop.com/v1/transfers/{{ $json.transfer_id }}` |
| **Authentication** | Header Auth (AgentDrop API)                                       |

### IF Node (After Status Check)

| Condition            | Value           |
| -------------------- | --------------- |
| `{{ $json.status }}` | equals `active` |

Route to the download node only when the transfer is active.

## Example Workflow: Email Attachment Pipeline

A complete workflow that receives email attachments and makes them available to an AI agent:

```
[Email Trigger] → [HTTP Request: Upload to AgentDrop] → [Set: Store Transfer ID]
```

**Step 1: Email Trigger**
Triggers when a new email arrives with attachments.

**Step 2: HTTP Request (Upload)**

* Method: POST
* URL: `https://api.agent-drop.com/v1/transfers`
* Body: Form-Data with `sender=email-inbox`, `recipient=doc-processor`, `files={{ $binary.attachment_0 }}`

**Step 3: Set Node**
Store `{{ $json.id }}` as the transfer ID. The receiving agent picks up the file automatically via inbox polling.

## Example Workflow: Scheduled Report Distribution

```
[Schedule Trigger] → [Code: Generate Report] → [HTTP Request: Upload] → [HTTP Request: Notify Slack]
```

Upload the generated report to AgentDrop, then post the transfer URL to a Slack channel where agents or humans can pick it up.

## List Transfers

Query your recent transfers to find specific files:

| Setting            | Value                                                     |
| ------------------ | --------------------------------------------------------- |
| **Method**         | GET                                                       |
| **URL**            | `https://api.agent-drop.com/v1/transfers?page=1&limit=10` |
| **Authentication** | Header Auth (AgentDrop API)                               |

Use a **Loop Over Items** node to process each transfer in the response array.

## Tips

* **Store the transfer ID.** Use a Set node to save `{{ $json.id }}` after upload. You will need it for downloads and status checks.
* **Use expressions for dynamic recipients.** Set the `recipient` field to `{{ $json.agent_name }}` from your workflow data.
* **Set short expiry for automated workflows.** If your downstream agent processes files within minutes, use `expires_in=1h` to keep storage clean.
* **Error handling.** Add an Error Trigger node to catch `413` (file too large) and `429` (rate limited) responses and route to retry or alert nodes.
