social_post — Social Media Post
| Field | Value |
|---|---|
| Type key | social_post |
| Label | Social Media Post |
| Agent queue | social-post-writer |
| Plan tier | Free+ (starter, growth, professional) |
| Credits/unit | 1 |
| Monthly range | 8–30 |
What it produces
Per-platform social media post copy (caption, hashtags, call-to-action) plus a designed image slide produced by the social-post-designer sub-agent. The output is a SocialPost record.
Pipeline sequence
social_calendar (prerequisite) ──→ social-post-writer ──→ SocialPost: dm_review
│
[Gate 1: DM Portal — copy review]
│
dm-approve ─────────┼────── dm-reject → re-queued
│
SocialPost: dm_approved
│
social-post-designer enqueued
│
SocialPost: design_pending
│
[designer runs — GPT Image 1.5 / Azure]
│
SocialPost: client_review
│
[Gate 2: Dashboard — full post review]
│
client-approve ──────┼───── client-reject → re-queued
│
SocialPost: client_approved
│
[auto-ingest → scheduled]
│
SocialPost: scheduledStatus machine
| Status | Set by | Next |
|---|---|---|
dm_review | social-post-writer on completion | → dm_approved or → rejected |
dm_approved | DM approves copy (POST /dm/v1/social/:id/dm-approve) | Designer enqueued → design_pending |
design_pending | Designer worker starts | → client_review on success |
client_review | Designer completes slides | → client_approved or → rejected |
client_approved | Client approves (POST /client/v1/social/:id/approve) | → scheduled (auto) |
rejected | DM rejects or client rejects | Re-queues appropriate worker with note |
scheduled | Auto-ingest on client_approved | Terminal |
Fields: dmRejectionNote, dmApprovedBy, dmApprovedAt, clientRejectionNote, clientApprovedBy, clientApprovedAt, scheduledAt, version.
HITL gates
| Gate | Location | Who | Action |
|---|---|---|---|
| Gate 1 — Copy | DM Portal → Approvals | Reviewer | Approve copy (triggers designer) or Reject with note (re-queue writer) |
| Gate 2 — Full post | Dashboard → Deliverables | Client | Approve (→ client_approved, auto-schedule) or Reject (re-queue) |
Known issue: If
OPENAI_API_KEY(Azure) is not configured, the designer job fails silently and the post stays stuck atdesign_pending.
Deliverable status progression
| Deliverable status | Trigger |
|---|---|
generating | Writer picks up the activity |
in_review | SocialPost created with dm_review |
generating | DM approves → designer enqueued |
needs_approval | Designer completes → client_review |
approved | Client approves → client_approved |
published | Auto-schedule completes |
Dependencies
- Requires:
social_calendar— planner always schedules 1 calendar per month when social posts are planned. The calendar’s slot data is injected into the writer’s input payload (date, platform, topic angle, format). Activity.dependsOnis set so the social-post-writer does not start until the linkedsocial_calendaractivity isdone.
DB records created
| Record | Created by | Notes |
|---|---|---|
DeliverableTemplate | deliverable-planner | Monthly quota (e.g., “12 social posts”) |
Activity | activity-planner | One per post; type = social_post |
Deliverable | social-post-writer worker | Client-facing status record |
SocialPost | social-post-writer worker | Copy + designed slides + status machine |
Channel requirement
Social posts do not require connected channels at scheduling time. Content is drafted and designed first; channels are only needed when the post is published to the platform. The planner always includes social posts regardless of whether the tenant has connected any social accounts.
Auto-ingest
On client_approved, the post moves to scheduled and a PublishedContent record is created. Actual publishing to the social platform occurs when the tenant’s channel credentials are present and the scheduled time arrives.
Platform distribution
Social posts are platform-specific. The platform flows through three stages:
-
Deliverable Planner (
strategy.worker.ts) setsDeliverableTemplate.platforms— an array of all target social platforms (e.g.["instagram", "linkedin", "facebook"]). Valid slugs:instagram,linkedin,facebook,x,tiktok,google_business_profile. The planner should always include all platforms the strategy targets, not just one. -
Activity Planner (
activity.worker.tsrule #11) distributesmonthlyVolumeevenly across platforms and creates one activity per platform per slot, settinginputHints.platform. Example: volume 12 with platformsinstagram, linkedin, facebook→ 4 activities each = 12 total. -
Social Post Writer reads
activity.inputPayload.platformand stores it on theSocialPostrecord. Default fallback is"instagram"if the field is missing.
If all posts appear as a single platform in the DM approvals queue, check
DeliverableTemplate.platforms— the deliverable plan likely has only one platform listed. Fix by refreshing the deliverable plan or updating the array directly in the DB.
Key rules
- The planner must include exactly 1
social_calendarper month when social posts are planned. - On copy rejection, the writer is re-queued with the DM’s note.
- On client rejection, the re-queue target depends on where the fault was identified (copy vs. design).
versionincrements on each re-run after rejection.