Neo4j Duplicate Relationship Cleanup Guard
Find Neo4j node pairs joined by more than one relationship of the same type, alert Slack, delete the surplus edges after approval, then re-count and fail if any pair is still duplicated.
Elasticsearch retention that never loses data. Kestra snapshots each expired index, checks every shard, then deletes it by exact name. Write index protected.
Retention policies delete old indices. When someone later needs last quarter's logs for an audit or an incident review, the data is gone. This flow archives each expired index to a snapshot repository first, checks that the snapshot is SUCCESS with every shard copied and only then deletes that one index, by its exact name.
Safeguards:
_verify stops the run before anything is touched.max_indices_per_run caps the damage of a wrong pattern or retention value.action.destructive_requires_name: true stays on.io.kestra.plugin.elasticsearch.Request reports success on any HTTP status, so the flow checks every status code and the snapshot body itself.This blueprint was created by zkasuran.
cluster_health and verify_repository (io.kestra.plugin.elasticsearch.Request) read _cluster/health and call POST _snapshot/<repository>/_verify.preflight (io.kestra.plugin.core.flow.If) continues only on a non-red cluster and a verified repository. Otherwise preflight_failed ends the run as FAILED with both responses.list_indices reads index.creation_date for every index matching index_pattern. write_index resolves the write alias.plan (io.kestra.plugin.core.output.OutputValues) selects indices created before now minus retention_days, oldest first. selected removes the write index and applies max_indices_per_run.archive_and_delete (io.kestra.plugin.core.flow.Loop, one at a time) handles each index:snapshot: PUT _snapshot/<repository>/retention-<index>-<timestamp>?wait_for_completion=true for that index only.snapshot_ok (If): state SUCCESS, shards.failed == 0 and successful == total. Then delete_index sends DELETE <index> and checks for HTTP 200 and acknowledged: true.Fail. The index is kept.log_done lists what was archived and deleted. errors posts a Slack alert when notify_slack is on.index_pattern (STRING, default app-logs-*): indices covered by the policy.write_alias (STRING, default app-logs-write): its write index is always kept.retention_days (FLOAT, default 30): age in days, based on index.creation_date.snapshot_repository (STRING, default retention_repo): a registered snapshot repository.max_indices_per_run (INT, default 10): safety cap.notify_slack (BOOL, default false): post results to Slack.PUT _snapshot/retention_repo {"type": "s3", "settings": {"bucket": "es-archive"}}.monitor, manage_snapshots, view_index_metadata and delete_index on the pattern.ELASTICSEARCH_HOST: cluster URL, for example https://es.example.com:9200.ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD: the user above.SLACK_WEBHOOK_URL: Slack incoming webhook. Only needed when notify_slack is true.retention_days such as 0.001 and max_indices_per_run: 1. One index is snapshotted, then deleted.POST _snapshot/<repository>/<snapshot>/_restore {"indices": "<index>"}.retention-<index>-<yyyyMMdd-HHmmss>, with metadata.kestra_execution set to the execution id.outputs.selected.values.indices: the indices archived and deleted in this run.retention_days.