Skip to content

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

FieldDescriptionNotes
SFTP ConnectionThe SFTP connection to useRequired. Select from your configured SFTP connections.
Target DirectoryThe remote directory to write toSupports templates. A directory browser is provided.
Filename TemplateThe name of the output fileRequired. Supports templates, so you can include dynamic values like dates. Example: export_2026-03-16.csv
SourceWhere the file body comes fromFrom upstream data (default) or Custom content
FormatHow input items are serializedVisible when Source = data. See table below. Defaults to CSV.
CSV Column OrderComma-separated list of column names to control selection and orderVisible when Format ∈ {csv, tsv}. Leave empty for the union of keys across all items (sorted alphabetically).
File ContentLiteral file bodyVisible when Source = content. Supports templates; written verbatim.
Write ModeHow to handle existing filesSee table below. Defaults to Append.
Format Options (JSON)A JSON object with format-specific settingsVisible 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 GZIPDisabled by default. When enabled, .gz is appended to the filename if not already present.
Create DirectoriesAutomatically create parent directories if they do not existEnabled 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)

FormatDescription
CSVComma-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.
TSVTab-separated values with the same header rules as CSV.
JSONA JSON array containing all items.
JSON LinesOne JSON object per line — useful for large datasets and streaming.
XMLXML document with <items> root element and <item> child elements.
RawPass-through: each item must already be a string or []byte; anything else is rejected.

Write Modes

ModeBehavior
AppendAdd data to the end of an existing file, or create a new file if it does not exist
OverwriteReplace the file contents entirely
Fail If ExistsFail with an error if the file already exists
Unique NameAutomatically 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:

FieldDescription
successtrue if the write completed successfully
fileThe full remote path of the written file
filenameThe filename portion
bytes_writtenNumber of bytes written to the server
items_writtenNumber of data items written (0 in content mode)
sourceThe Source mode (data or content)
formatPresent when Source = data; the format used
compressedWhether 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.