Skip to content

Flow Reference

A flow is the core automation unit in Xferity. It defines what files to transfer, which partner or endpoint to use, how to protect the payload, when to run, and how to handle failures, retries, and cleanup.

This page is a field-by-field reference. For conceptual guidance, see Automation and Configuration.

  • implementers writing or reviewing flow files
  • operators validating flow configuration before rollout
  • security reviewers auditing transfer behavior

Each flow is defined in a YAML file under the directory referenced by flows_path in the global configuration. The YAML root key is flows, containing a map of flow names to flow definitions.

flows:
my-flow-name:
direction: upload
enabled: true
# ... fields

The flow file name is not required to match the flow name, but keeping them aligned is strongly recommended.

FieldTypeRequiredDefaultDescription
namestringyesUnique flow identifier. Used by CLI and UI.
directionstringyesupload or download
enabledboolnotrueWhether the flow participates in run-all and scheduled execution.
typestringnoLegacy incoming/outgoing alias. Use direction instead.
schedule_cronstringnoSix-field cron expression (with seconds) for scheduled execution.
max_failuresintno0Number of per-file errors tolerated before a run fails. 0 means fail immediately.
add_timestamp_to_filenameboolnofalseAppend a timestamp to destination file names.
timestamp_formatstringnoGo time layout string for the timestamp suffix.

A flow has a source and a target (for upload) or uses inline partner/endpoint references (for download). The Endpoint fields are:

FieldTypeDescription
partnerstringPartner ID from the partners directory.
pathstringRemote path or S3 prefix override.
hoststringInline host override (rarely needed; prefer partner config).
userstringInline user override.
passwordstringInline password or secret reference.
local_folderstringLocal folder for this endpoint in the flow.

For most flows, use partner to reference a partner definition and set path if the flow needs a different remote path than the partner default.

The local block sets paths for local staging, landing, and dead-letter locations.

local:
path: ./storage/nav/incoming
dead_letter_path: ./storage/nav/dead-letter
FieldTypeDescription
pathstringLocal base path for the flow.
dead_letter_pathstringWhere to place files that failed processing.
  • upload: source is local, target is partner remote.
  • download: source is partner remote, destination is local.

Direction also sets PGP role expectations through FlowRoleSpecs():

  • upload flows require partner_encrypt and optionally use our_sign
  • download flows require our_decrypt and optionally use partner_verify

Flows can reference an SFTP partner by partner name, or include inline SFTP settings. Inline settings override partner values when both are present.

sftp:
host: sftp.partner.example
port: 22
user: transfer-user
password: env:PARTNER_PASSWORD
key_path: file:/etc/xferity/keys/partner_id_rsa
key_passphrase: env:PARTNER_KEY_PASS
remote_dir: /incoming
known_hosts_path: /etc/xferity/known_hosts
host_key_fingerprint_sha256: "SHA256:abc..."
allow_insecure_host_key: false
timeout: 30
op_timeout_seconds: 120
require_stable_remote: false
stability_check_seconds: 2
stability_checks: 3
retry:
max_attempts: 3
initial_delay_ms: 1000
max_delay_ms: 30000
FieldTypeDefaultDescription
hoststringSFTP server hostname or IP.
portint22SFTP server port.
userstringSSH login username.
passwordstringPassword or secret reference. Omit when using key auth.
key_pathstringPath or secret reference to the SSH private key.
key_passphrasestringPassphrase or secret reference for the private key.
remote_dirstringRemote directory to upload to or download from.
known_hosts_pathstringPath to an SSH known_hosts file for host verification.
host_key_fingerprint_sha256stringSHA-256 fingerprint to pin. Must start with SHA256:.
allow_insecure_host_keyboolfalseSkip host key verification. Not recommended; rejected by hardened mode.
timeoutintConnection timeout in seconds.
op_timeout_secondsintPer-operation timeout in seconds.
require_stable_remoteboolfalseWait for remote file size stability before processing.
stability_check_secondsint2Interval between stability size checks.
stability_checksint3Number of matching size checks required before proceeding.
retry.max_attemptsintMaximum transfer retry attempts.
retry.initial_delay_msintInitial retry backoff in milliseconds.
retry.max_delay_msintMaximum retry backoff cap in milliseconds.

The files block defines which files to match. If omitted, all files in the source path are included.

files:
- pattern: "*.xml"
required: false
rename_to: ""
delete_after: false
FieldTypeDefaultDescription
patternstringGlob pattern to match file names.
requiredboolfalseFail the run if no files match this pattern.
rename_tostringRename matched files at the destination.
delete_afterboolfalseDelete the source file after successful transfer.

The pgp block controls OpenPGP payload protection.

pgp:
provider: auto
gnupg_binary: /usr/bin/gpg
encrypt: true
decrypt: false
sign: false
verify: false
public_key_path: file:/etc/xferity/keys/partner-public.asc
private_key_path: file:/etc/xferity/keys/our-private.asc
passphrase: env:PGP_PASSPHRASE
FieldTypeDefaultDescription
providerstringgopenpgpOpenPGP execution mode: gopenpgp, gnupg, or auto.
gnupg_binarystringgpgPath to the GnuPG binary. Required when provider=gnupg or provider=auto.
encryptboolEncrypt output files using the partner public key.
decryptboolDecrypt downloaded files using our private key.
signboolSign output files using our private key.
verifyboolVerify signatures on downloaded files using the partner public key.
public_key_pathstringPath or secret reference to the partner or recipient public key.
private_key_pathstringPath or secret reference to our signing or decryption private key.
passphrasestringPassphrase or secret reference for the private key.
ModeBehavior
gopenpgpNative Go OpenPGP only. No fallback.
gnupgGnuPG binary only. Requires gnupg_binary to be available.
autoTries native path first. Falls back to GnuPG once only when the native error is classified as compat_enterprise_key_structure. Not a general retry mechanism.

When provider=gnupg or provider=auto, startup validation requires GnuPG to be reachable.

Idempotency prevents a flow from reprocessing files it already handled.

FieldTypeDefaultDescription
idempotency_modestringhashhash (persist file hashes), none (disabled), or tracking (by filename).

In Postgres-backed mode, idempotency records are durable and survive restarts. In file-backed mode, they depend on local state files.

Flow locking prevents overlapping runs of the same flow.

FieldTypeDefaultDescription
lock_waitboolfalseWait for the lock instead of failing immediately when already locked.
lock_stale_after_secondsintAfter how many seconds to consider a lock stale and claim it.
max_lock_wait_secondsintMaximum time to wait for a lock release when lock_wait=true.
FieldTypeDefaultDescription
delete_after_uploadboolfalseDelete local source file after successful upload.
delete_source_after_uploadboolfalseAlias for delete_after_upload.
delete_encrypted_after_uploadboolfalseDelete the encrypted intermediate file after upload.
delete_remote_after_decryptboolfalseDelete the remote file after successful download and decryption.
delete_encrypted_after_decryptboolfalseDelete the downloaded encrypted file after decryption.
compress_before_encryptboolfalseCompress the file before encrypting.
FieldTypeDefaultDescription
performance.max_parallel_filesintMaximum files processed in parallel for this flow.

The notifications block controls per-flow notification behavior. It overrides or supplements global notification configuration.

notifications:
on_start: false
on_success: true
on_failure: true
failure_policy: fail_open
email_to: ops@example.com
slack_webhook_url: ""
slack_channel: ""
webhook_url: ""
ntfy_topic: ""
ntfy_priority: ""
gotify_priority: 0
pushover_sound: ""
FieldTypeDefaultDescription
on_startboolfalseSend notification when a run starts.
on_successboolfalseSend notification when a run succeeds.
on_failurebooltrueSend notification when a run fails.
failure_policystringfail_openfail_open: ignore notification errors. fail_closed: fail the run when notification delivery fails.
email_tostringOverride recipient email address for this flow.
slack_webhook_urlstringOverride Slack webhook URL for this flow.
slack_channelstringOverride Slack channel for this flow.
webhook_urlstringOverride generic webhook URL for this flow.
webhook_headersmapAdditional HTTP headers for the webhook request.
ntfy_topicstringOverride ntfy.sh topic for this flow.
ntfy_prioritystringOverride ntfy.sh priority: min, low, default, high, urgent.
gotify_priorityintOverride Gotify message priority (1–10) for this flow.
pushover_soundstringOverride Pushover notification sound for this flow.
pushover_priorityintOverride Pushover priority (-2 to 2) for this flow.

Flows can be run on a cron schedule by setting schedule_cron. Xferity uses a six-field cron expression with seconds as the first field.

schedule_cron: "0 */10 * * * *"

Fields (left to right): seconds minutes hours day-of-month month day-of-week.

Alternatively, use xferity run-service <flow> --interval-seconds 300 for polling without a cron expression.

Complete minimal example: SFTP upload with PGP encryption

Section titled “Complete minimal example: SFTP upload with PGP encryption”
flows:
payroll-upload:
direction: upload
enabled: true
target:
partner: payroll-processor
path: /incoming
local:
path: ./storage/payroll/outgoing
pgp:
provider: auto
encrypt: true
public_key_path: file:./keys/payroll/processor-public.asc
gnupg_binary: /usr/bin/gpg
idempotency_mode: hash
delete_after_upload: true
schedule_cron: "0 0 6 * * *"
notifications:
on_failure: true
email_to: ops@example.com

Complete minimal example: SFTP download with PGP decryption

Section titled “Complete minimal example: SFTP download with PGP decryption”
flows:
bank-statements-inbound:
direction: download
enabled: true
source:
partner: bank-sftp
path: /outgoing/statements
local:
path: ./storage/bank/statements
files:
- pattern: "*.pgp"
pgp:
provider: auto
decrypt: true
private_key_path: file:./keys/bank/our-private.asc
passphrase: env:BANK_PGP_PASSPHRASE
gnupg_binary: /usr/bin/gpg
idempotency_mode: hash
delete_remote_after_decrypt: false
delete_encrypted_after_decrypt: true
schedule_cron: "0 */15 6-18 * * *"

Flow pages in the UI and the API endpoint GET /api/flows/{name}/crypto/requirements expose the canonical Flow Crypto Requirements derived from FlowRoleSpecs().

This is the same function used by:

  • config validation
  • runtime preflight
  • runtime crypto resolution

Review Flow Crypto Requirements before enabling a flow in production.

  • Flow YAML uses strict field parsing. Unknown fields are rejected.
  • direction must be upload or download.
  • schedule_cron must be a valid six-field cron expression when set.
  • idempotency_mode must be hash, none, or tracking when set.
  • sftp.host_key_fingerprint_sha256 must start with SHA256: when set.
  • sftp.allow_insecure_host_key=true is rejected in hardened mode.
  • PGP provider=gnupg or provider=auto requires GnuPG to be present at startup.