New to Kestra?
Use blueprints to kickstart your first workflows.
Archive a full OpenSearch index with Kestra. Scroll streams every document to a file in internal storage and Slack gets the row count monthly.
A plain search caps out at the result window; archiving an index means walking all of it. This blueprint uses io.kestra.plugin.opensearch.Scroll, which pages through the complete result set behind one task, with the scroll export, so every document streams into a file in Kestra's internal storage instead of worker memory. Slack gets the row count when the export lands, and the file itself stays attached to the execution.
export_index (io.kestra.plugin.opensearch.Scroll) runs a match_all query against the app-logs index. The scroll API pages through every hit, and the scroll export writes the rows to internal storage, exposing {{ outputs.export_index.uri }} for downstream tasks and {{ outputs.export_index.size }} as the row count.notify posts the row count to Slack and notes that the file stays on the execution, in the Outputs tab, so nobody hunts for a path.errors block posts a distinct Slack alert on failure, making a missing archive explicit.Schedule trigger runs the export on the first of every month at 05:00.An export script has to manage scroll cursors, buffer to disk, land the file somewhere durable, and report completion; this flow declares all four. Internal storage ties the artifact to the execution that produced it, so every archive is traceable to a date, a query, and a row count. Rerunning a failed month is one click, and downstream flows can consume the URI output without knowing how it was produced.
app-logs by default.OPENSEARCH_HOST: OpenSearch endpoint, for example https://opensearch.example.com:9200.OPENSEARCH_USERNAME: OpenSearch username.OPENSEARCH_PASSWORD: OpenSearch password.SLACK_WEBHOOK_URL: Slack incoming webhook URL.indexes at the index you want to archive.disabled: false on the monthly trigger.match_all to a range on @timestamp to export only the closing month.{{ outputs.export_index.uri }} to an upload task.io.kestra.plugin.opensearch.Load pointed at the stored file.