---
title: "Agent: Social Autopilot"
summary: "Writes and publishes one on-brand post a day to your connected accounts, on your topics."
updated: "2026-09-30"
status: stable
origin: official
url: "https://swooshconnect.com/docs/agent-social-autopilot/"
---

# Agent: Social Autopilot

Writes and publishes one on-brand post a day to your connected accounts, on your topics.

## For AI agents

- Runs daily at 15:00 UTC (0 15 * * *) from supabase/functions/run/index.ts in the customer's Supabase project.
- Only call SwooshConnect's API, never a platform directly: list accounts with `list_accounts` and publish with `create_post`.
- This publishes publicly to the customer's real accounts. Confirm the topics before enabling it.
- Table: posts_log. Check the last 10 posts before writing, and never post twice in a day to the same account.
- TikTok is skipped because it needs media on every post. Pass imageUrl to `create_post` to add images.
- Keep imports with a .ts extension; never ship test files in the function folder.
- Never log a secret or the full text of a generated post.

## What it does

Once a day it writes and publishes POSTS_PER_RUN short, on-brand posts (1 by default) to each connected account that can post without required media. It looks at the account's last 10 posts before writing, so it varies the angle instead of repeating itself.

It never posts twice on the same day to the same account. TikTok is skipped because it needs media on every post and this agent writes text only.

## Schedule

```text
0 15 * * *
```

## Settings

| Setting | Label in the portal | Visibility |
| --- | --- | --- |
| AI_MODEL_PROVIDER | AI provider (anthropic or openai) | Choice |
| AI_MODEL_KEY | Your AI model key | Secret |
| BUSINESS_TOPICS | What to post about (topics, tone, offers) | Visible text, editable |

BUSINESS_TOPICS is plain text, so you can read it back and change it any time from the deploy screen.

## Tables it creates

```text
posts_log   every post it made: account, text, posted_at, external_id
```

Open posts_log in your Supabase Table Editor for a record of everything posted. external_id is the platform's own post id.

## How to extend

- Change POSTS_PER_RUN in `supabase/functions/run/index.ts` to post more than once per run.
- Edit the writing prompt to set a voice, add offers or avoid certain words.
- Add an image generator and Supabase Storage, then pass imageUrl to the posts call to include TikTok.
- Change the schedule in your project's cron settings if 15:00 UTC is wrong for your audience.

## Safety notes

> **Must:** This agent publishes publicly, on its own, to your real accounts. There is no approval step. Write clear topics and review the first few posts in posts_log.

> **Never:** Do not call a platform directly and do not log keys or full post text. Reach your accounts only through SwooshConnect's API.

See [Agents](https://swooshconnect.com/docs/agents/) for deploying, refreshing and removing.
