New to Kestra?
Use blueprints to kickstart your first workflows.
Triage support tickets with Mistral structured output in Kestra. A JSON schema enforces category and severity, and high severity tickets page Discord.
LLM triage is only automatable if the output shape is guaranteed. This blueprint passes a JSON schema to io.kestra.plugin.mistral.ChatCompletion through jsonResponseSchema, so the Mistral API itself constrains the response to an object with category, severity, and summary, with enums on the first two and no additional properties. Whatever the ticket text says, it cannot change the output structure, which makes the downstream If branch a safe, deterministic router.
triage (io.kestra.plugin.mistral.ChatCompletion) sends the ticket as a USER message with a SYSTEM message that frames the task and tells the model to treat ticket text as data. The jsonResponseSchema property wraps the schema as response_format.type=json_schema, so the API returns a schema valid JSON string in {{ outputs.triage.response }}.parse_triage (io.kestra.plugin.scripts.python.Script on the Process runner) receives the JSON through an environment variable, parses it, and emits category, severity, and summary as scalar outputs via Kestra's outputs protocol.route (io.kestra.plugin.core.flow.If) checks {{ outputs.parse_triage.vars.severity == 'high' }}. High severity tickets page Discord with the parsed scalars; everything else lands in the execution log.errors block posts a distinct Discord alert when classification or parsing fails.The hard part of LLM triage is not the API call, it is everything around it: keeping the key in a secret store, retrying transient failures, branching on the result, and proving after the fact why a ticket was or was not escalated. Kestra declares all of that in one YAML flow, and every execution records the exact model response next to the routing decision it produced.
MISTRAL_API_KEY: Mistral API bearer token.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.ticket_text and confirm it only logs.product_area or language to the schema and the parser.{{ outputs.parse_triage.vars.severity }}.