Webhook icon
SetVariables icon
Request icon
ChatCompletion icon
Return icon
Labels icon
If icon
Log icon
SlackIncomingWebhook icon

AI-Powered GitHub Issue Triage and Routing with Slack Notifications

Triage GitHub issues with OpenAI structured JSON schema, tag execution observability, branch by category, apply GitHub labels, and notify Slack.

Categories
AIBusiness

Automate GitHub issue intake, structured AI classification, observability tagging, and conditional routing. Whenever a new GitHub issue is opened or triggered via webhook, this workflow:

  1. Extracts and normalizes issue details (title, description, author, repository).
  2. Retrieves current issue state and metadata via the GitHub REST API.
  3. Classifies the issue with OpenAI into structured JSON (category, short_summary, priority, reasoning).
  4. Tags the Kestra execution with searchable triage labels for observability.
  5. Branches using a flowable If condition to apply bug vs other category labels (enhancement, documentation, question, needs-triage).
  6. Dispatches a formatted Slack notification with rich issue context and direct links.
  7. Catches runtime failures with an automated Slack alert in the errors handler.

How it works

  1. Triggering: Listens for GitHub issues.opened webhook events using io.kestra.plugin.core.trigger.Webhook or processes manual inputs via Kestra UI.
  2. Normalization: extract_issue_data (io.kestra.plugin.core.execution.SetVariables) parses issue fields with null-safe defaults and resolves the dry_run toggle.
  3. Metadata Fetch: In live mode, fetch_issue_metadata (io.kestra.plugin.core.http.Request) verifies issue status via the GitHub REST API.
  4. AI Classification: classify_issue (io.kestra.plugin.openai.ChatCompletion) runs gpt-4o-mini with a strict jsonResponseSchema enforcing category, short_summary, priority, and reasoning. In dry-run mode, mock_classification (io.kestra.plugin.core.debug.Return) supplies a deterministic fixture with zero external API calls.
  5. Parsing & Validation: parse_and_validate_ai_response (io.kestra.plugin.core.execution.SetVariables) safely parses JSON with raw is json guards and resolves target label names.
  6. Observability: tag_execution (io.kestra.plugin.core.execution.Labels) attaches repository, issue, category, and priority to the execution for UI filtering.
  7. Branching & Actions: branch_on_classification (io.kestra.plugin.core.flow.If) applies bug label for bug categories vs categorized labels (enhancement, documentation, question, needs-triage) for other categories via GitHub REST API (io.kestra.plugin.core.http.Request).
  8. Alert Delivery: send_slack_notification (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) formats a rich Slack Block Kit alert with direct action buttons.
  9. Error Handling: An errors block catches unhandled runtime failures and posts diagnostic alerts to Slack.

What you get

  • Real-time automated issue triage reducing maintainer backlog response time to seconds.
  • Deterministic structured output from OpenAI using strict JSON schema validation.
  • Zero external API dependency in dry-run mode (dry_run: true) for rapid offline testing.
  • Dynamic Kestra execution tagging for instant dashboard filtering by category and priority.
  • Enterprise Slack Block Kit cards with interactive links directly to the triaged GitHub issue.

Who it's for

  • Open source maintainers handling high-volume issue intake.
  • Engineering teams seeking automated issue categorization, labeling, and escalation.
  • DevOps and Platform engineers building event-driven triage pipelines.

Why orchestrate this with Kestra

Kestra coordinates webhooks, HTTP retries, LLM schemas, dynamic execution labels, conditional branching, and Slack notifications in declarative version-controlled YAML. It provides built-in auditability, retry policies on external calls, and local dry-run simulation without complex custom microservices.

Prerequisites

  • A running Kestra instance with OpenAI and Slack plugins enabled.
  • A GitHub Personal Access Token with issues:write permissions.
  • An OpenAI API Key with access to chat completion models.
  • A Slack Incoming Webhook URL for the target channel.

Secrets

  • GITHUB_WEBHOOK_KEY: Secret key to authenticate incoming GitHub webhook requests.
  • GITHUB_TOKEN: GitHub Personal Access Token or GitHub App token with issues:write permissions.
  • OPENAI_API_KEY: OpenAI API key for chat completion models.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for alerts.

Inputs

  • repo_owner (STRING, default: kestra-io): GitHub repository owner.
  • repo_name (STRING, default: kestra): GitHub repository name.
  • issue_number (INT, default: 1001): GitHub issue number to triage.
  • issue_title (STRING, default: App crashes when clicking submit button on settings page): Issue title.
  • issue_body (STRING): Issue body for AI analysis.
  • issue_url (STRING, default: https://github.com/kestra-io/kestra/issues/1001): Direct URL to the GitHub issue.
  • issue_author (STRING, default: community-contributor): GitHub author username.
  • dry_run (BOOL, default: false): When true, executes entirely locally with zero external API calls.

Outputs

  • outputs.extract_issue_data: Normalized issue parameters and dry-run flag.
  • outputs.classify_issue: Raw OpenAI ChatCompletion response (in live mode).
  • outputs.mock_classification.value: Simulated triage response (in dry-run mode).
  • outputs.parse_and_validate_ai_response: Validated category, priority, summary, reasoning, and target label.

Quick start

  1. Configure secrets GITHUB_WEBHOOK_KEY, GITHUB_TOKEN, OPENAI_API_KEY, and SLACK_WEBHOOK_URL.
  2. Import this flow into Kestra.
  3. Run a zero-API test execution with dry_run: true to verify end-to-end normalization, parsing, labeling, and branching.
  4. To enable live triage, set dry_run: false or point your GitHub repository webhook to the Kestra webhook URL.

How to extend

  • Add duplicate issue detection by querying GitHub issues before classification.
  • Extend classification_categories in variables: with custom labels (e.g. security, performance).
  • Add PagerDuty or Opsgenie escalation for CRITICAL priority issues in parallel with Slack.

Common pitfalls

  • Missing trailing slash in API base: Ensure github_api_base does not contain a trailing slash.
  • Webhook query parameters: In Kestra webhooks, query parameters are parsed as lists; this blueprint handles (trigger.parameters.dry_run | first) safely.
  • Unchecked JSON parsing: Ensure all AI response extraction is guarded by raw is json checks.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.