FacetSearch icon
DiscordIncomingWebhook icon
Schedule icon

Weekly Typesense Faceted Merchandising Report to Discord

Build a weekly merchandising digest from Typesense facet counts with Kestra. FacetSearch by brand posts assortment coverage to Discord.

Categories
BusinessData

Merchandisers plan against the catalog they think they have; the search index is the catalog customers actually see. This blueprint reads the assortment straight from Typesense every week. io.kestra.plugin.typesense.FacetSearch runs a match-all query over the products collection with facetBy: brand, producing the searchable product count as a scalar and the per-brand distribution as a stored file. Discord gets the headline before the Monday merchandising sync.

How it works

  1. facet_by_brand (io.kestra.plugin.typesense.FacetSearch) sends query: "*" with queryBy: name and facetBy: brand against the products collection. Typesense returns facet counts per brand alongside the match count.
  2. The task exposes {{ outputs.facet_by_brand.totalHits }}, the number of searchable products, as a scalar, and writes the full result including the facet distribution to internal storage at {{ outputs.facet_by_brand.uri }}.
  3. digest posts the headline count to Discord and points readers at the execution's Outputs tab for the per-brand breakdown; only the scalar is interpolated into the JSON payload.
  4. The errors block posts a distinct Discord alert when the search fails, so a missing Monday digest is a signal, not a mystery.
  5. A disabled-by-default Schedule trigger runs the report every Monday at 08:00.

The connection uses the Typesense default port 8108 as a plain value and https: false for a local or private-network cluster; set https: true when your production cluster terminates TLS.

What you get

  • An assortment overview computed from the index customers search, not from a warehouse export.
  • The searchable product count in Discord every week, with the full facet file attached to the execution.
  • A one-property switch from brand to any faceted field: category, price range, availability.
  • A failure alert so the digest never silently disappears from the channel.

Who it's for

  • Merchandising teams who want a weekly pulse on brand and category coverage.
  • E-commerce managers watching for assortment drift after catalog imports.
  • Search engineers giving business stakeholders visibility into the index without granting cluster access.

Why orchestrate this with Kestra

The facet query is one API call; the report is everything around it. Kestra schedules the call, stores the full facet result durably per execution, feeds the scalar into a notification, alerts when the query fails, and keeps a week-over-week history you can scroll back through. Changing the audience from Discord to email or Slack is a task swap, not a rewrite.

Prerequisites

  • A running Typesense cluster with a populated products collection whose schema facets brand; the nightly catalog index blueprint creates it.
  • A Discord incoming webhook for the digest and failure alerts.

Secrets

  • TYPESENSE_HOST: hostname or IP of the Typesense node or load balancer.
  • TYPESENSE_API_KEY: an API key with search access to the collection.
  • DISCORD_WEBHOOK_URL: Discord incoming webhook URL.

Quick start

  1. Add the three secrets to your Kestra namespace.
  2. Execute the flow and check the Discord message reports the searchable product count.
  3. Open the execution's Outputs tab and download the facet file to see the per-brand counts.
  4. Set disabled: false on the weekly trigger.

How to extend

  • Facet by category or by both fields with facetBy: brand,category to widen the overview.
  • Add a filter such as in_stock:true so the digest reflects sellable assortment only.
  • Feed {{ outputs.facet_by_brand.uri }} into a Python task that renders the top brands into the message itself.
  • Pair with the out-of-stock sweep blueprint to contrast total assortment with unavailable products.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.