Turn last week's Zendesk tickets into GitBook doc drafts
Every Monday, cluster last week's solved Zendesk tickets by theme, check your GitBook for gaps, and open draft pages for the answers you're missing.
Build me an agent workflow that runs every Monday at 8am in my local timezone and turns last week's resolved Zendesk tickets into draft documentation pages in GitBook.
Trigger: cron, Mondays at 8am. Treat the lookback window as the previous seven days of solved tickets.
Step 1. Pull tickets from Zendesk. Use Zendesk Search Tickets with a query that filters for status:solved and the last seven days (something like 'type:ticket status:solved solved>{{date 7 days ago}}'). Paginate through results and keep the subject, the requester's question, the public-facing resolution, the ticket URL, and any tags. Cap the input to roughly the top 200 tickets if volume is huge.
Step 2. Cluster the tickets by recurring theme. Group them into a small number of named themes based on the underlying customer question, not the surface wording. For each theme, keep the list of source tickets (subject + URL) and a one-line summary of what customers were actually asking.
Step 3. For each theme, check whether my GitBook already has a good answer. Use GitBook Search Organization Content scoped to my organization to look for existing pages that cover the theme. For ambiguous cases, fall back to GitBook Ask AI In Organization with the theme phrased as a customer question and inspect the answer plus its cited sources. Mark each theme as 'covered' or 'gap' based on the result.
Step 4. For the documentation gaps, rank them by ticket volume and take the top 5. For each one, call GitBook Create Change Request in the GitBook space I designate as the drafts space, with:
- a proposed page title written in the customer's voice,
- an outline (H2 sections) shaped by the actual questions and edge cases the tickets raised,
- a short 'why this matters' note with the count of tickets in the theme last week,
- a list of source ticket links so the reviewer can read the real conversations.
Important: edits to live GitBook content must go through Create Change Request, not a direct page write. Do not merge the change requests. A human reviewer handles that.
Step 5. Post a digest to Slack using Slack Bot Send a Message in the channel I specify. The digest should include: total solved tickets analysed, the list of gaps with the change request links that were opened, the themes that were already well covered (with the existing GitBook page link), and the cap that was applied (e.g. 'showed top 5 of 8 gaps').
Setup inputs to ask me for: my GitBook organization, the GitBook space to put drafts into, the Zendesk filter (view, tag, group, or 'all'), the Slack channel for the digest, the day and time, and the cap on change requests per run (default 5).
Constrain the workflow to one GitBook organization and one target drafts space so reviewer inboxes don't flood. If there are zero gaps, still post the digest with the themes that were covered so I know the loop ran.
Additional information
What does this prompt do?
- Every Monday morning, pulls every ticket your team solved in Zendesk over the last seven days.
- Groups them into recurring themes so you can see what your customers are actually asking about.
- Checks your GitBook for each theme and opens a draft page proposal where coverage is thin, with an outline shaped by the real questions and links back to the source tickets.
- Posts a tidy Slack digest with the gaps it found, the drafts it opened for review, and the themes your docs already cover.
What do I need to use this?
- A Zendesk account where solved tickets from the last week are visible to your login.
- A GitBook workspace with a space you've chosen as the home for draft pages awaiting review.
- A Slack workspace and the channel where you want the weekly digest to land.
How can I customize it?
- Change the day or time. Sundays at 6pm, Friday afternoons, or any other cadence works.
- Cap how many drafts get opened per week so your reviewers don't drown. Five is a sensible starting point.
- Point it at a specific Zendesk view, group, or tag if you only want certain tickets feeding the docs loop.
- Pick which GitBook space the drafts land in, and which Slack channel sees the digest.
Frequently asked questions
Does this publish pages directly to my live docs?
What if the answer is already in our docs?
Won't this flood our reviewers with low-quality drafts?
Can I limit which tickets feed the loop?
What goes inside each draft page?
Stop letting support questions disappear into your help desk.
Connect Zendesk, GitBook, and Slack once, and every Monday Geni turns last week's support into a fresh batch of doc drafts.