Skip to content

Blog

A company brief on a webhook, from n8n

Send a company name to an n8n webhook and get a short brief back as JSON. Three Ahel steps on one item, and how their answers stay apart.

4 min read

This automation answers GET /webhook/company-brief?name=...&country=EE with a short brief as JSON: register facts, the latest quarter's staff and turnover, the management board and the contacts filed with the register. A name the register does not know gets a 404.

Download the workflow fileJSON and import it in n8n under Workflows, Import from File. It needs version 0.2.0 of the Ahel node, on npm since 27 November 2026: Start here has the install steps.

Who it is for

You are building a product, and one screen needs to know who a company is: a CRM sidebar, a form that checks a sign-up, an AI agent that wants facts before it writes. Your product sends one GET, n8n does the lookups, and the answer comes back in one piece.

The steps

The automation in n8n: Run now and Sample question, and Webhook: company-brief, lead to Question and Ahel: find in register. Found? sends a known company through Ahel: register trace, Ahel: tax figures, Write the brief and Answer with the brief, and an unknown name to Answer: not found.
The automation as imported. Run now answers the question in Sample question.
  1. Webhook: company-brief. Method GET, path company-brief, and Respond set to Using 'Respond to Webhook' Node, so the answer can come from the end of the path.
  2. Run now and Sample question. For testing in the editor. Type a company name into Sample question first.
  3. Question (Edit Fields) takes name from the query, and country too, upper case, EE when it is missing.
  4. Ahel: find in register. Operation Check a European Company, with the name and the country. Max Cost per Run 0.02.
  5. Found? (If) checks found. A miss goes to Answer: not found, which answers status 404 with error, message, asked_for and country.
  6. Ahel: register trace. Run Action with companies.trace and company_key set to the country and the registry number, as in EE: followed by the number. Max Results 1, Max Cost per Run 0.01, Timeout 90 seconds, and Put Answer Under trace.
  7. Ahel: tax figures. Run Action with companies.tax.quarterly, the country and the registry number. Max Results 1, Max Cost per Run 0.01, and Put Answer Under tax. Its On Error setting is Continue, so a company without tax figures still gets a brief.
  8. Write the brief (Code) turns the three answers into one item.
  9. Answer with the brief (Respond to Webhook) answers with that item.

Three answers on one item

All three Ahel steps work on the same item, and their answers share field names. The register search and the tax figures both answer name, country, registry_number, found, cost_usd and run_id. Without anything else, the tax step would write its fields over the register's, and you would lose what the first step said and what it cost.

Put Answer Under stops that. With it, a step's answer goes under one field, with its own cost_usd and run_id. So after step 7 the item holds the register answer on the item itself, the trace under trace, and the tax figures under tax. The brief step reads each part where it is (shortened, with our comments):

js
const j = $json;             // the register search, on the item
const trace = j.trace || {}; // companies.trace, under "trace"
const tax = j.tax || {};     // companies.tax.quarterly, under "tax"
const cost = (j.cost_usd || 0) + (trace.cost_usd || 0) + (tax.cost_usd || 0);

What our run returned

We asked it three times on 26 November 2026, once from the editor and twice through the webhook. Each time the answer was one JSON object with eight fields:

  • asked_for and brief, the brief as a few lines of text
  • company: name, registry_code, country, legal_form, status, founded, city
  • latest_quarter: quarter, employees, turnover_eur, labour_taxes_eur, activity
  • management: name, role and since for each person, 8 people on our run, which is as many as the code keeps
  • contacts, sources and cost_usd

We also asked once for a name the register does not know. That answered 404, as it should.

What it cost and how long it took

On our run on 26 November 2026, one question cost $0.006 and took 4.5 seconds: $0.004 for the register search, $0.002 for the tax figures, and nothing for the trace. On our run on 26 November 2026, the name the register did not know cost nothing, because a search that finds nothing is not charged.

How to call it

Publish the automation in n8n to make the production URL live. Then, from your product:

bash
curl -sG "$N8N_URL/webhook/company-brief" \
  --data-urlencode "name=$COMPANY_NAME" \
  --data-urlencode "country=EE"

How to change it

  • Another country. Pass country=FI, GB or another country the register search covers. The register facts still come back. The tax figures are Estonian only, so latest_quarter stays empty.
  • Other wording or fields. Write the brief is plain JavaScript. The register names roles and contact kinds in Estonian, and the code translates the ones it knows.
  • Another caller. Anything that can send a GET works: a form, a button in your CRM, a chat bot, an AI agent.

What to watch out for

  • The webhook has no authentication in the file. Its Authentication is None, and every question that finds a company is paid for. Before the URL leaves your machine, set Header Auth on the webhook, and give the Ahel credential a key with a daily cap.
  • A name is not an identity. The register search answers one match, with match_confidence and match_quality. If your product sends short or common names, check those before you trust the brief.
  • One row each, so no results array. Each step asks for one row, so its fields sit on the item or under its field. When a step returns two or more rows, they arrive together under results on one item, and you need Split Out. The node does not page either: one run returns at most 100 rows.
  • 30 requests a minute. One question is three Ahel runs. The node spaces its requests to stay under a workspace's 30 a minute, and waits and tries again when told to slow down, so a burst of questions queues. Give your caller a timeout that allows for it.

Every action used here, with its inputs, is in the Catalog. Open the Catalog to build your own brief.