Fistron docs

fistron.io

Send a project’s events to n8n and other orchestrators

Your team’s orchestrator, n8n for example, runs the release’s validation: it starts the Jenkins jobs, reads their artifacts and posts to Slack. Fistron works with it both ways:

The same works with any tool that takes a POST of JSON.

Before you start

Add a webhook

  1. Open the project, then under Project settings Webhooks.

  2. Click Add a webhook: a name, and the address (the Webhook node’s Production URL).

  3. Choose the events it is sent, and optionally the operations it is limited to (empty: every one):

    Event When
    work.finished a work finished: done, partly done or failed, with its other events in its data
    investigation.done an investigation of a failed build is done: its groups of failed tests, how many causes concluded, the questions waiting
    cause.concluded an investigation concluded causes: each with its group, failed step, root cause and fix
    fix.proposed a cause’s fix or a test’s repair was opened as a pull or merge request
    triage.done triage gave new failures their verdicts
    review.done a Daily CI review was made: how many of its streams are red
    report.done a release’s report was made from its epic
  4. Click Add the webhook. Its secret is shown this once: copy it into your workflow. New secret makes another; the former one signs nothing more.

Test sends ping at once and says what the address answered. What went lists the last 50 deliveries: the event, its work, the tries and what came back, What it sent, and Send again (the same delivery, signed again). Turn a webhook off with Change; Delete removes it with what went to it.

What a request carries

A POST of JSON with these headers:

Header Value
X-Fistron-Event the event, e.g. cause.concluded
X-Fistron-Delivery the delivery’s id, the same when it is sent again
X-Fistron-Timestamp when it was signed, in Unix seconds
X-Fistron-Signature sha256= and the HMAC-SHA256, with the secret, of the timestamp, a dot and the raw body, in hex
{
  "id": "0b6c…",
  "event": "cause.concluded",
  "at": "2026-11-30T14:05:00+00:00",
  "project": {"id": "…", "slug": "shop", "name": "Shop"},
  "work": {
    "id": "…", "operation": "causes-analyze", "state": "succeeded",
    "started_by": "person", "input": {"url": "https://ci.example.com/job/nightly/289/"},
    "warnings": [], "error": null, "documents": ["sha256:…"],
    "url": "https://fistron.example.com/projects/…/work/…",
    "api": "https://fistron.example.com/api/v1/projects/…/work/…"
  },
  "data": {
    "build": "https://ci.example.com/job/nightly/289/",
    "causes": [{"group": "g1", "step": "When I …", "tests": 3,
                "classification": "test_issue", "confidence": 0.86,
                "root_cause": "…", "action": "…", "verified": true}]
  }
}

started_by is a person, a schedule, a token or the system, never a person’s name. A work’s input larger than 8 kB, and anything else the request leaves out, is read through the API at work.api.

Check every request before the workflow acts on it: the signature, and that the timestamp is recent. In n8n, a Code node after the Webhook node does it (on n8n you run yourself, allow it the crypto module: NODE_FUNCTION_ALLOW_BUILTIN=crypto). The check itself, in JavaScript:

const { createHmac, timingSafeEqual } = require("crypto");

// raw: the body as it came (a Buffer); headers: its headers, in lower case
function fromFistron(raw, headers, secret) {
  const timestamp = headers["x-fistron-timestamp"] ?? "";
  const expected = "sha256=" +
    createHmac("sha256", secret).update(`${timestamp}.`).update(raw).digest("hex");
  const given = Buffer.from(headers["x-fistron-signature"] ?? "");
  const recent = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
  return recent && given.length === expected.length &&
    timingSafeEqual(given, Buffer.from(expected));
}

Stop the workflow when it returns false.

How it is sent

Let n8n start Fistron’s work

  1. An admin makes an automation token of the role Engineer (Create an API token); in n8n it is a credential of the type Header Auth: Authorization, Bearer <the token>.

  2. An HTTP Request node: POST to https://<your control plane>/api/v1/projects/<project id>/work with the body

    {
      "operation": "causes-analyze",
      "input": {"url": "{{ $json.build_url }}"},
      "callback": "{{ $execution.resumeUrl }}"
    }

    GET /api/v1/operations lists the operations and their inputs.

  3. A Wait node, Resume On Webhook Call, HTTP Method POST. When the work finishes, Fistron sends work.finished to the callback, signed with the secret of the webhook on n8n’s address, and the workflow goes on with it: its data holds the work’s other events (the causes concluded, for example).

A callback is taken only on the address of an enabled webhook of the project: the same scheme, host and port, so add n8n’s address as a webhook first. Without a callback, read the work’s state and result with GET /api/v1/projects/<project id>/work/<work id>.