Schedule icon
CreateFlowRun icon
Send icon

Trigger Prefect flow weekly and send email notification

Schedule a Prefect deployment every seven days from Kestra, wait for it to complete, then send an email notification through Resend with run details.

Categories
System

Schedule and supervise a Prefect Cloud deployment from Kestra, then notify your team the moment it finishes. This blueprint triggers a Prefect flow run on a weekly cadence, blocks until the run completes, and sends a confirmation email through Resend. It solves the common gap where a Prefect deployment runs in isolation and stakeholders have no clear, timely signal that the weekly job succeeded.

How it works

  1. A io.kestra.plugin.core.trigger.Schedule trigger named weekly fires on the cron expression 0 0 */7 * *, starting an execution every seventh day.
  2. The trigger_prefect_run task (io.kestra.plugin.prefect.CreateFlowRun) calls Prefect Cloud at https://api.prefect.cloud/api and launches the configured deploymentId. With wait: true and pollFrequency: PT10S, Kestra polls every ten seconds and holds the execution open until the Prefect flow run finishes.
  3. The send_email task (io.kestra.plugin.resend.email.Send) sends an HTML email through Resend to the configured recipient, embedding the deployment id, the originating {{ flow.namespace }}.{{ flow.id }}, and the {{ execution.id }}.

What you get

  • A hands-off weekly run of any Prefect deployment, scheduled and tracked in Kestra.
  • Synchronous waiting so downstream steps only run after Prefect reports completion.
  • An email confirmation with execution context for auditability and quick follow-up.
  • A single declarative file you can version, review, and reuse across environments.

Who it's for

  • Data and platform teams running Prefect who want a central scheduler and clear notifications.
  • Teams migrating from or coexisting with Prefect that need cross-tool orchestration.
  • On-call engineers who want a timely signal that a weekly batch job has finished.

Why orchestrate this with Kestra

Prefect's own scheduler can launch a deployment, but it cannot natively wait on that run and then fan out to an unrelated notification system like Resend in one declarative pipeline. Kestra adds event and schedule triggers, built-in retries, execution lineage across both Prefect and Resend, and a single YAML definition that lives in source control. You get one place to schedule, observe, and react to the run rather than stitching together Prefect automations and a separate email script.

Prerequisites

  • A Prefect Cloud account with an existing deployment.
  • A Resend account and a verified sending domain or address.

Secrets

  • PREFECT_ACCOUNT_ID
  • PREFECT_WORKSPACE_ID
  • PREFECT_DEPLOYMENT_ID
  • PREFECT_API_KEY
  • RESEND_API_KEY

Quick start

  1. Add the secrets above to your Kestra instance.
  2. Update the from and to addresses in the send_email task to your verified Resend domain and team recipients.
  3. Save the flow and trigger it manually once to confirm the Prefect run launches and the email arrives.
  4. Leave the weekly schedule enabled to run it automatically every seven days.

How to extend

  • Swap the Schedule cron for a different cadence, or add an io.kestra.plugin.core.trigger.Flow trigger to chain this after another pipeline.
  • Capture the Prefect run outputs and include status or metrics in the email body.
  • Replace or supplement Resend with Slack, Microsoft Teams, or PagerDuty notifications.
  • Add error handling so a failed Prefect run sends a distinct alert email.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.