All jobs

Which Posts Scheduled for Next Week Are Still in Draft? Social Scheduling Software Checks Each Customer's Notion Content Calendar

Social media scheduling software makes one agent per customer, signed into their Notion, that lists next week's planned posts still in draft or missing a caption.

Run this on RushOpens the console with this prompt ready to send. Connect Notion there first.

What the agent does

This is for a company that sells social media scheduling software to small brands: a bakery with three shops, a skincare label, a gym, a local estate agent. Many of its customers plan their posts in a Notion content calendar, a database with a row per post, a publish date, a channel, a status and a caption, and only move a post into the scheduler when it is ready. The posts that go wrong are the ones still marked Drafting the day before they were meant to go out, or marked Ready with no caption or no image. The software adds a Thursday check that tells each customer which of next week's planned posts are not ready yet, while there is time to finish them.

The company connects a Notion account of its own and saves the agent once as a template with POST /o/{org}/agents, naming notion in connections, with instructions that allow reading only. When a customer turns the check on, the backend calls POST /o/{org}/agents {"template": "<template id>", "name": "calendar-check-<customer id>"}, then POST /o/{org}/agents/{agent}/connections {"type": "mcp", "name": "notion"}, and opens the authorize_url in a popup while the customer is signed in to the software. The customer signs in on Notion's own page and picks the pages Notion may share; the software also asks them to paste the link to their content calendar, which it passes in each run's prompt.

On a run the agent calls notion-fetch on the calendar's link to read the database's schema and its collection:// data source URL, so it knows what the customer calls each property: Publish date or Go-live, Status or Stage, Caption or Copy. Then it calls notion-query-data-sources in rows mode with that data_source_url and a filter for rows whose date falls in the next seven days, sorted by date. Notion's docs say rows mode returns at most 100 rows with has_more and no cursor, so when has_more is true the agent narrows the filter by channel and queries again.

For each row it checks that the status is the customer's ready value, that the caption property is not empty, and that the row has a file or image property filled in when the channel needs one. Rows that fail are listed with what is missing. For a row in draft with a caption, the agent also reads the page with notion-fetch and notes how far along it looks, so the customer knows whether a post needs ten minutes or a rethink. It never creates, updates, moves or comments on a page.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "<agent id>",
  "input": "Content calendar check for this customer. Calendar: https://www.notion.so/brightloaf/Content-Calendar-8f2c1a7e9b4d4c3e9a1f6b2d7c8e5a40. Window: Friday 2026-11-27 to Thursday 2026-12-03, time zone Europe/London. Ready status value: 'Ready'. Read only. 1) notion-fetch the calendar link to read its schema and data source URL; identify the date, status, channel, caption and image or file properties by their names. 2) notion-query-data-sources with mode rows, that data_source_url, a filter for the date property within the window, sorted by date ascending, limit 100. If has_more is true, query again per channel. 3) For each row flag: status is not 'Ready' (and not already published); caption empty; no image or file when the channel is Instagram, TikTok or Pinterest; date with no time when the channel needs one. 4) For draft rows with a caption, notion-fetch the page and say in one sentence how complete it looks. Return JSON only: {window, checked, posts: [{page_url, title, date, channel, status, problems: [short sentences], how_far_along (omit unless draft)}]}, ordered by date. Never create, update, move, duplicate, comment on or delete anything in Notion."
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

The answer is JSON in the session's result and in the run.completed webhook the company's API key sends: how many planned posts the agent checked in the window and each one that is not ready, with its date, channel, status, what is missing and a link straight to the Notion page. The software shows it as a banner in the customer's dashboard and in the Thursday email it already sends, with each post one click from the page to fix.

What the customer checks: a post flagged for having no image that is meant to be text-only, a date the agent read from the wrong property when the calendar has two date columns, and posts the customer has decided to skip but left in the calendar. Finishing the posts, and moving them into the scheduler, is the customer's work.

Run it on every Thursday morning, per customer

The software's scheduler sends one POST /o/{org}/sessions per customer at nine on Thursday in the customer's time zone, with that customer's agent id as agent, their calendar link, window and ready status in input, and a request_id that is a UUID v5 of the customer id and the week, so a retried job does not check the same week twice.

A customer about to start a campaign can press "check my calendar" in the software to start the same request at once. Runs past the key's concurrent limit wait queued and start in turn, and each answer arrives on the webhook.

The use case this job follows, with its automation and trigger: Run an agent per customer task.

Why run it on Rush?

Each customer signs in on Notion's page, and that sign-in belongs to their agent alone: one customer's run can never read another's workspace, and the company's own runs never see any of them. The company registers no Notion integration and stores no Notion token, only the agent id against the customer. A customer who cancels is one DELETE /o/{org}/agents/{agent}, which disconnects their Notion.

Each run has its own computer and a record of every Notion call, so when a customer says a post was flagged by mistake, support opens that Thursday's session and sees the row as the agent read it. Adding up total_cost_usd over GET /o/{org}/sessions?agent=<agent id> gives what the check costs per customer, which the company can price into a plan.

Frequently asked questions

Do customers need a particular Notion plan?

Notion's docs say rows mode shares a per-workspace usage allowance with single-data-source SQL on plans without Business or Enterprise with Notion AI, and an upgrade prompt follows when it runs out. The check makes one or a few rows queries a week; when a workspace has used up its allowance, the run reports Notion's refusal in place of a list.

What if a customer's calendar uses different property names?

The agent reads the database's schema with notion-fetch before querying, and matches the date, status, channel and caption properties by their names and types. The software can pass the customer's ready status in the prompt when it is not called Ready.

Could the agent fill in the missing captions?

The template keeps it to reading. A brand's captions are the brand's voice; the software can offer a separate, opt-in drafting run that writes suggestions into its own editor for the customer to accept.

More Notion jobs

More jobs like this: Run an agent per customer task

Keep reading