Layers

Social Distribution Setup

Install the layer, connect an account, configure posting times and publishing mode.

View as Markdown

1. Install the layer

From the layers catalog → Social DistributionInstall. The initialize command runs social-distribution-plan and the layer appears in your project's layer list.

One Social Distribution layer instance is bound to one connected social account (config.social.socialAccountId). To post to both Instagram and TikTok, install two layer instances.

2. Connect a social account

See:

3. Pick a distribution mode

Configured via config.distributionMode:

  • automatic — Layers picks 1–3 default times per day based on the account's current "temperature" (cold = 1 slot at 10:00, warm = 2 slots at 10:00 and 15:00, hot = 3 slots at 10:00 / 15:00 / 19:00, all in the project timezone).
  • custom — supply your own HH:MM times in config.schedule.times (project timezone).
  • manual — Layers does not create slots; you build the schedule post-by-post.

4. Posts per day (custom mode)

In custom mode, posts per day equals the length of config.schedule.times (1–5 allowed). Example: three times a day —

{
  "distributionMode": "custom",
  "schedule": { "times": ["09:00", "13:00", "18:00"] }
}

Times are in the project's timezone.

5. Generation mode

Controls whether the distribution layer auto-requests content generation to fill empty slots:

  • config.generationMode = "automatic" — empty slots trigger generation.
  • config.generationMode = "manual" (default) — you manually generate content that then attaches to the next empty slot via attach-to-schedule.

6. Publish on/off

config.willPublish gates the entire publishing loop. Leave it false while testing; set true to let process-due actually publish at slot time.

7. Account health

Instagram and TikTok access tokens are stored encrypted in the Layers credential vault. If token refresh or an API call fails with an auth error, social_accounts.metadata.token_error is set and the account is flagged unhealthy. Reconnect from Project Settings → Social accounts to clear.

8. Activate

Save settings. Triggers:

  • refresh-schedule — re-runs social-distribution-plan immediately whenever schedule config changes.
  • refresh-schedule-scheduled — re-runs nightly at 0 3 * * * UTC.
  • process-due — runs every minute, publishing posts whose slot time has arrived.
  • recover-overdue — runs every 5 minutes, re-slotting ready/failed posts that missed their original window.

On this page