New to Kestra?
Use blueprints to kickstart your first workflows.
Classify batches of tickets or logs with a local Ollama model in Kestra. One task loops over every line, writes a CSV artifact, and reports counts to Slack.
Nightly triage is the classic case where cloud LLMs are hardest to justify: hundreds of items, each containing customer text you would rather not send to a third party, multiplied by per-token pricing. This blueprint runs the whole batch through one io.kestra.plugin.ollama.cli.OllamaCLI task instead. A small shell loop inside commands feeds each line of the input file to a local model, collects one label per line into a CSV, and the model loads into memory once for the entire batch rather than once per item.
classify_batch receives the ticket list as an inline inputFiles entry, one ticket per line.while read loop: for each line, ollama run {{ inputs.model }} gets a prompt that names the three allowed categories and demands only the category name back, and the result is appended to classified.csv next to the quoted ticket text.wc -l and prints the count through Kestra's ::{"outputs": {...}}:: protocol, exposing it as {{ outputs.classify_batch.vars.classified_count }}.outputFiles uploads classified.csv to internal storage as a downloadable execution artifact.enableModelCaching: true persists the model between nightly runs, so the batch starts classifying immediately instead of re-downloading the model.notify posts the count to Slack and points at the artifact; the errors block alerts on failure. A disabled-by-default Schedule trigger runs the triage nightly at 01:00.A cron job running this loop would work until the night it does not, and nobody would know which line broke or how many items were labeled. Kestra wraps the same shell loop with an input file it versions, an artifact it stores, a count it types, a schedule it owns, and an alert that fires when the batch dies at 01:00 instead of a silent empty CSV at 09:00.
containerImage runs Ollama inside Docker, so the Kestra worker needs access to a Docker daemon. On self-hosted workers that already have Ollama installed locally, set the task's taskRunner to Process to use the local install directly.SLACK_WEBHOOK_URL: Slack incoming webhook URL.SLACK_WEBHOOK_URL secret to your Kestra namespace.classified.csv should pair each sample line with bug, billing, or feature.tickets.txt with a real export and set disabled: false on the nightly trigger.inputFiles instead of the inline sample.