New to Kestra?
Use blueprints to kickstart your first workflows.
Purge the Fastly edge cache automatically when a deploy goes live with Kestra. Soft-purge the page URL and surrogate keys, then confirm to Slack.
A deployment is not done when the pipeline turns green, it is done when the edge serves the new version. Fastly caches aggressively by design, so a release that ships without an invalidation step keeps serving the previous HTML and assets until TTLs expire. This blueprint closes that gap: the CD pipeline calls a Kestra webhook the moment a release is live, and the flow soft-purges both the deployed page URL through io.kestra.plugin.fastly.purge.Url and the surrogate keys the release touched through io.kestra.plugin.fastly.purge.Keys, then posts the purge IDs to Slack. Soft purge marks objects stale instead of deleting them, so the edge revalidates against origin rather than stampeding it, which makes it the safer default for deploy-time invalidation.
on_deploy (io.kestra.plugin.core.trigger.Webhook) listens for an HTTP call from the CD system. Replace the placeholder key with a strong random value before deploying, since it guards the endpoint.purge_page (io.kestra.plugin.fastly.purge.Url) purges the URL from the webhook body, falling back to the page_url input when the body carries none, with soft: true. Its status and id outputs feed the confirmation message.purge_surrogates (io.kestra.plugin.fastly.purge.Keys) splits the comma-separated surrogate_keys input and purges all keys in one batch call against service_id. Its purgeIds output maps each key to its purge ID.notify posts the purged URL, purge status and ID, and the number of surrogate keys invalidated to Slack.errors block posts a distinct Slack alert when any purge call fails, because a stale edge after a deploy fails silently otherwise.Fastly has no concept of a deployment, its cache clears on TTL or an API call someone remembers to make. Kestra turns the purge into an event-driven, observable step: the webhook trigger connects any CD system, retries cover transient API failures, outputs from the purge tasks flow straight into the Slack confirmation, and every invalidation is recorded in the execution history next to the release that caused it.
Surrogate-Key response header, so key-based purges have something to match.FASTLY_API_TOKEN: Fastly API token with purge scope.SLACK_WEBHOOK_URL: Slack incoming webhook URL.key with a strong random value.service_id, page_url, and surrogate_keys to match your Fastly service.url field in the JSON body.purge.Url over them with io.kestra.plugin.core.flow.ForEach.io.kestra.plugin.core.http.Request to confirm the page serves the new build.soft: false for content that must disappear immediately, such as takedowns.