dropbox icon
Script icon
Upload icon
SlackIncomingWebhook icon
Schedule icon

Weekly report generation and distribution to Dropbox

Generate a weekly CSV report in Python, upload it to a dated Dropbox folder, and notify Slack. Scheduled, idempotent, with retries and failure alerts.

Categories
Business

Automate weekly report distribution to Dropbox with Kestra. This blueprint builds a sales report with Python, publishes it to a shared Dropbox folder organized by date, and notifies the team on Slack the moment it lands. It solves the recurring problem of reports buried in inboxes or overwritten in place: every run keeps a clean, dated history in a predictable location, and consumers always know where the latest numbers live. The pipeline is re-run and backfill safe, so reprocessing a given week replaces that week's file instead of failing.

How it works

  1. generate_report runs an io.kestra.plugin.scripts.python.Script task on the ghcr.io/kestra-io/pydata container image, builds a sales summary with pandas, stamps it with the run date, and emits sales_report.csv as an outputFiles artifact.
  2. upload_report uses io.kestra.plugin.dropbox.files.Upload to push the CSV to {{ inputs.shared_folder }}/<run-date>/sales_report.csv. Upload creates the missing dated parent folder automatically, and mode: OVERWRITE keeps the run idempotent.
  3. notify_published posts an io.kestra.plugin.slack.notifications.SlackIncomingWebhook message with the exact Dropbox path so consumers know it landed.
  4. A flow-level errors block fires a second Slack alert if any step fails.
  5. A monday_morning_report trigger of type io.kestra.plugin.core.trigger.Schedule runs the flow every Monday at 08:00 America/New_York time.

What you get

  • A CSV report published to Dropbox in a per-run dated folder for clean history.
  • Idempotent re-runs and backfills via OVERWRITE and a date derived from trigger.date ?? execution.startDate.
  • Automatic parent-folder creation, so no separate folder step can conflict on a re-run.
  • Retries on every Dropbox and Slack call, plus a failure alert to the whole team.

Who it's for

  • Analytics and revenue-ops teams distributing recurring sales or KPI reports.
  • Data engineers who want a scheduled, auditable file-delivery pipeline.
  • Operations teams that consume reports from a shared Dropbox folder.

Why orchestrate this with Kestra

Dropbox stores files but has no scheduler, no retry logic, and no way to chain report generation, upload, and notification into one auditable run. Kestra fills that gap: an event-driven Schedule trigger drives the cadence, retry blocks absorb transient API failures, the errors block guarantees the team hears about failures, and full execution lineage shows exactly which file was produced and where it went. Everything is declarative YAML, version controlled, and re-runnable for any date.

Prerequisites

  • A Kestra instance with the Dropbox, Slack, and Python script plugins installed.
  • A Docker-compatible task runner for the Python report step.
  • A Dropbox app with write access to your shared folder.
  • An existing parent Dropbox folder path to hold the dated report folders.

Secrets

  • DROPBOX_ACCESS_TOKEN: Dropbox API access token used to upload the report.
  • SLACK_WEBHOOK: Slack incoming webhook URL used by both the success and failure notifications.

Quick start

  1. Add the DROPBOX_ACCESS_TOKEN and SLACK_WEBHOOK secrets to your namespace.
  2. Set the shared_folder input to the Dropbox path your team already uses.
  3. Replace the sample data in generate_report with your real query or data source.
  4. Enable the flow, or trigger it manually, and confirm the first report appears under a dated folder.

How to extend

  • Swap the pandas sample for a warehouse query (BigQuery, Snowflake, Postgres) exported to CSV.
  • Add Excel or PDF outputs alongside the CSV and upload them in the same run.
  • Change the cron to daily or monthly, or add a second Schedule for different cadences.
  • Route the Slack notification to a different channel, or add an email step for stakeholders.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.