New to Kestra?
Use blueprints to kickstart your first workflows.
Triage GitHub issues with OpenAI structured JSON schema and trigger actionable Slack alerts for critical and high-priority bugs while logging routine issues.
Automate triage for GitHub repositories with schema-constrained AI classification and intelligent alert routing.
This blueprint pulls recent issues via the GitHub REST API, filters out pull requests and truncates oversized
bodies, iterates through each issue using a controlled Loop, classifies severity and categorization via
OpenAI ChatCompletion backed by strict JSON Schema constraints, and routes only CRITICAL and HIGH priority
issues to your on-call Slack channel while recording routine issues in execution logs.
schedule_triage trigger (io.kestra.plugin.core.trigger.Schedule) executes every 2 hours
(shipped disabled: true for safe initial manual testing).fetch_issues (io.kestra.plugin.core.http.Request) queries GitHub's /issues endpoint for the
configured repository, passing Authorization: Bearer {{ secret('GITHUB_TOKEN') }}.filter_and_prepare_issues (io.kestra.plugin.scripts.python.Script) strips pull request entries,
caps body lengths at 3000 characters to prevent prompt injection or token bloat, bounds batch size by inputs.issue_limit,
and emits clean structured items.check_has_issues (io.kestra.plugin.core.flow.If) verifies whether any issues need evaluation;
if none are found, it skips downstream processing cleanly.triage_each_issue (io.kestra.plugin.core.flow.Loop) processes issues concurrently
(concurrencyLimit: 2):ai_classify_issue (io.kestra.plugin.openai.ChatCompletion) runs GPT-4o-mini with a strict jsonResponseSchema,
constraining model output to priority (CRITICAL, HIGH, MEDIUM, LOW), category, summary, and action_plan.check_urgent_priority (io.kestra.plugin.core.flow.If) safely inspects the parsed priority field.notify_slack_urgent (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) formats and sends an alert card
containing issue links, severity badges, and AI recommended next steps.MEDIUM and LOW) are logged via log_routine_triage without notifying Slack.triage_summary_log records cycle completion, and a flow-level errors handler
dispatches an alert to Slack if an unexpected failure occurs.CRITICAL and HIGH) interrupt engineers on Slack; routine tickets
and feature suggestions are triaged quietly in execution logs.A static webhook or cron script cannot safely enforce API rate limits, retry transient LLM timeouts, isolate loop iterations, and guard against malformed data. Kestra provides declarative flow orchestration: exponential HTTP retries, per-iteration concurrency controls, native secrets management, and detailed execution telemetry for every triaged issue.
issues:read permissions.gpt-4o-mini).GITHUB_TOKEN: GitHub personal access token used by fetch_issues (required).OPENAI_API_KEY: OpenAI API key used by ai_classify_issue (required).SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used by notify_slack_urgent and alert_triage_failure (required).github_owner (STRING, default: kestra-io): GitHub organization or username.github_repository (STRING, default: kestra): Repository name.issue_limit (INT, default: 5): Maximum issues evaluated per execution batch.issue_state (STRING, default: open): Issue state filter (open or all).ai_model (STRING, default: gpt-4o-mini): OpenAI model identifier.outputs.total_issues_inspected: Total number of GitHub issues processed.outputs.repository: Target repository path in owner/repo format.GITHUB_TOKEN, OPENAI_API_KEY, SLACK_WEBHOOK_URL).schedule_triage trigger in the flow editor to activate automated periodic triage.io.kestra.plugin.github.issues.Comment or a GitHub labels task to apply AI-derived
labels (bug, priority:high) back to GitHub.io.kestra.plugin.openai.ChatCompletion for io.kestra.plugin.ai.agent.AIAgent with
Google Gemini, Anthropic Claude, or local Ollama.CRITICAL issues to PagerDuty or Opsgenie in parallel with Slack notifications./issues route.
This blueprint handles this automatically in filter_and_prepare_issues by checking the presence of the pull_request key.GITHUB_TOKEN to ensure the 5,000 requests/hour authenticated quota.