Skip to content
KrevayadocsGet help Open Krevaya

Build n8n, Make, and custom automation workflows

Build useful draft digests, source-to-draft workflows, publication receipts, and review-driven scheduling with Krevaya REST, MCP, and webhooks.

Updated

Use an HTTP node with stored credentials

Krevaya works with generic HTTP request nodes in workflow tools. Set the API base to https://api.krevaya.com and store the key as a secret credential used in the Authorization header. There is no official n8n node required for these recipes. Keep create, approval, and schedule steps distinct in your workflow so it is clear which step can cause publication.

Recipe: send yourself a draft review digest

  • Trigger on your desired review schedule.
  • GET /v1/posts with status_filter=draft, an explicit brand_id, and limit=25. Use a read-scoped key.
  • Map each returned post's id, platform, body, and status into your own review system.
  • Record a reviewer decision against the exact post ID. If you later add a scheduling step, re-read the post before acting.

This recipe only needs read access until it begins changing posts. The list endpoint has no pagination cursor; it returns up to 100 rows. Use a manageable review batch rather than assuming one request is a full historical export.

Recipe: turn an approved article into drafts

  • Start from an article or source text your team chose to repurpose.
  • Call POST /v1/generate with url or text and a specific instruction, such as ‘Use the troubleshooting section; keep the original limitations.’
  • Store source_id and post_ids in your source record. The call is synchronous; configure the HTTP node's timeout accordingly.
  • Read and review the generated drafts. Check factual claims and any dates, prices, or promises against the source.
  • Schedule only after the reviewer approves the relevant posts.

The generation endpoint uses the current brand context and has no brand_id argument. For concurrent workflows spanning multiple brands, do not silently rely on whoever last selected a brand in the dashboard.

Recipe: update a campaign record after publication

  • Register a public webhook receiver for post.published and post.failed using a dashboard session.
  • Verify X-Krevaya-Signature against the raw body before using the payload.
  • Look up your campaign record by the saved post.id. Upsert the event outcome so an identical delivery cannot send a second notification or invoice.
  • On success, save external_post_id and permalink_url when present. On failure, store error and route it to a person for review.
  • Return promptly after durable acceptance; handle slow downstream API calls in a worker.

If a workflow service parses the body before your code can verify it, place a small verification receiver in front of that workflow. A shared-secret URL is not a replacement for the signed-body check.

Recipe: schedule an approved draft with MCP

A key-based integration can call MCP tools directly over HTTP. The helper below requests JSON responses and checks both protocol errors and tool errors. It shows a read-only get_post call; add schedule_post only at your reviewer's approved transition.

javascript
// Node.js 20+, run as an .mjs file.
const key = process.env.KREVAYA_API_KEY;
const postId = process.env.KREVAYA_POST_ID;
if (!key || !postId) throw new Error('Set KREVAYA_API_KEY and KREVAYA_POST_ID');
let nextId = 1;
async function rpc(method, params, notification = false) {
  const message = { jsonrpc: '2.0', method, params };
  if (!notification) message.id = nextId++;
  const response = await fetch('https://api.krevaya.com/mcp', {
    method: 'POST',
    headers: { Authorization: `Bearer ${key}`, 'Content-Type': 'application/json', Accept: 'application/json' },
    body: JSON.stringify(message),
  });
  const text = await response.text();
  if (!response.ok) throw new Error(`${response.status}: ${text}`);
  if (!text) return;
  const body = JSON.parse(text);
  if (body.error) throw new Error(JSON.stringify(body.error));
  if (body.result?.isError) throw new Error(JSON.stringify(body.result.content));
  return body.result;
}
await rpc('initialize', {
  protocolVersion: '2025-06-18', capabilities: {},
  clientInfo: { name: 'review-workflow', version: '1.0' },
});
await rpc('notifications/initialized', {}, true);
const result = await rpc('tools/call', { name: 'get_post', arguments: { post_id: postId } });
console.log(result.structuredContent ?? result.content);

For the approved transition, call tools/call with name: schedule_post and arguments containing post_id plus an optional future when. Omit when for the next free slot. Scheduling through an external key also approves a draft or rejected post; protect that step with the actual review decision.

Prevent duplicates across retries

The public create-post contract documented here has no Idempotency-Key support. Give each source record a unique workflow ID in your own database and store the returned post ID before advancing. If a request times out with an unknown outcome, inspect Krevaya before recreating it. Retry transient read failures with backoff, but do not retry a write just because its response was lost.

Frequently asked questions

Is there an official Krevaya n8n node?

The documented integration uses generic HTTP request and webhook nodes. You can authenticate with a stored Bearer API key and call the public REST or MCP endpoint.

Can I retry a create-post request after a timeout?

First check whether it created a post. There is no documented idempotency-key contract, so an automatic repeat can create a duplicate.