New to Kestra?
Use blueprints to kickstart your first workflows.
Audit FTPS file drops for partner ingestion stalls, alert Slack on SLA queue backlog breaches, and automate quarantine isolation for stale EDI files.
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.
periodic_schedule) initiates the diagnostic audit cycle every 30 minutes, with on-demand manual runs supported via configurable inputs.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.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.route_by_health_status) directs execution along dedicated branches according to classified severity.CRITICAL_BACKLOG, a structured Slack incident card notifies operations channels with queued file counts, endpoint host, and oldest file age.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.log_audit_summary) commits an immutable log record capturing execution ID, file counts, and remediation outcomes.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.
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.FTPS_USERNAME, FTPS_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.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
/incoming and /quarantine on the server and place test .edi or .csv files in /incoming.dry_run: true to test the probe and classification logic safely.auto_quarantine: true and enable periodic_schedule to activate automated background sentinel monitoring.io.kestra.plugin.scripts.shell.Commands with ClamAV before quarantine movement.io.kestra.plugin.snowflake or io.kestra.plugin.gcp.bigquery) to ingest verified files immediately into data landing tables.io.kestra.plugin.pagerduty for high-severity on-call escalation when critical queue depth breaches occur.