Skip to content
← Back to Blog
Tech Insights

Connecting Directus to the ERP: What We Learned from a Business Central Integration

Tobias Braun, Founder and Managing Director··5 min read
Connecting Directus to the ERP: What We Learned from a Business Central Integration

If you connect Directus to an ERP, first settle which system owns which data. After that, every extension belongs in its own module, not in the core of Directus. That is how we did it for a digital agency: over ten new workflows in TypeScript and an integration with Microsoft Dynamics 365 Business Central that runs stably in production.

This post shows how the project is built and what we learned along the way.

The starting point

A digital agency runs a platform on Directus. Directus is a data platform that sits on top of an SQL database. It offers an app to manage data and an API for other systems. More in the post Headless CMS for mid-sized companies.

Several client projects run on this one platform at the same time. That has an awkward effect: every extension for one project has to be built so it does not break the others.

On top of that came an everyday problem. Data was moved by hand between the platform and Business Central. Business Central is Microsoft’s ERP system. Every manual transfer cost time and was a source of errors.

What we built

  • The Business Central integration. Master data is no longer maintained twice. The data bridge between Directus and the ERP runs automatically.
  • Over ten new workflows. We built them in TypeScript, as extensions to Directus.
  • An extended frontend. The platform’s website runs on Astro. We added the new features to it.

Everything runs on Kubernetes and Helm. Locally, the same platform runs on Docker Compose. The project is ongoing, and we keep developing the platform. More in the case study on the Directus ERP integration.

Five lessons from the project

1. First settle which system owns which data

The goal of an ERP integration is that data is maintained in one place only. That only works if it is clear, for each kind of data, where it is created. Customer data and prices usually come from the ERP. Texts, images and website content are usually created in the CMS.

Write this down before the first line of code, as a simple table: kind of data, owning system, direction of the sync. This table saves many discussions later.

2. Build extensions, do not touch the core

Directus can be extended. We build new features as bundle extensions in TypeScript, with their own endpoints and hooks. An endpoint is an address of its own in the API. A hook reacts to an event, for example when a record is saved.

The core of Directus stays untouched. That has two advantages: Directus updates can be installed without losing your own changes. And every extension can be tested and reviewed on its own.

3. On a shared platform, every change counts twice

When several projects run on one platform, every change either holds up the others or puts them at risk. A good part of our work is therefore fault analysis and reviews across all projects. On shared infrastructure, that is what quality assurance actually looks like.

For you, that means: plan time for reviews. An extension is only finished once it is clear that it does not disturb anything else.

4. The same setup locally and in production

Our platform runs locally on Docker Compose and in production on Kubernetes with Helm. Both describe the same services. So a change behaves on a developer’s laptop the way it will later behave in production.

This matters especially for an ERP integration. Errors often only show up when the systems work together. The closer the test setup is to production, the earlier you see them.

5. Plan for the ERP not answering

Every connection to another system can fail. The ERP is under maintenance, a network hiccups, a record does not fit. Decide beforehand what happens then: is the sync retried later? Who gets a message? Where can you see which records were not transferred?

An integration that works in the normal case is quickly built. An integration that is also reliable when something goes wrong needs these questions.

What the project brings

The data bridge between Directus and Business Central replaces the manual transfer. A task and a source of errors disappear with it. The platform has gained over ten new workflows, and the ERP integration runs stably in production.

The lessons do not only apply to Business Central. They fit any connection of Directus to an ERP, a CRM or another business system.

Frequently asked questions

Does this work with another ERP? Yes. Business Central and many other ERP systems offer interfaces that other systems use to read and write data. The way is similar: settle the owning system, build the extension, plan for failures.

How long does an integration take? That mainly depends on the number of kinds of data and on the ERP’s interface. A first integration can usually be built as an MVP. With us, an MVP starts at €8,000.

Do we need a Directus license for this? Above a certain company size, using Directus needs a commercial license. We clarify that with you and arrange the license as a partner.

The next step

Want to connect Directus to your ERP? In a free first call we clarify which data should flow and what it costs. More about our work is on the Directus agency page. Or write to us directly.

The service behind this topic

Digital Products

Keep reading

Have a project in mind?

Tobias

Let's Talk →