Schedule icon
If icon
SetVariables icon
List icon
Labels icon
Switch icon
SlackIncomingWebhook icon
Move icon
Log icon

SMB Share Ingestion Stall and Quarantine Sentinel

Audit enterprise SMB network shares for pipeline stalls, isolate zero-byte files to quarantine folders, and dispatch Slack alerts before downstream ETL fails.

Categories
Infrastructure

Enterprise batch processing across banking, healthcare, and retail frequently depends on shared Windows and CIFS network storage (SMB) to exchange scheduled transactions, billing data, and partner data drops. When upstream partners fail to deliver expected files or drop incomplete zero-byte payloads, downstream ELT and analytical workloads either fail abruptly or execute against partial data.

This sentinel workflow automates the health verification of SMB network shares. It periodically scans target directories using the Kestra SMB plugin, assesses file counts and payloads against expected delivery windows, classifies pipeline health into tri-state operating tiers (CRITICAL_STALL, WARNING_CORRUPT, or HEALTHY), dispatches actionable Slack incident notifications with root-cause context, isolates problematic files into designated quarantine folders, and records an immutable audit ledger entry.

How it works

  1. A periodic Schedule trigger wakes the workflow every 15 minutes to inspect the designated SMB incoming directory.
  2. The workflow executes io.kestra.plugin.fs.smb.List to retrieve all files matching the configured regular expression pattern, sorting entries chronologically.
  3. An execution Labels task evaluates discovered files against expected arrival thresholds and file integrity metrics, assigning an operational status tier.
  4. A Switch flow-control task routes execution based on the evaluated health tier.
  5. In the event of a missing feed or stalled arrival, a critical Slack incident notification is dispatched via io.kestra.plugin.slack.notifications.SlackIncomingWebhook.
  6. When corrupt or malformed files are detected, an automated Move task transfers the offending file out of the active ingestion path into a quarantine directory to prevent downstream pipeline crashes.
  7. A final Log task outputs structured audit telemetry summarizing inspected file counts, execution timestamps, and remediation actions.

What you get

  • Automated continuous probing of enterprise SMB and CIFS network shares without requiring manual engineer check-ins.
  • Proactive detection of stalled upstream ingestion feeds before downstream analytics models or data warehouse pipelines execute.
  • Automated file quarantine isolation preventing corrupt, truncated, or zero-byte files from crashing production ETL workflows.
  • Immediate multi-tiered Slack alerts with execution references and diagnostic share metadata.
  • Comprehensive audit logs tracking every inspection cycle and remediation step for operational compliance.

Who it's for

  • Data Engineers managing legacy file-based ETL pipelines reliant on SMB, CIFS, or Windows network storage.
  • Platform and Infrastructure Engineers responsible for shared storage gateways, NAS appliances, and enterprise file servers.
  • Site Reliability Engineers needing automated health gates and incident response mechanisms for partner file exchanges.

Why orchestrate this with Kestra

  • Declarative YAML orchestration replaces fragmented cron jobs, PowerShell scripts, and ad-hoc batch scripts with maintainable workflows.
  • Built-in SMB and CIFS task primitives (List, Move, Download, Upload) eliminate external driver installations and complex SMB mounting.
  • Centralized secret management securely masks network share credentials and webhook tokens.
  • Native execution state tracking and audit histories provide complete visibility into every file inspection and quarantine event.

Prerequisites

  • Access to an SMB/CIFS file server, Windows File Share, or Samba container reachable over TCP port 445.
  • A service account with read and write permissions to the monitored share directories.
  • An incoming Slack webhook URL for alert routing.

Secrets

  • SMB_PASSWORD: Service account password for authenticating to the SMB network share (required).
  • SLACK_WEBHOOK_URL: Incoming webhook URL for posting incident notifications to the storage operations channel (required).

Quick start

  1. Configure the SMB_PASSWORD and SLACK_WEBHOOK_URL secrets in your Kestra namespace.
  2. Import this blueprint into your Kestra instance.
  3. Execute the flow with default inputs (simulate_local_mode: true) to verify the workflow logic, triage routing, and logging outputs without connecting to an external share.
  4. Set simulate_local_mode: false, update smb_host and smb_share_path to point to your production SMB server, and activate the scheduled trigger.

How to extend

  • Add an automated PagerDuty or Opsgenie alert task inside the CRITICAL_STALL branch for off-hours escalation.
  • Integrate downstream ETL flow triggers via io.kestra.plugin.core.flow.SubflowExecution to automatically launch data warehouse ingestion once the SMB health check confirms a healthy batch.
  • Implement file checksum verification by downloading verified files into Kestra internal storage and calculating SHA-256 hashes before ingestion.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.