New to Kestra?
Use blueprints to kickstart your first workflows.
Detect stale Meilisearch content with Kestra. Fetch a sentinel document, compare its updated_at age against a limit, and alert Discord when it is stale.
An index that answers queries is not necessarily an index that is up to date. When the ingest pipeline silently stops, search keeps working on old content and nobody notices until a user searches for a page published last week. This blueprint measures freshness directly: the ingest pipeline upserts a sentinel document with an updated_at timestamp on every run, and this probe fetches it with io.kestra.plugin.meilisearch.DocumentGet, computes its age in Python, and alerts Discord the moment the age exceeds your budget.
get_sentinel (io.kestra.plugin.meilisearch.DocumentGet) fetches the sentinel by the sentinel_document_id input from the docs_site index. The document is exposed as a JSON object at {{ outputs.get_sentinel.document }}.check_freshness (io.kestra.plugin.scripts.python.Script on the Process task runner) receives the scalar updated_at field and the max_age_hours input through environment variables, computes the age, and emits is_stale and age_hours through Kestra's output protocol.check_stale (io.kestra.plugin.core.flow.If) branches on {{ outputs.check_freshness.vars.is_stale }}: a Discord alert with the exact age and limit when stale, a log line with the same numbers when fresh.errors block posts a distinct Discord alert when the probe itself fails, which includes the telling case of a missing sentinel after an index rebuild.Schedule trigger runs the probe hourly.The freshness check is three small steps that need to run every hour, share data, branch on a verdict, and alert reliably. Kestra wires the document fetch into the Python comparison through outputs, evaluates the boolean with a declarative If, and keeps every probe in the execution history, so you can also see how close the pipeline typically runs to its budget.
updated_at field, as suggested in the docs site ingest blueprint.MEILISEARCH_URL: Meilisearch connection URL, e.g. https://meilisearch.internal:7700.MEILISEARCH_KEY: Meilisearch API key with document read permissions.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.docs-freshness-sentinel and a current updated_at timestamp on every run.disabled: false on the hourly trigger.io.kestra.plugin.core.execution.Fail so freshness shows up in dashboards, as the search canary blueprint does for hit counts.ForEach.Subflow task.age_hours to the KV store on every run to chart freshness drift over time.