Weekly Contentful stale-drafts digest posted to Slack

By General Input

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.

Integrations

  • Contentful
  • Slack Bot

Type

Deterministic Code

Categories

  • Marketing
  • Operations

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.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them