Get a Slack Alert When a Scheduled Post Fails

Send a Slack message the moment a scheduled social post fails: wire PostBoost's signed post.publishing_failed webhook to Slack with n8n, Zapier, Make or code.

A Slack channel showing a warning message about a failed social media post, next to a calendar with one failed slot

Guide · By PostBoost team · · Markdown

Short answer: subscribe a small relay to PostBoost's post.publishing_failed webhook and let the relay post to Slack. The relay can be an n8n workflow, a Zap, a Make scenario or a few lines of your own code. PostBoost sends one signed delivery per failed account, with the account, the network and the network's error message. The relay picks those three out, adds a link to the post, and sends a Slack message within seconds of the failure. The automation recipes tool has this setup ready for n8n (as a workflow you can import), Zapier and Make.

A failed post that nobody notices is worse than a late one. The launch announcement that never went out on LinkedIn, the Instagram post that the network refused at 6 a.m.: by the time someone opens the dashboard, the moment has passed. An alert in the channel where your team already works fixes that.

Why you need a relay between PostBoost and Slack

Slack's simplest way in is an incoming webhook: a secret URL that posts to one channel. Slack's docs show the body it expects:

{"text": "Hello, world."}

PostBoost does not send that. It sends its own event envelope (event, id, occurred_at, workspace_uuid, data), so if you paste a Slack webhook URL straight into PostBoost, Slack answers with no_text, which its docs describe as "the text attribute was missing from the payload". Something has to read the event and write the Slack message. That something is the relay.

Two more reasons to keep the relay:

  • Filtering. You decide which events reach Slack and what they say, for example failures on every account but connection warnings only for client accounts.
  • Verification. The relay can check PostBoost's signature before it trusts the body. Slack itself cannot.

Keep the Slack webhook URL out of shared docs and repositories: Slack says it "contains a secret" and that it "actively searches out and revokes leaked secrets".

What PostBoost sends when a post fails

When publishing to an account fails, PostBoost sends post.publishing_failed to every webhook subscribed to it. The webhook docs list the full payload. These are the fields an alert needs:

Field What it holds
id The delivery id. The same on every retry and manual resend, so use it to skip duplicates
workspace_uuid The workspace the post belongs to
data.uuid The post's UUID
data.account.name The account's name, for example your brand's Instagram account
data.account.provider The network, for example facebook_page, instagram or linkedin
data.account.errors[0] A readable line such as "Facebook: (#200) Permissions error (code 200)"
data.versions The post text per account (content[].body), if you want a preview in the alert

Three behaviours shape the alert:

  1. One delivery per account. A post that failed on three accounts sends three deliveries. Each account may need a different fix (a reconnect on one, a new image on another), so one message per account is usually right.
  2. Retries repeat the same body. If your relay does not answer with 200, 201 or 202, PostBoost tries again, waiting 2, 4, 8 minutes and so on, up to the webhook's maximum number of attempts. Webhooks created through the API get 3 attempts. Any other status, even 204, counts as a failure.
  3. Deliveries are signed. When the webhook has a secret, X-Signature carries the HMAC-SHA256 of the raw body as lowercase hex. Webhooks created through the API always get one.

The link to the post is https://postboost.co/app/{workspace_uuid}/posts/{data.uuid}. It opens the post, where the Delivery tab shows each account's status and the network's error, and where you retry the failed account once you have fixed the cause, if the fix needs no change to the post (a reconnect, a rate limit). A new image or text needs a copy: More actions (⋯) → Duplicate, keep only that account, make the change and schedule it.

Step 1: subscribe your relay to the failure event

You can add the webhook by hand under Webhooks in the app (workspace admins): the callback URL, the method (POST), the content type (application/json), the events, a secret and the number of attempts. Or let the relay register itself with one API call, which is what the n8n, Zapier and Make recipes do:

curl -X POST "https://postboost.co/app/api/$WORKSPACE_UUID/webhooks/subscriptions" \
  -H "Authorization: Bearer $POSTBOOST_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "callback_url": "https://n8n.example.com/webhook/postboost-failed",
    "events": ["post.publishing_failed", "account.token_expiring", "account.disconnected"],
    "name": "Slack failure alerts",
    "source": "n8n"
  }'

The response holds the subscription's uuid and a secret. The secret is returned only this once, so store it with the relay: it is the key for checking X-Signature. The callback URL must be a public https:// address, and the call needs a workspace admin's token. source accepts n8n, zapier, make or other. The API reference documents the request.

The two account.* events are optional, but they turn the channel from an alarm into an early warning. More on them below.

Step 2: build the relay

Pick the tool your team already uses. All four end in the same Slack message.

n8n

  1. Add a Webhook node, method POST, path postboost-failed. n8n gives it a test URL and a production URL; the production one is registered when you publish the workflow, and that is the one PostBoost needs.
  2. Add a Slack node (Send Message) to the channel you want, with a message built from the delivery. In n8n the request body sits under body:
:warning: Post failed on {{ $json.body.data.account.name }} ({{ $json.body.data.account.provider }})
Error: {{ ($json.body.data.account.errors || [])[0] }}
<https://postboost.co/app/{{ $json.body.workspace_uuid }}/posts/{{ $json.body.data.uuid }}|Open the post in PostBoost>
  1. Run the subscribe call from Step 1 once with the production URL.

These expressions pass the account name and error text through as they are. If either can contain &, < or >, escape them first, as described under Your own code below.

You don't have to build it by hand: choose n8n and the "Slack alert when a post fails to publish" recipe in the automation recipes tool, and import the workflow. It includes the Webhook and Slack nodes and a branch that creates the subscription.

To check the signature in n8n, turn on the Webhook node's Raw Body option so the body arrives unparsed, hash it with the Crypto node's Hmac action (type SHA256, encoding HEX; the node takes the secret from your Crypto credentials, not from a field), and compare the result with the x-signature header in an If node before the Slack step.

Zapier

  1. Trigger: Webhooks by Zapier → Catch Hook. Copy the hook URL. Use Catch Raw Hook instead if you want to verify the signature in a code step: Zapier's help page says "The request body will be unparsed (max 2MB) and also include headers."
  2. Run the subscribe call from Step 1 once with the hook URL as callback_url and "source": "zapier".
  3. Action: Slack → Send Channel Message, mapping data.account.name, data.account.provider and the first entry of data.account.errors.

Webhooks by Zapier is not on Zapier's Free plan; its help page lists it for Professional, Team and Enterprise. PostBoost's own Zapier and Make apps, which subscribe and unsubscribe for you (a Post Failed trigger in Zapier, Watch Events with post.publishing_failed in Make), are built but pending review, so the generic webhook step is the way today.

Make

  1. Trigger: Webhooks → Custom webhook. Copy the address. Turn on Get request headers if you plan to check X-Signature later in the scenario.
  2. Run the subscribe call from Step 1 once with that address and "source": "make". To teach Make the fields before a real failure happens, send it the sample post.publishing_failed body from the webhook docs once with curl.
  3. Action: Slack's Create a Message module, mapping the same three fields and the post link.

Make answers each delivery right away with 200 and the text "Accepted" (unless the webhook's queue is full), which PostBoost counts as delivered.

Your own code

If you already run a server or a serverless function, the relay is about 30 lines. This Node.js version (Node 18 or later, Express) checks the signature on the raw body, answers PostBoost first, skips repeats and posts to a Slack incoming webhook:

import crypto from "node:crypto";
import express from "express";

const app = express();
const seen = new Set(); // use Redis or a database table in production
const esc = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");

app.post("/postboost/alerts", express.raw({ type: "*/*" }), async (req, res) => {
  const expected = crypto.createHmac("sha256", process.env.POSTBOOST_WEBHOOK_SECRET).update(req.body).digest("hex");
  const given = req.get("X-Signature") ?? "";
  if (given.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))) {
    return res.sendStatus(401);
  }
  res.status(200).json({ ok: true }); // PostBoost counts only 200, 201 and 202 as delivered

  const { event, id, workspace_uuid, data } = JSON.parse(req.body.toString("utf8"));
  if (seen.has(id)) return;
  seen.add(id);

  let text;
  if (event === "post.publishing_failed") {
    const link = `https://postboost.co/app/${workspace_uuid}/posts/${data.uuid}`;
    text = `:warning: *${esc(data.account.name)}* (${data.account.provider}) failed to publish.\n` +
      `${esc(data.account.errors?.[0] ?? "No error message")}\n<${link}|Open the post in PostBoost>`;
  } else if (event === "account.token_expiring") {
    text = `:hourglass: *${esc(data.name)}* (${data.provider}) disconnects in ${data.days_left} days. <${data.reconnect_url}|Reconnect it>`;
  } else if (event === "account.disconnected") {
    text = `:x: *${esc(data.name)}* (${data.provider}) is disconnected; its posts will fail. <${data.reconnect_url}|Reconnect it>`;
  } else {
    return;
  }

  await fetch(process.env.SLACK_WEBHOOK_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ text }),
  });
});

app.listen(3000);

Three details matter here:

  • Hash the raw body. express.raw keeps the exact bytes PostBoost signed. Parsing the JSON first and hashing a re-encoded copy is the most common reason a valid signature fails; the webhook signature verifier shows which mistake you hit when you paste in a body, secret and header. The signature guide covers the rest.
  • Escape &, < and >. Slack uses them as control characters in message text, and an account name or error message can contain them.
  • Answering before Slack responds keeps PostBoost from retrying while Slack is slow. The trade-off: if the Slack call fails, that alert is lost. If you would rather have PostBoost retry, answer after the Slack call succeeds and add the id to seen only then.

Step 3: test it without breaking a real post

  1. Open Webhooks in the app and use Test webhook on your new webhook. It sends a signed test event, which proves the URL is reachable and that your signature check works. Your relay should ignore it, because the event name is not one it handles; the Node example above does.
  2. Send the sample post.publishing_failed body from the docs to your relay with curl. A relay that does not check signatures posts it to Slack, so you see what an alert looks like. A relay that does check them should refuse it (the Node example answers 401), which proves the check works; the first real alert then arrives with the next real failure.
  3. Check the deliveries list for the webhook in the app. Each delivery shows its payload and the response your relay gave. Anything other than 200, 201 or 202 there means PostBoost will retry.

Catch failures before they happen

The most common cause of a failed scheduled post is a connection that expired or was revoked (the six causes are in our troubleshooting guide). Two events let the same Slack channel warn you first:

  • account.token_expiring is sent when a connection's predicted expiry is 7, 3 and 1 days away, once per threshold. It adds expires_at, days_left, threshold and a reconnect_url to the account. PostBoost also emails workspace admins at the same thresholds.
  • account.disconnected is sent when a network revokes or expires an account's access, with the same reconnect_url.

Which networks expire and when is in the connection health docs: LinkedIn's 60-day access token when LinkedIn grants no refresh token, the TikTok and Pinterest refresh tokens, and Instagram (direct login) and Threads tokens when an automatic refresh fails.

For problems with the post itself, such as an image Instagram will refuse or text over a network's limit, run it through the free social media post checker before you schedule it. Inside PostBoost, the pre-publish checker agent does the same for the posts due in the next 24 hours by default, and the failed-post fixer agent proposes a reconnect or a retry for each failed account; both are described in the agents docs.

Alerts without Slack

If your team lives in email rather than Slack, PostBoost can tell you directly:

  • Watch a post. In a post's activity, the bell icon has a Watch option ("Notify me on all activity for this task"). Watchers get an email about the post's activity, which includes a failed publish.
  • The Failed tab. While the workspace has failed posts, Posts shows a Failed tab that lists them.
  • Connection emails. Workspace admins get the 7, 3 and 1-day expiry emails without any setup.

Slack is the better fit when several people share the job of keeping posts on schedule: everyone sees the failure, and the thread under the alert records who fixed it. The automations page shows what else teams build on the same events, and reliability covers the guardrails around publishing. To try it, create a free account: the API is on every plan, with no per-call fees.

Do this in PostBoost

Free tools for this guide

FAQ

How do I get a Slack notification when a scheduled post fails?

Use a relay between the scheduler and Slack. In PostBoost, subscribe an n8n, Zapier or Make webhook URL to the post.publishing_failed event, then add a Slack step that posts the account name, the network and the first error line. PostBoost sends one delivery per failed account.

Can I point a PostBoost webhook straight at a Slack incoming webhook URL?

No. A Slack incoming webhook expects a JSON body with a text field, and PostBoost sends its own event envelope, so Slack rejects it with no_text. Put a small step in between that reads the event and builds the Slack message.

Why did I get three Slack alerts for one post?

post.publishing_failed fires once per account. A post that failed on three accounts sends three deliveries, each with its own account and error. That is usually what you want, because each account may need a different fix.

How do I stop duplicate Slack alerts?

Every delivery has an id that stays the same on retries and manual resends. Store the ids you have handled and skip repeats. Also answer the webhook with 200, 201 or 202 quickly: any other status, even 204, counts as a failed delivery and is sent again.

Can I get warned before a post fails?

Yes. Subscribe the same relay to account.token_expiring, sent 7, 3 and 1 days before a connection is predicted to expire, and account.disconnected, sent when a network revokes access. Both carry a reconnect link. PostBoost also emails workspace admins about expiring connections.

Do I need Zapier for failure alerts?

No. n8n, Make or a few lines of your own code work just as well. Webhooks by Zapier is not on Zapier's Free plan; Zapier's help page lists it for Professional, Team and Enterprise.

Sources

Related guides

Try PostBoost free

API, webhooks and MCP on every plan, including Free. No credit card required.