SFTP Write
Write a single file to an SFTP server from either upstream items or a literal content string. Supports CSV, TSV, JSON, JSON Lines, XML, and Raw output with optional GZIP compression and append-mode writes.
Requires an SFTP connection.
Configuration
| Field | Description | Notes |
|---|---|---|
| SFTP Connection | The SFTP connection to use | Required. Select from your configured SFTP connections. |
| Target Directory | The remote directory to write to | Supports templates. A directory browser is provided. |
| Filename Template | The name of the output file | Required. Supports templates, so you can include dynamic values like dates. Example: export_2026-03-16.csv |
| Source | Where the file body comes from | From upstream data (default) or Custom content |
| Format | How input items are serialized | Visible when Source = data. See table below. Defaults to CSV. |
| CSV Column Order | Comma-separated list of column names to control selection and order | Visible when Format ∈ {csv, tsv}. Leave empty for the union of keys across all items (sorted alphabetically). |
| File Content | Literal file body | Visible when Source = content. Supports templates; written verbatim. |
| Write Mode | How to handle existing files | See table below. Defaults to Append. |
| Format Options (JSON) | A JSON object with format-specific settings | Visible when Source = data. Supported key: pretty_print (boolean) — formats JSON/XML output with indentation. Defaults to {"pretty_print": false}. |
| Compress File (GZIP) | Compress the output file with GZIP | Disabled by default. When enabled, .gz is appended to the filename if not already present. |
| Create Directories | Automatically create parent directories if they do not exist | Enabled by default. |
Source modes
- From upstream data — serialize every input item into the file using the chosen Format. Use this when you have rows/records from a database query, API response, etc.
- Custom content — write the File Content field verbatim. Use this when you've already composed the bytes yourself.
Output Formats (Source = data)
| Format | Description |
|---|---|
| CSV | Comma-separated values with a header row. Header is the union of keys across all items (sorted alphabetically) unless CSV Column Order is set. Underscore-prefixed metadata fields are excluded. |
| TSV | Tab-separated values with the same header rules as CSV. |
| JSON | A JSON array containing all items. |
| JSON Lines | One JSON object per line — useful for large datasets and streaming. |
| XML | XML document with <items> root element and <item> child elements. |
| Raw | Pass-through: each item must already be a string or []byte; anything else is rejected. |
Write Modes
| Mode | Behavior |
|---|---|
| Append | Add data to the end of an existing file, or create a new file if it does not exist |
| Overwrite | Replace the file contents entirely |
| Fail If Exists | Fail with an error if the file already exists |
| Unique Name | Automatically append a UTC timestamp to the filename (e.g., export_20260316_143005.csv) to avoid conflicts |
Input
When Source = data, the node requires a data input. All items received from upstream nodes are collected, formatted, and written to the specified file. When Source = content, the upstream input is optional and ignored — only the File Content field is written.
Output
After writing, the node outputs a single item with the following fields:
| Field | Description |
|---|---|
success | true if the write completed successfully |
file | The full remote path of the written file |
filename | The filename portion |
bytes_written | Number of bytes written to the server |
items_written | Number of data items written (0 in content mode) |
source | The Source mode (data or content) |
format | Present when Source = data; the format used |
compressed | Whether GZIP compression was applied |
When Source = data and no items are received, the node outputs items_written: 0 with a message of no data to write and does not create a file.
TIP
Use the CSV Column Order field to control exactly which columns appear in CSV/TSV output and in what order. This is especially useful when downstream systems expect a specific column layout.
TIP
The Unique Name write mode is ideal for recurring workflows that should produce a new file each run without overwriting previous output.
WARNING
When using Append mode with CSV or TSV format, headers are written with the first append. Subsequent appends add data rows only if the file already contains a header. Be mindful of column consistency across appends.