Topograph

Journey to the center of Topograph

Melvil Guillaume
Author

Banks, fintechs, payment providers and other regulated companies have to verify every business they onboard. That means checking that the company exists and finding out who runs and owns it, with the official documents as proof. Those businesses are often spread across many countries, so compliance teams end up using several data vendors to find and verify that information. Topograph brings this into one API. It fetches company data and official documents from the official registers at the time of the request. Each result comes back in the same format, whatever the country, and is traced to its source.

We started with France in July 2024. Three months later, we covered ten countries. The next ten took almost a year, as most of our time went into maintaining the first ten. Each country had been built a little differently, on an engine where we handled retries and job dependencies manually. In September 2025, we began moving every country to a new framework, Atlas. Today, we cover more than 160 jurisdictions, most of them added in the past year. Our coverage matrix shows what comes back in each one.

To keep that many integrations maintainable, we write each one the same way. We do it with Atlas, an internal TypeScript framework built on top of Temporal. With it, the code for a country holds only what is specific to that country. Temporal waits and retries when a register is slow or down. Atlas makes sure a document is fetched only once, even when several parts of a request need it. A company's record is often split across sources that depend on each other and answer at different speeds. Through one customer request, this article shows the requirements we learned on our first engine and how Atlas meets them.

Sources and datapoints

To integrate a country, we first look for the public bodies that hold a company's legal record. These include the business register, a register of beneficial owners, the official gazette, and sometimes a tax or statistics office with its own directory. We usually need several of them, as each holds a different part of the record. Even within one public body, different data often sits behind different channels: an API, a website, a downloadable file or a document. We call each of those channels a source.

Ideally, every source would expose a documented API that takes a company registration number and returns consistent JSON. In practice, most are heavy websites running on old software. A single lookup often means visiting pages in a specific order, and anything can change without notice. Even once we reach the right page, the data can come back in an undocumented format that we have to work out ourselves.

On the other side are what we call datapoints: the units of structured data that someone verifying a business can request. A datapoint has the same shape in every country, however differently the sources behind it are built. As a result, customers parse a French company and a Finnish one with the same code. Today, there are eight:

company, legalRepresentatives, otherKeyPersons, shareholders, ultimateBeneficialOwners, establishments, subsidiaries, availableDocuments

We designed the datapoints by reading official data from many countries, and we have adjusted them as more countries came in. The current definitions are in our documentation. For each country, we fill them with what its sources give us. Countries split a company's record among their sources in different ways, so the same datapoint is put together differently in each one. Here is the company datapoint for France and Belgium, with each field colored by the source that fills it:

FrancecompanyAidentifiersAlegal nameAlegal formAcapitalABactivitiesAlegal addressABCstatusBemployee countDVAT checkAINPIcompany registerBINSEESIRENE directoryCBODACCofficial gazetteDVIESEU VAT checkBelgiumcompanyAidentifiersAlegal nameAlegal formBcapitalAactivitiesAlegal addressAstatusCVAT checkABCE Open Datadaily bulk fileBBCE Public Searchlive lookupCVIESEU VAT check
The same fields in both countries, filled by different sources. Each field carries the letter and color of its source.

In France, the company register fills nearly every field. The exceptions are the employee count and part of the activity codes, which come from the statistics office. The status draws on three sources, as the gazette and the statistics office can each correct what the register shows.

In Belgium, nearly everything comes from a bulk file that the register publishes every day. Only two things need a lookup at the time of the request: the capital, which the file doesn't carry, and the VAT check. Our faster prefill mode is meant for filling a sign-up form while the user waits, so it uses only sources that answer quickly. It leaves both lookups to our default verification mode. We want customers to know where their data comes from. Every country's page in our documentation lists the sources behind each datapoint, and we keep it up to date.

The other half of what we provide is the official documents themselves, such as register extracts, articles of association and financial statements. The availableDocuments datapoint lists the documents the register holds for a company, so that a customer can order the ones it needs. We then fetch those from the register when they are ordered. We also analyze some of them ourselves to fill datapoints, as in many countries part of a company's data exists only inside a document.

Inside a request

Let's say a payment provider is onboarding Nokia. Its compliance team needs the company's data, the people who run it and the people who own it. It already has Nokia's ID from our search, so it asks for all three in a single call (the examples leave out the x-api-key header):

POST/v2/company
{
  "countryCode": "FI",
  "id": "0112038-9",
  "dataPoints": [
    "company",
    "legalRepresentatives",
    "ultimateBeneficialOwners"
  ]
}
Response
{
  "request": {
    "requestId": "3f6c2a10-7b4e-4d2a-9c1e-5a8b0d4e6f21",
    "dataStatus": {
      "dataPoints": {
        "company": { "status": "in_progress" },
        "legalRepresentatives": { "status": "in_progress" },
        "ultimateBeneficialOwners": { "status": "in_progress" }
      },
      "documents": {}
    }
  }
}

The call returns immediately, and each datapoint becomes available separately, as soon as it is ready. The customer gets it through a webhook or by polling the request ID. These are the usual timings for a Finnish company:

the customerultimateBeneficialOwners2 scompany14 slegalRepresentatives19 s
The usual timings for a Finnish company: the beneficial owners after about 2 seconds, the company after 14 and the directors after 19.

The beneficial owners come back first, after about 2 seconds. For Nokia the list is empty, as Finnish listed companies don't have to declare their beneficial owners. The directors take the longest, about 19 seconds. They appear only in the trade register extract, a PDF that we fetch and then analyze. Between the two, company is complete after about 14 seconds. Here it is, trimmed:

{
  "company": {
    "id": "0112038-9",
    "countryCode": "FI",
    "legalName": "Nokia Oyj",
    "status": { "localName": "Rekisterissä", "active": true },
    "legalForm": { "localName": "Julkinen osakeyhtiö", "standardized": "Corporation" },
    "capital": { "amount": 245896461.96, "currency": "EUR" },
    "taxId": { "type": "eu_vat", "value": "01120389", "verification": { "status": "verified" } },
    "legalAddress": { "addressLine1": "Karakaari 7", "city": "ESPOO", "postalCode": "02610" },
    ...
  }
}

Our quickstart goes through a request like this one in more detail, from getting an API key and searching for a company to retrieving the result.

Four requirements

To answer the payment provider's request about Nokia, we read several Finnish sources:

  • Basic company data (name, legal form, address, activity) comes from the business information system, which has an open API and responds in about a second.
  • The directors (our legalRepresentatives datapoint) and several fields of company appear only in the trade register extract, which is a PDF.
  • The beneficial owners are in a separate register.

Getting from those sources to the three datapoints of the request means meeting four requirements. We learned them while running our first engine.

1. Merging: a datapoint is filled from several sources

In our Finland integration, the company datapoint is filled from four sources:

  • The business information system
  • The trade register extract
  • The EU's VAT check
  • A lookup of the company's LEI, the international identifier for legal entities

Each of them fills only part of company. The extract holds fields that the business information system lacks. The VAT check confirms the VAT number, and the LEI lookup adds the company's LEI. Every country's company is put together from several sources like this, so we needed a standard way to run them and merge their results into one datapoint.

companybusiness information systemtrade register extractEU VAT checkLEI lookup
Each of the four sources fills one slot of company. A dot is the result of one source.

2. Chaining: a source needs the result of another source

Nokia's directors can only be read from the extract, which we can't fetch until the list of documents has given us its ID. Something has to make each source start at the right moment and hand it the result it was waiting for.

availableDocumentstrade register extractlegalRepresentativesidfile
Each step starts when the one above hands over its result: first the ID, then the file.

3. Coalescing: several callers need the same source

In this request, company and legalRepresentatives are both filled from the trade register extract. When the customer also orders the extract as a document in the same request, three callers want the same file within a few seconds. If we did nothing about it, we would buy the same extract from the register three times. Serving several callers with a single fetch is known as request coalescing. It applies whether the callers are parts of one request or two customers asking about the same company in the same minute.

companylegalRepresentativesthe customer's ordertrade registertrade register
On the left, the register is asked three times for the same file. On the right, it is asked once and the three callers share the answer.

4. Streaming: the results are ready at different times

If we sent a response only once it was complete, every datapoint would wait for the slowest one. Nokia's beneficial owners are ready after about 2 seconds. They would then wait another 17 while the directors are read from the extract. In countries where a source is a document that a person prepares manually, the wait would run to days. This is why our system had to deliver partial results to customers.

The same holds inside a single result, as its sources answer at different speeds and fill it in steps. In a Finnish search, our own search index answers in about 0.2 seconds, while the search on the trade register itself takes about 3. A caller that needs only the first match can have it well before the register replies. Whoever needs only part of a result, whether a customer or our own code, should be able to get what has arrived so far each time a source finishes.

searchour search index0.2 strade register, live3 s
Finland's search is sent each time one of its sources finishes: after 0.2 seconds with our index's matches, after about 3 with the register's.

Our first engine

Our first engine was built on Trigger.dev, a hosted service for background jobs. Each country described its datapoints as lists of sources. The sources that ran in the background did so as separate jobs on Trigger.dev, and we merged their results afterwards.

When a source needed the result of another, its job could wait for that source's job with Trigger.dev's triggerAndWait. Each dependency had to be written in two places:

  • In the country's config, a source declared a reference, and any source that needed its result listed that name in dependsOnReferences.
  • In the code of the dependent source, the result arrived in a dependencyData object under that same name.

In Poland, the list of documents needed the company profile first, as an inactive company has only a historical extract. Here is how one waited for the other:

// Poland on our first engine (simplified)
dataPoints: {
  companyProfile: {
    sources: [
      {
        name: 'poland_company_profile',
        source: getCompanyProfile,
        reference: 'poland_company_profile',
      },
    ],
  },
  availableDocuments: {
    sources: [
      {
        name: 'poland_available_documents',
        source: getAvailableDocuments,
        dependsOnReferences: ['poland_company_profile'],
      },
    ],
  },
},

// inside getAvailableDocuments
const companyProfile = params.dependencyData?.['poland_company_profile'];
const isActive = companyProfile?.company?.status === 'ACTIVE';

A dependency was written in the config and read again in the code, so the two could drift apart. We could have fixed that, and made the scheduler easier to work with at the same time. But a job on Trigger.dev also took several seconds to start, sometimes 5 to 15. Those start times are what prompted our switch to another orchestration engine. To be fair, Trigger.dev has since introduced warm starts, which avoid booting a new machine for each run. We also used the switch to make new countries easier to integrate and to meet the four requirements above.

The start times pointed us toward workers that never wait for a machine or container to boot. Our second reason was the dependencies: we wanted to stop maintaining each one in two places and have the code itself state it.

Why Temporal

Temporal is a runtime for durable function executions. In short, you write a workflow like any other function, and Temporal keeps a record of every step it takes. If the machine running it fails halfway, another machine reads that record and picks the workflow up where it stopped, without running the finished steps again.

The workflow code is the orchestration. Every step that interacts with the outside world is called an activity. Activities are the steps that fail, so Temporal retries them and handles their timeouts for you. In return, it requires you to split your code into workflows and activities. We like that trade. The orchestration reads as plain sequential code, and everything that can fail sits in a small step of its own.

Temporal suits Topograph, as our sources can be unavailable in very different ways. Sometimes a whole register goes offline for several hours during an announced maintenance window. Sometimes only part of one does, such as the documents from a single court. With sources this varied, we rely on Temporal's durability guarantees to bring every request to completion.

Almost all of our backend logic runs in Temporal. When a customer sends a request to /v2/company, we start what we call a router workflow. It finds the country's implementation of each datapoint and each document in the request, and starts each one as a child workflow. As their results arrive, the router saves every piece and sends webhooks.

workflowchild workflowsactivityrouterultimateBeneficialOwnerscompanylegalRepresentativesavailableDocumentscall the registerbeneficial ownersregister
The router starts one child workflow per datapoint, and each child reaches its register through an activity.

Atlas

Atlas is the TypeScript framework we built on Temporal, so that a country's code almost never deals with workflows directly. Instead, the code reaches them through a single call. That call starts a workflow, or subscribes to it if the same workflow is already running, and returns its result.

Atlas has two building blocks, and both run as Temporal workflows. A resolver answers one question about a company, such as "Who are the legal representatives of this Finnish company?" The answer comes from providers. A provider is the code that calls registers or other resolvers and returns its part of the result.

const legalRepresentativesProvider = createProvider({
  countryCode: CountryCode.FI,
  name: 'legalRepresentatives',
  run: async ({ registrationNumber }) => {
    // Finland's specific orchestration code: call a register, call other
    // resolvers, ...
    return result;
  },
});

const legalRepresentatives = createResolver({
  countryCode: CountryCode.FI,
  datapoint: 'legalRepresentatives',
  primary: legalRepresentativesProvider,
});

const result = await legalRepresentatives.run({ registrationNumber: '0112038-9' });

Calling .run() starts the resolver's workflow under an ID computed from the resolver's name and its input (a provider's workflow gets its ID the same way). Two calls with the same input therefore get the same ID, which is what lets several callers share one run.

1. Merging: a resolver combines several providers

Here is Finland's company:

export const company = createResolver({
  countryCode: CountryCode.FI,
  datapoint: 'company',
  primary: companyProvider,
  secondary: [vatValidationProvider],
});

Atlas runs the providers in parallel and merges their results into one company. Whether the datapoint succeeds depends on the primary provider. A secondary provider only adds to the primary's result, so a failed VAT check still leaves the customer with the rest of company. The four sources from earlier fit in two providers. companyProvider reads both the business information system and the extract, and the VAT check has a provider of its own. Atlas itself adds the LEI lookup to every country's company.

2. Chaining: a provider calls other resolvers

A provider can call other resolvers from its run function, so the code itself states its dependencies.

Take the provider behind legalRepresentatives in Finland, simplified here. The directors appear only in the extract, so the provider needs the extract's file before it can read them. To ask for that document, it needs the document's ID, which comes from another of our datapoints, availableDocuments. It therefore asks for the list first, then for the document:

export const legalRepresentativesProvider = createProvider({
  countryCode: CountryCode.FI,
  name: 'legalRepresentatives',
  run: async ({ registrationNumber }) => {
    const list = await availableDocuments.run({ registrationNumber });
    const entry = list.results.find((doc) => doc.type === TRADE_REGISTER_EXTRACT);
    if (!entry) return { legalRepresentatives: [] };

    const extract = await document.run({ documentId: entry.id, registrationNumber });

    const { text } = await getTextFromBlob({ blobName: extract.blobName });
    return parseLegalRepresentatives({ countryCode: CountryCode.FI, text });
  },
});

Both calls return typed results, as availableDocuments and document are resolvers defined elsewhere in the country's code and imported like any other value. companyProvider reads the same extract, so it makes the same two calls.

On our first engine, this dependency took a reference, a dependsOnReferences entry and a dependencyData key. Here, the provider awaits each resolver at the point where it needs the data. While it waits, no worker is busy with it. Temporal has recorded the call in the workflow's event history, and hands the workflow back to a worker once the result arrives.

3. Coalescing: callers share a running workflow

companyProvider and legalRepresentativesProvider both request the extract with document.run(). The router asks for the same file when the customer orders it as a document. All three compute the same workflow ID, so only the first to arrive starts the workflow. A caller that arrives while it is running sends it a subscribe signal, which is a message from one workflow to another. The caller then joins the list of subscribers that the workflow keeps.

For the developer integrating a country, document.run() is a plain function call, like .run() on any other resolver or provider. Here is what happens behind that call:

first callerdocumentsecond callerlater callerstartssubscribesresult kept
The first caller starts the run, a caller arriving during it subscribes, and a caller arriving after it ended gets the stored result.

If companyProvider reaches the extract first, its start goes through, and the document's workflow begins fetching the file. A moment later, Temporal refuses the same start from legalRepresentativesProvider. That provider sends a subscribe signal to the running workflow instead.

This is what happened in one of our own test requests for company and legalRepresentatives on a Finnish company. Times are in seconds from the start of the request:

0 s8.8 scompany providerdocument: the extractlegalRepresentatives providerstartssubscribes
The company provider started the extract's workflow, which the legalRepresentatives provider joined a moment later. Both received the file after 8.8 seconds.

legalRepresentativesProvider subscribed to the workflow that companyProvider had started a moment earlier, so the register was asked for the extract only once. Which of the two starts the fetch depends only on which one gets there first.

When two customers ask about the same company in the same minute, their two routers meet one level up, at the same company workflow. The list of documents is shared in the same way, by the first router and the two providers.

4. Streaming: a resolver sends results before it ends

router.stream()legalRepresentatives.run()provider.until()extract
The router streams the legalRepresentatives resolver, whose provider waits on the extract until the file exists.

Each time one of its providers finishes, a resolver sends out what it has so far as a partial result, without waiting for the others. A resolver object exposes up to three methods, so that callers can choose how much of a result to wait for:

/** A resolver answers one question. Callers who ask the same question share
    one Temporal workflow and its results. */
interface Resolver<Input, Output> {
  // Runs the resolver and returns its final result.
  run(input: Input): Promise<Output>;

  // Yields each partial result as it arrives.
  // Only on resolvers that send partial results.
  stream(input: Input): AsyncGenerator<Output, Output>;

  /**
   * Returns the first value the predicate gives that isn't null.
   * Returns null if the resolver finishes without a match.
   */
  until<T>(input: Input, predicate: (partial: Output) => T | null): Promise<T | null>;
}
partial resultsfinal resultresolver.stream().until(condition).run()time
Each dot is a provider finishing: .stream() gets every result, .until() returns at the first that meets its condition, .run() waits for the last.

In our real code the Finnish provider above uses .until() for both calls, because it does not need to wait for the whole document listing to complete:

const entry = await availableDocuments.until(
  { registrationNumber },
  (partial) => partial.results.find((doc) => doc.type === TRADE_REGISTER_EXTRACT) ?? null,
);

With all of this in place, the payment provider receives a webhook as soon as each datapoint is ready. The beneficial owners arrive after about 2 seconds, so its compliance team can start screening them against sanctions lists while we finish the remaining datapoints.

What comes next

Atlas isn't perfect. With coalescing and streaming, a workflow shared by several callers sends each partial result to every one of them as a separate signal. Temporal records each signal in the workflow's history, and Temporal Cloud bills each one as an action. The more callers share a workflow, the larger its history and the higher our bill.

We're looking at two ways to bring that down. Temporal Nexus lets a caller attach to a running workflow and wait for its final result. That could replace the part of our subscribe protocol that serves .run(). For partial results, we could send several of them in one signal.

Still, before Atlas, going from ten countries to twenty took us almost a year. Since we finished moving to it in November 2025, we've gone from 25 to more than 160 jurisdictions. Temporal and Atlas are what let us integrate them this quickly and scale to millions of requests.