Weekly zero-result search digest in Slack and Sheets

By General Input

Every Monday at 9am, get the top 25 site searches that returned nothing in Slack, with a running history logged to Google Sheets.

Integrations

  • Elasticsearch
  • Slack Bot
  • Google Sheets

Type

Deterministic Code

Categories

  • Product
  • Operations

Every Monday at 9am, run a weekly zero-result search digest. This is a deterministic code workflow with no reasoning step. The query shape, ranking, and destinations are all fixed.

Trigger: cron, every Monday at 9am in the workflow owner's local timezone.

Step 1. Pull zero-result events from Elasticsearch. Use the Elasticsearch Search Documents (Query Index) operation against a configured search-events index (index name should be a workflow input, default to something like `search-events-*`). Use a date range filter on the event timestamp for the last 7 days (gte now-7d/d, lt now/d). Filter to events where the result count field equals 0 (assume the field is `hits_total`, but expose it as an input in case the user's schema uses a different field like `result_count` or `total_hits`). Aggregate by the query-string field (assume `query.keyword`, also expose as an input) with a terms aggregation, size 25, ordered by doc_count descending. Set the top-level `size` to 0 since we only need the aggregation buckets, not raw hits.

Step 2. Format the top 25 buckets into a ranked table with three columns: rank (1 through 25), query text, count. Compute the human-readable date range string (e.g. `May 19 to May 25, 2026`) from the trigger time so it can be stamped on both outputs.

Step 3. Post the table to Slack via the Slack Bot Send a Message operation. Channel is a workflow input. Use Slack mrkdwn formatting: a short header line that includes the date range ("Zero-result searches, May 19 to May 25, 2026, top 25") and the table rendered as a fixed-width code block so columns line up. If there are fewer than 25 zero-result queries that week, post however many exist and note the count. If there are zero, post a brief "No zero-result searches this week" message instead of an empty table.

Step 4. Append the same rows to Google Sheets via the Append Values operation. The spreadsheet id and tab name are workflow inputs. Append one row per ranked query with these columns in order: run_date (the Monday the workflow runs, ISO date), period_start, period_end, rank, query, count. Use valueInputOption USER_ENTERED so the dates are stored as real dates. Do not write a header row; assume the user has set the header up once when they configured the sheet.

Workflow inputs to expose: Elasticsearch index pattern, query-string field name, result-count field name, Slack channel, Google Sheets spreadsheet id, Google Sheets tab name.

Use the `elasticsearch` integration for the search step, the `slackbot` integration for the Slack post, and the `google-sheets` integration for the append. No AI/reasoning node is needed anywhere in this workflow.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery board