Example: Turn docs analytics into doc-gap suggestions
This example teaches Promptless to turn your documentation-site analytics into prioritized doc-gap suggestions once a week. It’s an example of pairing a written workflow with a trigger as described in Teach Promptless a custom task. The review inbound documentation PRs example pairs that workflow with a GitHub PR trigger, while this one pairs it with a schedule trigger, which runs on a repeating clock with no triggering event. The steps below write the workflow, configure the trigger, then save the workflow, hook, and trigger.
The two analytics signals
Section titled “The two analytics signals”PostHog measures reader behavior on your docs site, including page traffic, exit rate, and site-search queries. This workflow reads two signals from that data:
- Recurring site-search queries that return zero results, which mean a reader is looking for a page that’s missing or doesn’t surface.
- High traffic combined with a high exit rate on an existing page, which means readers reach it but leave underserved.
Customize your workflows to the signals that matter most to your team.
Prerequisites
Section titled “Prerequisites”Before you set up this task, make sure you have:
- Access to PostHog, with its credentials stored as environment variables Promptless can read. The variable names are yours to choose, but this example references
POSTHOG_PROJECT_API_KEY,POSTHOG_PROJECT_ID, andPOSTHOG_HOST, all found in your PostHog project settings. - At least one active doc collection.
- The ability to chat with Promptless in Slack or Teams to make edits for you, or admin access to edit the Knowledge Base directly.
Set up the task
Section titled “Set up the task”Set up the task in three steps: write the workflow, configure the trigger, then save the workflow, hook, and trigger.
-
Write the workflow. The workflow captures how to read analytics and act on what it shows, like what to query, which signals matter, how to prioritize, and how much to open. Write the workflow body as a markdown file under
doc_workflows/in your Knowledge Base. For example,doc_workflows/analytics-docs-gaps.md. The following is an example body to adapt to your own analytics tool and docs:# Analytics-derived documentation gapsWhen the weekly analytics doc-gaps schedule runs:1. Scope every query to your documentation paths only — on-site analyticsfiltered to your docs URL prefix (for example, `promptless.ai/docs`).Never pull product analytics.2. Read two signals from the last 7 days:- **Recurring reader searches with no good answer** (site-searchqueries that return zero results). Each recurring instance is a readerasking for a page that does not exist or does not surface. A one-offsearch is noise, not a signal.- **Page-level performance** for existing docs pages: traffic and exitrate. High traffic combined with a high exit rate points to a pagereaders reach but leave without their answer.3. Prioritize what to act on:- Propose **new content** for recurring missing results. A reader istelling you a page is missing or isn't surfacing, which shows up as azero-result on-site search.- For **existing pages**, prioritize by traffic volume combined with howrecently the underlying feature changed, not by page age. A stable,correct old page needs no work.4. Redact before publishing. Never paste a raw search-query string or rawURL parameters into a suggestion title, description, or PR body — theycan carry customer names, internal identifiers, or tokens. Describe thegap in your own words.Then add an explicit “If, then” hook in
PROMPTLESS.mdthat points to this workflow, so it activates reliably (PROMPTLESS.mdis always loaded into the agent’s instructions, whereas the workflow file is loaded on demand):If the weekly analytics doc-gaps schedule runs, then follow the workflow in `doc_workflows/analytics-docs-gaps.md`.Alternatively, define the workflow as an Agent Skill living in a doc collection, like under
.claude/skills/analytics-docs-gaps/SKILL.mdinacme/docs. In that case thePROMPTLESS.mdhook must name that doc collection and skill:If the weekly analytics doc-gaps schedule runs, then use the `analytics-docs-gaps` skill from `acme/docs`. -
Configure the trigger. Add a schedule trigger so the workflow runs on a repeating clock. Create it in the dashboard: in the left sidebar, open Settings and select Configuration, open the Triggers tab, and choose Add a trigger. Choose the “On a schedule” group and its recurring-schedule catalog entry (see Schedule triggers for the full path), then set the schedule and timezone and write the instructions. Build the trigger in the Form view (the default). The YAML view shows the underlying
promptless.yaml, which looks like this:triggers:analytics-docs-gaps:trigger_type: schedulematch:- cron: "0 0 * * 1"timezone: America/Los_Angeles # optional; defaults to UTCinstructions: |Follow the weekly analytics doc-gaps workflow indoc_workflows/analytics-docs-gaps.md.The cron
0 0 * * 1with its timezone runs the workflow once a week, at midnight on Mondays. Keepinstructionsa short pointer to the workflow file. What you type into the dashboard’s instructions field is that same short pointer sentence, matching the YAMLinstructions. That differs from a schedule trigger whose standing instructions carry the whole job: here, they only point to the workflow file where the full judgment lives. You can pause or adjust the trigger later from the same Configuration > Triggers page. -
Save the workflow, hook, and trigger. The trigger is saved from the Configuration page in Step 2. Save the workflow file (
doc_workflows/analytics-docs-gaps.mdor the Agent Skill) and the “If, then” hook inPROMPTLESS.mdfrom the Agent Knowledge Base. There are two ways to do this:- An organization admin edits the files directly in the Agent Knowledge Base (in the left sidebar, open Settings and select Agent Knowledge Base).
- You can ask Promptless to make these changes for you. It edits
PROMPTLESS.md, the workflow file, andpromptless.yamlthen commits the change.
What Promptless does on each weekly run
Section titled “What Promptless does on each weekly run”When the weekly schedule runs, Promptless:
- Pulls the last 7 days of documentation-site analytics from PostHog, scoped to your docs paths.
- Applies both signals, recurring reader searches with no good answer and page traffic combined with exit rate, along with the workflow’s prioritization.
- Opens suggestions, describing each gap in its own words rather than pasting raw queries or URL parameters.
- Finishes quietly when it finds nothing worth changing.
Set a notification channel to see what each run produced because a scheduled run’s only outward signals are the suggestions it opens and the notifications your policy sends. A quiet week means the run found nothing worth changing, not that it failed. A credential or access problem surfaces as an escalation notification rather than a suggestion notification, so specify an escalation channel to catch a broken integration. See Notifications and its Escalation channel section to route problem and failure alerts separately from suggestion alerts. See Noise and relevance filtering to tune what counts as a suggestion.