> For the complete documentation index, see [llms.txt](https://docs.diaflow.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.diaflow.io/workflow-builder/nodes/built-in-tools/sftp-password-based-auth.md).

# SFTP (password-based auth)

### 1. The "B2B Digital Mailman" (Overview)

Stop waking up at midnight to manually upload reconciliation files. Connect to your partners' legacy servers instantly.

Use this node to both **push** files out and **pull** new files in automatically. It helps warehouses, banks, suppliers, and older business systems work smoothly with modern Diaflow workflows.

### 2. How to Add the Node

Click the **+** button on your canvas, search for **SFTP (password-based auth)**, and add it to your workflow.

> 🖼️ **\[PLACEHOLDER: SCREENSHOT - The 'Add Connection' form with a red box highlighting the Username & Password fields]**

### 3. What can you automate? (The "Wow" Use Cases)

1. **The Nightly Recon:** Auto-generate a CSV and push it to a partner folder every day at `11:59 PM`.
2. **The Order Ingester:** Watch a supplier folder and trigger an email the moment a new tracking file appears.
3. **The ERP Bridge:** Connect older on-premise systems with modern cloud workflows without manual file handling.

### 4. Step-by-Step: Configuration & Smart Data Injection

#### **Set up the connection**

Add your partner server details in the connection settings:

* **Host**
* **Port** : use `22`
* **Username**
* **Password**

#### **Choose how the node works**

Use **Upload File** when you want to send a file or text to your partner. Use **Watch Remote Directory** when you want Diaflow to monitor a folder and react to new changes.

#### **Build dynamic file names**

Type `@` inside the **Remote Path** field to open the visual data picker. This is the easiest way to insert dates, order IDs, customer codes, or other values from earlier steps.

This helps you create unique file names automatically, instead of reusing the same name every time.

> 🛑 **\[PLACEHOLDER: SCREENSHOT - The 'Remote Path' input field showing `/uploads/report_@Date.csv` to demonstrate dynamic naming]**

### 5. The Output: Seeing Your Results

For uploads, the node returns a success result so you know the handoff completed.

For directory watching, the node returns details about the new or changed file so the next step can keep processing automatically.

> 🛑 **\[PLACEHOLDER: GIF - Split screen: FileZilla uploading a file on the left, Diaflow workflow triggering on the right]**

### 6. Golden Rules & Guardrails (CRITICAL PRO-TIPS)

* **The Overwrite Trap:** If you name your file `report.csv`, it will overwrite yesterday's file. Always use `@` to inject the current date, order ID, or another unique value into the file name.
* **The Directory Rule:** We do not automatically create folders. Make sure `/uploads` or your target folder already exists on your partner server before you run the workflow.
* **The Polling Cost Trap:** Watcher triggers cost **2 Credits per event**. Do not watch a root folder with thousands of files. Point the watcher to a specific, clean sub-folder instead.
* **Choose one upload source:** Send either a file or text content in a single run. Keeping it to one source avoids confusion.
* **Broken connections stop the run:** Wrong login details, missing folders, permission issues, or unreachable files can stop the step. Add a fallback email or Slack alert for important partner handoffs.
* **Keep folder depth tight:** When using the watcher, monitor only the folders you need. Smaller folder trees are faster and easier to manage.

### Need help?

* Read [What is Diaflow?](/workflow-builder/overview.md)
* Browse the [Component List](/workflow-builder/component-list.md)
