Skip to main content

Generic Outbound Webhooks

Send a JSON payload to any HTTPS endpoint whenever a run finishes: your own service, a Zapier zap, an n8n workflow or a custom alerting system. With a signing secret, every request carries an HMAC SHA-256 signature so your server can verify it came from Agnox.


Capabilities​

FeatureDescription
Every run sourceHosted runs, @agnox/playwright-reporter runs and JUnit/Allure uploads (POST /api/v1/reports). Local runs from a developer machine are not sent
HMAC SHA-256 signingWith a secret configured, each request includes an x-agnox-signature: sha256=<hex> header
Readable payloadRun name, group, environment (including qa), source, project, structured counts and a sanitized first failure
Bounded delivery10-second timeout per attempt; network errors, 429 and 5xx are retried up to 3 attempts with backoff. Redirects are not followed
Send Test EventPosts a signed webhook.test event to check your endpoint

Prerequisites​

  • An HTTPS endpoint on a public address that accepts POST requests with a JSON body. Private, loopback and link-local addresses are rejected when you save and again on every delivery.
  • The endpoint must respond with 2xx within 10 seconds.

Step 1 — Configure in Agnox​

  1. In the Agnox dashboard, go to Settings → Connectors.
  2. Find the Generic Webhook card and fill in the fields:
FieldValue
Webhook URLYour HTTPS endpoint (e.g. https://hooks.example.com/agnox)
Webhook Secret(Optional) A random string used to compute the HMAC-SHA256 signature
  1. Click Save Configuration.
  2. Click Send Test Event to post a signed webhook.test event to the endpoint.

The secret is stored encrypted (AES-256-GCM) and never returned. Once set, the card shows Signing secret configured:

  • Saving with the secret field blank keeps the stored secret (for example when you only change the URL).
  • Typing a new secret replaces it.
  • Checking Remove signing secret on save removes it; requests are then unsigned.

The API behaves the same way: PUT /api/integrations/webhook keeps the stored secret unless the body has a non-empty secret or clearSecret: true.

:::tip Generating a strong secret Use a cryptographically random string of at least 32 characters:

openssl rand -hex 32

:::


Payload Schema​

Every run delivery is a POST with this shape:

{
"event": "execution.finished",
"executionId": "6750f2c1a8b4e2d3f1a9c001",
"taskId": "ingest-1764583200000-3f9a1c2b",
"status": "FAILED",
"title": "Nightly Checkout",
"runName": "Nightly Checkout",
"groupName": "web-shop",
"environment": "qa",
"source": "external-ci",
"projectId": "6750f2c1a8b4e2d3f1a9b777",
"summary": { "total": 49, "passed": 45, "failed": 3, "skipped": 1, "quarantined": 0 },
"errorSnippet": "Checkout > pays with card\nError: expect(received).toBe(expected)",
"startTime": "2026-12-01T11:56:00.000Z",
"endTime": "2026-12-01T12:00:12.000Z",
"url": "https://app.agnox.dev/dashboard?drawerId=ingest-1764583200000-3f9a1c2b"
}
FieldTypeNotes
eventstringexecution.finished (or webhook.test for Send Test Event)
executionIdstringExecution document ID
taskIdstring | nullRun ID shown in the dashboard
statusstringPASSED, FAILED, ERROR or UNSTABLE
titlestringrunName, else groupName, else the test folder
runName, groupNamestring | nullReadable labels sent by the reporter, CLI or trigger
environmentstring | nulldevelopment, qa, staging or production
sourcestringagnox-hosted or external-ci
projectIdstring | nullAgnox project ID
summaryobject | nullCounts from the run's test results; failed excludes quarantined failures, which are counted in quarantined
errorSnippetstring | nullFirst non-quarantined failure, ANSI-stripped and secret-redacted, at most 300 characters
startTime, endTimeISO date | nullRun start and end
urlstringLink to the run in the Investigation Hub

The test event is:

{ "event": "webhook.test", "message": "Test event from Agnox. Real deliveries use the execution.finished event.", "sentAt": "2026-12-01T12:00:00.000Z" }

Verifying the Signature​

Agnox computes the signature as:

HMAC-SHA256(secret, rawRequestBody)

and sends it in the x-agnox-signature header as sha256=<hex>. Strip the sha256= prefix, compute the HMAC over the raw body bytes and compare in constant time.

Node.js Example​

import crypto from 'crypto';
import express from 'express';

function verifyAgnoxWebhook(rawBody: Buffer, header: string | undefined, secret: string): boolean {
if (!header?.startsWith('sha256=')) return false;
const received = Buffer.from(header.slice('sha256='.length), 'hex');
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest();

// timingSafeEqual throws when the lengths differ, so check them first
return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

const app = express();

app.post('/agnox', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.header('x-agnox-signature');

if (!verifyAgnoxWebhook(req.body, signature, process.env.AGNOX_WEBHOOK_SECRET!)) {
return res.status(401).send('Invalid signature');
}

const payload = JSON.parse(req.body.toString('utf8'));
// handle payload...
res.sendStatus(200);
});

Python Example​

import hashlib
import hmac

def verify_agnox_webhook(raw_body: bytes, header: str | None, secret: str) -> bool:
if not header or not header.startswith("sha256="):
return False
received = header[len("sha256="):]
expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, received)

:::info Always use the raw body Parse the JSON after verification. Computing the HMAC over a re-serialised object can produce a different digest. :::


Troubleshooting​

IssueLikely Cause
Signature mismatchSecret doesn't match, the sha256= prefix wasn't stripped, or you're verifying a parsed body instead of the raw bytes
No delivery receivedYour endpoint took longer than 10 s on every attempt, returned a redirect, or the run was a local run
Invalid webhook URL when savingThe URL is not HTTPS, carries credentials, or resolves to a private address
Payload received but no signature headerNo secret is configured — set one in Settings → Connectors → Generic Webhook