Quick overview
This workflow receives authenticated webhook events and creates one Krevaya “draft for review” per requested social platform, using an Idempotency-Key to prevent duplicates, then returns per-platform results and an overall HTTP status to the caller.
How it works
- Receives a POST webhook request secured with header authentication containing a JSON content event.
- Validates the payload fields (including event_id, revision, body, and platforms), applies default platforms when needed, and rejects disallowed platforms with a 422 response.
- Fetches available brands from the Krevaya Automation API and matches the configured brand by name or ID.
- Builds one draft request per platform and generates a stable Idempotency-Key from the event ID, revision, brand ID, and platform.
- Creates Krevaya “drafts for review” via the Krevaya Automation API, where repeated submissions with the same Idempotency-Key return the original draft instead of creating a new one.
- Summarizes all platform outcomes (created, already created, rejected, retry later, or configuration error) and responds to the webhook with a JSON report and an HTTP status (201/200/422/503/502).
Setup
- Create a Krevaya API key with the “Drafts for review” preset and add it to n8n as an HTTP Header Auth credential for requests to https://api.krevaya.com.
- Create a separate n8n Header Auth credential for the incoming webhook secret and configure your source app to send that header when calling the webhook URL.
- Update the workflow configuration values for brand (name or ID), allowed_platforms, and default_platforms to match your Krevaya setup.
- Ensure your Krevaya brand’s publishing settings keep drafts in review (auto-approval disabled) so drafts wait for manual approval.
Requirements
- A Krevaya account on a paid plan, with an API key created from the Drafts for review preset
- Two n8n Header Auth credentials: one holding the Krevaya key (header name X-API-Key), one holding the webhook secret
- A source app that can send an authenticated JSON POST request
Customization
- Change the accepted fields in the Validate event node
- Change the allowed and default platforms in the Set workflow configuration node
- Increase revision when the content of an event changes