# 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.

- Workflow type: code
- Services: Contentful, Slack Bot
- Categories: Marketing, Operations
- Published: 2026-07-17

## What it does

- 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 you'll need

- A Contentful account with access to the space you want to review
- A Slack workspace and the channel you want the digest posted to

## Prompt

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.

## How to customize

- 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

## FAQ

### Which Contentful entries count as stale?

Any entry that has never been published, or has unpublished changes waiting, and whose last update was more than two weeks ago.

### Will this edit or delete anything in Contentful?

No. The workflow only reads your entries. Nothing is created, edited, published, or archived on your behalf.

### Does it work across more than one Contentful space?

You'll pick one space and environment when you set it up. Run a second copy if you want a separate digest for another space.

### What happens if there are no stale drafts?

You still get a short Slack message confirming the check ran and the queue is clean, so you always know the workflow is alive.

### Can it post to a private Slack channel?

Yes. Invite the bot to the private channel first, then choose that channel as the destination.

Use this prompt in General Input: https://www.generalinput.com/prompts/weekly-contentful-stale-drafts-digest-posted-to-slack