Skip to content
Main navigation
All integrations

n8n

How it works:Self-hosted or in the cloud: your workflow starts the timer on a schedule or on any event.

In n8n the node "Webhook" receives events from here and the node "HTTP Request" calls the API. This works in n8n Cloud and self-hosted, as long as the webhook address is reachable from the internet over HTTPS.

Receive events and check the signature:

  1. Create a workflow with the node "Webhook", method POST, and copy the "Production URL".
  2. Add the address under Settings, Webhooks and note the secret, it is shown only once.
  3. In the webhook node, switch on "Raw Body" under "Options" and attach a "Code" node with the example below. Self-hosted, NODE_FUNCTION_ALLOW_BUILTIN=crypto must be set.
Example (javascript)
const crypto = require('crypto');
const secret = 'whsec_YOUR_SECRET';
const header = $json.headers['x-horaka-signature'] ?? '';
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const body = Buffer.from($binary.data.data, 'base64').toString('utf8');
const expected = crypto
    .createHmac('sha256', secret)
    .update(`${parts.t}.${body}`)
    .digest('hex');
if (expected !== parts.v1) {
    throw new Error('Signature does not match');
}
return [{ json: JSON.parse(body) }];

Control the timer from a workflow:

  1. Under Settings, API and devices, add a device or a token with the permission "Trigger".
  2. In n8n, create a credential of the type "Header Auth": name Authorization, value Bearer and your token.
  3. Add the node "HTTP Request" and enter the values below.
Example (text)
Method:         POST
URL:            https://api.horaka.com/v1/track/toggle
Authentication: Generic Credential Type, Header Auth
Send Body:      on, Body Content Type JSON
JSON:           {"project": "PROJECT"}

Win back the hours you give away.

Get started in a minute. 14 days of Premium free and without a card, then carry on with Free at no cost or from €4.90 a month with everything for billing.