Schedule icon
List icon
Return icon
Switch icon
SlackIncomingWebhook icon
If icon
Loop icon
Move icon
Log icon

FTPS Partner File Ingestion Stall & Stale Quarantine Sentinel

Audit FTPS file drops for partner ingestion stalls, alert Slack on SLA queue backlog breaches, and automate quarantine isolation for stale EDI files.

Categories
Data

In enterprise B2B data ecosystems, external trading partners, clearinghouses, and payment gateways routinely deposit critical batch payloads, including HIPAA EDI 837/835 claims, NACHA ACH transaction sets, and SWIFT messages, onto FTPS (FTP over TLS/SSL) servers. When downstream consumer microservices or ETL pipelines stall, unread files accumulate in incoming drop directories. This backlog creates severe compliance liabilities, breaches data freshness Service Level Agreements (SLAs), and risks partner uploads overwriting unread transactions. Conversely, corrupted or unparseable files left lingering in the active dropzone block subsequent batch processing runs.

This blueprint implements an automated Day 2 operations sentinel for FTPS partner ingestion dropzones. Operating on a 30-minute schedule, it securely audits remote FTPS directories using explicit/implicit TLS, evaluates queue depth against configurable SLA thresholds, escalates critical stall alerts to Slack, and optionally routes unprocessable files to an isolated quarantine folder without human intervention.

How it works

  1. Scheduled trigger (periodic_schedule) initiates the diagnostic audit cycle every 30 minutes, with on-demand manual runs supported via configurable inputs.
  2. Diagnostic probe (probe_incoming_files) connects to the remote FTPS server over port 990 or 21 with TLS encryption via io.kestra.plugin.fs.ftps.List, filtering for partner data files (.edi, .csv, .dat, .xml) and sorting entries by oldest modification timestamp.
  3. Classification logic (classify_ingestion_health) evaluates the probe output using Pebble expressions to determine operational posture: CRITICAL_BACKLOG if queue length breaches threshold, ACTIVE_QUEUE if processing is within limits, HEALTHY_EMPTY if queue is clear, or PROBE_FAILED on network or TLS negotiation failure.
  4. Flow router (route_by_health_status) directs execution along dedicated branches according to classified severity.
  5. On CRITICAL_BACKLOG, a structured Slack incident card notifies operations channels with queued file counts, endpoint host, and oldest file age.
  6. Guarded remediation (check_remediation) evaluates auto_quarantine and dry_run flags. If enabled, quarantine_stalled_files (io.kestra.plugin.core.flow.Loop) iterates over stalled files and safely dispatches move_to_quarantine (io.kestra.plugin.fs.ftps.Move) to isolate unprocessable records without data loss.
  7. Audit log task (log_audit_summary) commits an immutable log record capturing execution ID, file counts, and remediation outcomes.

What you get

  • Continuous automated surveillance of partner FTPS dropboxes and EDI exchange directories.
  • Early warning alerting before unprocessed file backlogs cause partner ingestion SLA breaches.
  • Automated self-healing quarantine isolation that unblocks stuck queues without manual SSH/FTP intervention.
  • Zero credential leakage in alert webhooks and task logs via Kestra secret masking.
  • Safe dry-run testing modes enabling operational verification before activating automated file movement.

Who it's for

  • Financial Operations and B2B Integration Engineers managing ACH, NACHA, and SWIFT batch transfers.
  • Healthcare Data Platform Engineers operating HIPAA-compliant EDI 837/835 claim processing drops.
  • Supply Chain and Logistics Integration Teams monitoring EDIFACT and ANSI X12 inventory exchange servers.
  • Site Reliability Engineers ensuring continuous ingestion uptime across third-party file transport endpoints.

Why orchestrate this with Kestra

Operating legacy cron jobs with Python ftplib or bash scripts creates brittle point failures, lacks credential encryption, and provides zero centralized observability or audit trails. Kestra delivers declarative, cloud-native orchestration with first-class FTPS TLS connectivity, atomic secret masking, fine-grained flow control (Switch, Loop, If), and multi-channel alerting without managing external worker daemons or custom polling wrappers.

Prerequisites

  • A running FTPS server (such as vsftpd or Pure-FTPd) accessible over the network with TLS enabled.
  • An FTPS user account with read and write/move permissions in the incoming and quarantine directories.
  • An active Slack Incoming Webhook URL configured in Kestra secrets.

Secrets

  • FTPS_USERNAME: Username for authenticating with the remote FTPS server.
  • FTPS_PASSWORD: Password or credential for the FTPS user account.
  • SLACK_WEBHOOK_URL: Webhook URL for posting operational incident notifications to Slack.

Quick start

  1. Configure FTPS_USERNAME, FTPS_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  2. Start a local FTPS test container using Docker:
    docker run -d --name ftps-server -p 21:21 -p 990:990 -p 30000-30009:30000-30009 -e FTP_USER=kestra -e FTP_PASS=secret123 -e TLS_ENABLED=true delfer/alpine-ftp-server
    
  3. Create the test directories /incoming and /quarantine on the server and place test .edi or .csv files in /incoming.
  4. Import this blueprint into Kestra and click Execute with dry_run: true to test the probe and classification logic safely.
  5. Set auto_quarantine: true and enable periodic_schedule to activate automated background sentinel monitoring.

How to extend

  • Add downstream virus and malware scanning via io.kestra.plugin.scripts.shell.Commands with ClamAV before quarantine movement.
  • Connect downstream warehouse loaders (io.kestra.plugin.snowflake or io.kestra.plugin.gcp.bigquery) to ingest verified files immediately into data landing tables.
  • Integrate PagerDuty via io.kestra.plugin.pagerduty for high-severity on-call escalation when critical queue depth breaches occur.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.