docs
Core Features
Webhooks

Webhooks & Events

Webhooks allow WP AutoFlow to communicate with external systems in real-time. Whenever a post is successfully published to your WordPress site, the system sends a POST request to a URL of your choice.

This is useful for:

  • Social Media: Triggering a Zapier/Make scenario to tweet the new post.
  • Notifications: Sending an alert to a Discord or Slack channel.
  • Logging: Saving the production history to a Google Sheet.

Configuration

  1. Go to Settings > Webhooks in the Dashboard.
  2. Enter the Destination URL (Endpoint).
  3. Click Save.
  4. You can click "Test Webhook" to send a dummy payload and verify the connection.

The Event Payload

When an event triggers, WP AutoFlow sends a HTTP POST request with a JSON body.

Event: post_created

Triggered immediately after the content is successfully created on the target WordPress API.

JSON Payload Structure:

{
  "event": "post_created",
  "data": {
    "id": 1885,
    "title": "The New Era of Artificial Intelligence in WordPress",
    "link": "https://yoursite.com/the-new-era-of-ai/",
    "timestamp": "2025-12-14T23:10:10.480Z"
  },
  "source": "WP AutoFlow"
}

Key Definitions

FieldDescription
eventThe type of event trigger. Currently, always post_created.
data.idThe ID of the post in your database (WP AutoFlow internal ID).
data.titleThe final title of the published article.
data.linkThe public URL of the post on your WordPress site.
data.timestampISO 8601 string of when the event occurred.
sourceAlways WP AutoFlow. Useful for filtering if you receive webhooks from multiple apps.

Integration Examples

1. Discord (via n8n or Make)

Since Discord expects a specific format, we recommend sending the Webhook to an automation platform like n8n or Make.com, which then formats the message for Discord.

  1. Create a webhook trigger in Make.
  2. Paste that URL into WP AutoFlow.
  3. Map data.title and data.link to a Discord message node.

2. Custom Script (Node.js)

If you are running a custom listener, you can handle the event like this:

app.post('/webhook/handler', (req, res) => {
  const { event, data, source } = req.body;
 
  // Verify it came from AutoFlow
  if (source === 'WP AutoFlow' && event === 'post_created') {
    console.log(`New post published: ${data.title}`);
    console.log(`URL: ${data.link}`);
  }
 
  res.status(200).send('Received');
});
⚠️

Timeout: The webhook expects a 200 OK response within 10 seconds. If your external script takes too long to process, the webhook request might be marked as failed in the logs.