n8n Workflow Setup

n8n is a self-hosted automation platform: a visual editor where you chain a trigger to HTTP calls, AI nodes and conditions. jekcms works on both ends of that chain. It gives out tasks and accepts finished articles through its API, and it sends a POST request to your workflows when something happens on the site.

The API & Automation tab of jekcms settings
This screen holds two kinds of key: a REST API key for incoming automation, and the AI provider keys.

You do not need to build a workflow yourself. jekcms includes three ready-made workflows, each with one configuration node at the start.

Start with a shipped workflow

Open Plan Many Posts in the admin (Content Studio → Plan Many Posts) and scroll to the n8n panel. You will find the webhook address for your own site, a link to create an API key, and three downloads:

Content Queue: Persona Writer runs every two hours, pulls one task from your planned batch, writes the article in a persona voice you define, generates a cover image and publishes. Researched Production + 3 Images does the same on a four-hour cycle but researches the topic with a web-grounded call first and publishes with a cover plus two in-content images. RSS Content Factory works differently: it reads a dozen feeds, has the model pick a candidate, checks whether you already covered it, rewrites it and publishes. Read the section on rewriting before you switch that one on.

Each downloads as a JSON file. In n8n choose Workflows → Import from File, pick it, and open the node named Ayarlar - "Settings" - at the very start. This node holds every value you need to change: your site URL without a trailing slash, your jekcms API key, your provider API keys, the article language, your site's subject, and the persona or category list the workflow writes against. All later nodes read their values from it.

The workflow does not run while placeholders are still in place, and it tells you which field is empty. A workflow that stops at node two is much easier to fix than one that fails at node nineteen.

Both the workflows and the REST API they drive are included on the free edition.

The API key

Create the key first, under Admin → API Keys. It is shown once; copy it before leaving the page.

A jekcms key carries no scopes of its own. It acts as the user it was created for, with exactly that user's role permissions. Before you plan around roles, note that the API Keys screen is admin-only and issues every key to the admin who is logged in. There is no user picker, so you cannot create a key with fewer permissions from the panel. Treat every key you issue as an admin credential. Write actions additionally require the publish_posts capability. See API Authentication for the details.

In an n8n HTTP Request node, set authentication to a header: Authorization: Bearer <your key>. X-API-Key works too, jekcms also checks several other places where the header can end up, because Apache and CGI setups do not always pass Authorization to PHP.

The endpoints a workflow uses

Every call is a POST to https://yoursite.com/api/v1/webhook/{action} with a JSON body.

A queue-driven pipeline uses three. queue-pending asks for due tasks from a batch planned in Plan Many Posts and marks what it hands out as processing. content-generate sends the finished article back, attaches the featured image and closes the task. queue-fail reports a task the workflow could not complete, so it appears in red instead of disappearing.

A pipeline that sources its own topics uses publish, draft or schedule to create the post, media-base64 to upload an image it just generated, and check-source to ask whether a source URL has already been imported. check-source lets an RSS workflow run on a schedule without publishing the same story twice.

There is no queue endpoint for the content queue, which is a different pipeline. To feed that one, generate a JSON or CSV file and import it, or sync from a spreadsheet.

Webhooks documents every action, the authentication alternatives and the error responses.

Choosing what happens to the output

The endpoint that your final node calls decides your editorial policy.

Point it at draft and the article appears in Posts with draft status. Nothing appears on the site until you open, read and publish it. Use this setting while a template or a prompt is new.

If it points at publish, or uses content-generate (which always publishes, because it closes a queue task), the content goes live as soon as the workflow finishes, without review.

Both options are valid; the choice depends on how much editorial risk you accept. Automated drafts can be inaccurate, repetitive or thin, and publishing them unread costs search visibility and reader trust. A safe approach is to run a new workflow with draft for the first few dozen items, read them, and switch the node to publish only after the output has been consistently good.

Either way, the content quality gate runs at publish time. A blocked article comes back as 422 with a list of reasons - too short, no H2, duplicate title, missing featured image and so on - and is not published. Make your workflow log this response instead of treating it as a network error, because sending the same body again fails in the same way.

Rewriting other people's content

The RSS workflow is included because users ask for it, but it is not a good default. An article from another site passed through a model and republished, even in new words, adds little for the reader and comes close to what search engines call scaled content abuse.

If you use it, use it to select and comment on content, not to copy it. Link back to the source and credit the publisher. Add what the source does not have: your own analysis, local context, an opinion, updated numbers. Route the output through draft so a person reads every piece before it goes live. A domain made mostly of rewritten feed content looks like a content farm to readers and search engines, regardless of what the workflow does in between.

Going the other way

If jekcms should notify n8n, you do not need a workflow on the jekcms side. Open Admin → API Keys, scroll to Outgoing Webhooks, and add your n8n Webhook node's production URL with the events you care about: post published, post updated, post deleted, comment created, member registered.

jekcms POSTs a signed JSON body and records every attempt with its HTTP status, so you can see a broken endpoint in the admin. The signature travels in X-Jek-Signature as sha256= followed by the HMAC-SHA256 of the body, keyed with the signing secret shown when you created the webhook.

Verify it in a Code node right after the Webhook node. Turn on the Webhook node's Raw Body option first. The HMAC covers the exact bytes jekcms sent, and a body that n8n has already parsed and serialized again will not match:

const crypto = require('crypto');

const raw = $json.body;                       // raw body, as received
const sent = $json.headers['x-jek-signature'];
const expected = 'sha256=' + crypto
    .createHmac('sha256', $env.JEKCMS_WEBHOOK_SECRET)
    .update(raw)
    .digest('hex');

if (expected !== sent) {
    throw new Error('Invalid signature');
}
return [{ json: JSON.parse(raw) }];

This check is needed whenever the n8n webhook URL can be reached from the internet, which is usually the case.

Installing n8n, briefly

If you do not already run n8n, Docker is the shortest path:

docker run -d \
  --name n8n \
  -p 5678:5678 \
  -v ~/.n8n:/home/node/.n8n \
  n8nio/n8n

Open http://your-server-ip:5678 and create the owner account with a strong password, because n8n stores the API keys of every service you connect to it. For anything beyond local experimentation, put it behind an HTTPS reverse proxy.

A common networking problem: if n8n runs in Docker and jekcms runs on the same host outside Docker, the site URL inside your workflow must be host.docker.internal, not localhost.

When it does not work

If the workflow reports 401, the key is not reaching PHP or it is wrong. Confirm on the API Keys screen that the key exists, is active and has not expired, and check the last_used_at column. If it never updates, the request is not authenticated at all, and the header is the likely cause.

If it reports 422, read the blocks array. This response comes from the quality gate and is not a bug.

If it reports 409, a post with that title or slug already exists. This is the duplicate check. It usually means the workflow picked a topic it has already covered; calling check-source before generation prevents it.

If jekcms is not calling your endpoint, expand the webhook row on the API Keys screen and read the delivery log. Each attempt shows the HTTP status it got back, and the Re-send button replays the exact stored body once you have fixed the receiving side.

Be the first to know

New features, release notes and CMS guides. We send a couple of emails a month.