How to Automate File Transfer Pipelines — Xferity Guide
How to Automate File Transfer Pipelines
Section titled “How to Automate File Transfer Pipelines”This guide explains how to set up automated file transfer pipelines using Xferity.
What you need
Section titled “What you need”Before starting:
- A host running Linux, Docker, or Windows
- Access to at least one transfer endpoint (SFTP server, FTPS server, S3 bucket, or AS2 partner)
- Credentials or key material for that endpoint
- The
xferitybinary — see Deployment
Step 1: Define your partner
Section titled “Step 1: Define your partner”Create a partner file for the endpoint you are connecting to.
SFTP partner example
Section titled “SFTP partner example”id: my-sftp-partnertype: sftphost: sftp.example.comport: 22auth: method: password username: myuser password: env:SFTP_PASSWORDhost_key_fingerprint: "SHA256:abc123..."passworduses a secret reference — not plaintexthost_key_fingerprintis required for SSH trust verification
S3 partner example
Section titled “S3 partner example”id: my-s3-buckettype: s3bucket: my-transfer-bucketregion: us-east-1credentials: access_key_id: env:AWS_ACCESS_KEY_ID secret_access_key: env:AWS_SECRET_ACCESS_KEYStep 2: Define your flow
Section titled “Step 2: Define your flow”Create a flow file that references the partner and defines the transfer behavior.
Upload flow example
Section titled “Upload flow example”name: outgoing-uploadpartner: my-sftp-partnerdirection: uploadsource: path: /data/outgoing pattern: "*.csv"destination: path: /inbound/idempotency_mode: hashretry: max_attempts: 5 base_delay_seconds: 10 cap_seconds: 300cleanup: delete_after_transfer: trueDownload flow with PGP decryption
Section titled “Download flow with PGP decryption”name: incoming-downloadpartner: my-sftp-partnerdirection: downloadsource: path: /outbound/ pattern: "*.pgp"destination: path: /data/incoming/pgp: provider: auto decrypt: true verify: trueidempotency_mode: hashStep 3: Validate configuration
Section titled “Step 3: Validate configuration”xferity validatexferity diag incoming-downloadvalidate checks all YAML config files for unknown fields and required values.
diag performs a preflight check: endpoint reachability, key availability, TLS verification.
Step 4: Run once manually
Section titled “Step 4: Run once manually”xferity run incoming-downloadReview the output:
xferity flow history incoming-downloadxferity trace <some-file.pgp>Step 5: Enable scheduling
Section titled “Step 5: Enable scheduling”Option A: cron expression in flow file
Section titled “Option A: cron expression in flow file”name: incoming-downloadschedule_cron: "0 */5 * * * *" # every 5 minutes (six-field cron with seconds)Run the service:
xferity run-service incoming-downloadOption B: interval-based polling
Section titled “Option B: interval-based polling”xferity run-service incoming-download --interval-seconds 300Step 6: Enable retry and deadletter
Section titled “Step 6: Enable retry and deadletter”Add to your flow:
retry: max_attempts: 5 base_delay_seconds: 10 cap_seconds: 300 jitter: truedead_letter: path: /data/dead-letter/Files that exhaust all retries move to the dead-letter path instead of being lost.
Step 7: Monitor the pipeline
Section titled “Step 7: Monitor the pipeline”Prometheus metrics
Section titled “Prometheus metrics”/metrics exposes:
- flow run counts and durations
- retry counts
- dead-letter accumulation
- certificate expiry state
CLI monitoring
Section titled “CLI monitoring”xferity flow statusxferity flow history incoming-downloadxferity logs incoming-downloadNotifications
Section titled “Notifications”Configure Slack or Email alerts for flow failures:
notifications: on_failure: - type: slack webhook_url: env:SLACK_WEBHOOKStep 8: Run in Docker (optional)
Section titled “Step 8: Run in Docker (optional)”docker compose up xferityThe included Docker Compose file mounts config, flows, state, logs, keys, and storage.
For the full feature set (durable jobs, UI, certificate inventory), use Postgres-backed mode:
See Deployment: Postgres and Workers.
What Xferity gives you vs. a script
Section titled “What Xferity gives you vs. a script”| Capability | Script | Xferity flow |
|---|---|---|
| SSH host key verification | Manual or disabled | Required by default |
| Duplicate file protection | None | SHA-256 idempotency |
| Retry on failure | Manual loops | Exponential backoff, jitter |
| Concurrent execution protection | Race conditions | Distributed flow lock |
| Audit trail | Log files | Structured JSONL with hash chain |
| File lifecycle trace | Not possible | xferity trace <file> |
| Recovery after crash | Re-run from scratch | xferity resume |