Weekly Contentful stale-drafts digest posted to Slack
Every Monday at 9am, round up unpublished Contentful drafts that haven't been touched in two weeks and post a digest to Slack so nobody's abandoned work slips through the cracks.
Every Monday at 9am, list all Contentful entries in the chosen space and environment that are unpublished drafts last updated more than 14 days ago, using Contentful's List Entries operation. Filter with sys.publishedAt[exists]=false and sys.updatedAt[lte] set to (today - 14 days), sorted by -sys.updatedAt. Paginate via skip and limit (limit 100, max 1000) until skip + items.length >= total, so nothing is missed on large spaces.
For each entry keep the title (the first string field on the entry, e.g. fields.title in the default locale — fall back to the entry id if no title-like field exists), the content type id from sys.contentType.sys.id, the last-updated timestamp, and the last-editor user id from sys.updatedBy.sys.id. To make the digest human-readable, call Contentful's List Content Types once to map content-type ids to display names, and call List Space Memberships once to map user ids to names and emails. Do those lookups in memory — never per entry.
Group the results two ways: by content type and by last editor. Compute (a) the total count of stale drafts, (b) the 10 oldest drafts (title, content-type name, days stale, and an edit link of the form https://app.contentful.com/spaces/{spaceId}/environments/{environmentId}/entries/{entryId}), and (c) a per-owner breakdown listing each editor and how many stale drafts they own, sorted from most to least.
Post the digest to the chosen Slack channel using Slack Bot's Send a Message. Format it as Slack mrkdwn: a bold header, the total count, a section for the top 10 oldest drafts (each line: <edit_link|title> — content type — N days stale), and a per-owner section (Name (email) — N drafts). If there are zero stale drafts, still post a short 'no stale drafts this week' confirmation so the team knows the check ran.
The 14-day threshold and the target Slack channel should both be user-editable inputs, not hard-coded. The Contentful space id, environment (default master), and Slack channel id are the other inputs.
What does this prompt do?
- Every Monday at 9am, scans your Contentful space for unpublished drafts that haven't been updated in more than two weeks
- Groups the stale drafts by content type and by the last person who edited them so every draft has an owner
- Posts a formatted digest to a Slack channel with the total count, the 10 oldest drafts, and a per-owner breakdown
- Includes an edit link for every listed draft so your team can jump straight to Contentful and finish or archive it
What do I need to use this?
- A Contentful account with access to the space you want to review
- A Slack workspace and the channel you want the digest posted to
How can I customize it?
- Change the day and time the digest runs (Friday afternoon works just as well as Monday morning)
- Adjust the stale threshold — two weeks is the default, but seven or thirty days works too
- Pick a different Slack channel, or swap in a private channel once the bot is invited
FAQs
Which Contentful entries count as stale?
Will this edit or delete anything in Contentful?
Does it work across more than one Contentful space?
What happens if there are no stale drafts?
Can it post to a private Slack channel?
Related templates
When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.
Clear out your Contentful draft graveyard for good.
Get a weekly Slack digest that surfaces the drafts nobody's touched, grouped by owner so every abandoned page has a name next to it.