Webhook icon
Schedule icon
StructuredOutputCompletion icon
Parallel icon
Queries icon
Log icon
If icon
SlackIncomingWebhook icon

Automate Customer Feedback Triage, Sentiment Analysis, and Escalation with Google Gemini and Slack

Triage customer feedback, classify sentiment with Google Gemini, store metrics in DuckDB, and escalate urgent issues to Slack automatically.

Categories
AIBusinessData

Automate the end-to-end classification, analytics tracking, and escalation of incoming customer feedback. This blueprint uses Google Gemini structured output to extract sentiment, urgency, and categorization from unstructured user reviews or support tickets. It persists every evaluation to an embedded DuckDB database for historical analytics while immediately notifying customer success channels on Slack whenever an urgent issue or high-tier account requires attention.

How it works

  1. Trigger & Inputs: The flow triggers either via a Webhook from your application/Zendesk/Typeform or through scheduled polling. Default inputs allow interactive testing directly from the Kestra UI.
  2. AI Analysis: The analyze_sentiment_and_topics task (io.kestra.plugin.gemini.StructuredOutputCompletion) prompts Google Gemini using a strict JSON Schema, ensuring output fields like sentiment, urgency_score, category, and action_item are returned as typed variables.
  3. Parallel Persistence & Logging: The process_and_persist task (io.kestra.plugin.core.flow.Parallel) concurrently writes the analytical record into DuckDB (io.kestra.plugin.jdbc.duckdb.Queries) and logs key metrics to the Kestra execution console (io.kestra.plugin.core.log.Log).
  4. Smart Escalation Gate: The check_escalation conditional task (io.kestra.plugin.core.flow.If) inspects the model's urgency score and account tier. If the urgency is 7 or higher, or if the customer is on an Enterprise plan, it immediately routes an alert to Slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).

What you get

  • Zero-friction sentiment analysis without maintaining separate microservices.
  • Guaranteed structured JSON output powered by Google Gemini schema enforcement.
  • Instant historical reporting in DuckDB with zero database configuration.
  • SLA-protecting escalations routed to on-call customer engineering teams via Slack.

Who it's for

  • Customer Support and Success operations looking to automate high-priority ticket routing.
  • Product Managers tracking sentiment trends across releases and feature launches.
  • Data Engineers seeking a turnkey, event-driven sentiment pipeline.

Why orchestrate this with Kestra

Standalone LLMs cannot connect webhooks to databases or notify team channels. Kestra provides the orchestration backbone: reliable secrets management, parallel task execution, conditional routing, and granular execution lineage. If an external service is temporarily unavailable, Kestra handles retries automatically with full auditability.

Inputs

  • customer_id (STRING, default: "CUST-9842"): Unique identifier of the customer submitting feedback.
  • customer_tier (STRING, default: "Enterprise"): Subscription tier of the user (Enterprise, Business, or Free).
  • feedback_text (STRING): Raw customer feedback or support ticket text.

Expected outputs

  • outputs.analyze_sentiment_and_topics.predictions: Structured JSON array containing sentiment, urgency_score, category, summary, and action_item.
  • DuckDB table feedback_analytics: Persistent table populated with feedback metrics and timestamps.

Prerequisites

  • A Google Gemini API key.
  • A Slack incoming webhook URL for notifications.

Secrets

  • GEMINI_API_KEY: API key for Gemini inference.
  • SLACK_WEBHOOK: Incoming webhook URL for the destination Slack channel.
  • WEBHOOK_KEY: Secret authentication key for the Kestra webhook trigger.

Quick start

  1. Set the required secrets (GEMINI_API_KEY, SLACK_WEBHOOK, WEBHOOK_KEY) in your Kestra namespace.
  2. Import or paste this blueprint flow into your Kestra instance.
  3. Execute the flow manually to test triage and verify persistence in DuckDB.
  4. Configure your feedback intake webhook or enable the schedule trigger for continuous processing.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.