n8n AI Agents Tutorial: Master System & User Prompts (2026)
Master n8n AI agent prompts with 6 real examples -user prompts, system prompts, tools, memory, and advanced frameworks. Start building.

There are many times when your business development, sales, and customer service employees end up in tight spots with important clients. Some clients may demand detailed information or business commitments that are impossible to provide in a short time because your employees don't have the data readily at hand.
Until just a few years ago, this would have been a common problem that may have led to bigger problems like false promises, underdelivering, or breach of contracts.
However, modern advances in artificial intelligence techniques like natural language processing (NLP) and large language models (LLMs) equipped with reasoning and tool use are enabling businesses to answer complex client questions quickly and accurately. LLM-powered chatbots that integrate with business systems like enterprise resource planning can reason about complex questions and comprehensively answer them with accurate data. In this article, we look into such ERP AI chatbots.
In this section, we explore a typical use case that involves obtaining real-time business information from an enterprise resource planning (ERP) system, either for a user who's directly interacting with the ERP or for a system that's programmatically talking to the ERP:
The complication here is that the company has dozens of warehouses that stock thousands of devices. The client's requirements are many and intricate. Manually matching the products against these complex requirements and then verifying their availability is cumbersome as it is.
But the client wants an immediate answer and expects the order to be fulfilled in a short time, which sounds almost impossible. If the executive asks for more time, there's a risk that this client may buy from a competitor.
Such complex business interactions and repetitive tasks are where AI-powered chatbots can help your employees make solid business decisions and create good impressions with your customers. The complicated requirement matching as well as real-time inventory checking are things that state-of-the-art LLMs can do by fetching real-time data from your ERP systems. They enable your employees to quickly and accurately answer complex questions using your business data.
In the sections below, we explain how our chatbots solve such problems and help you keep your customers happy.
In this section, we explain our field-tested framework for integrating custom LLM-powered chatbots with ERP platforms like SAP S/4HANA and Microsoft Dynamics 365.
Our chatbot framework and chatbots support the following capabilities out of the box:
The architecture that enables all these is shown below:

Instead of a custom architecture, we could have relied on the OpenAI Assistants API. However, it has some drawbacks that make it unsuitable as of January 2024:
For these reasons, we use our own custom architecture. In the following sections, we go into more detail on the components shown above.
The conversational AI powering our chatbots must be able to:
We equip the GPT-4 LLM to do all this using the ReAct strategy described below.

ReAct is a prompting strategy to make an LLM plan on how to answer a complex question by combining reasoning with any necessary actions. In the example above, the LLM reasons that in order to answer a complex question comprehensively and accurately, it must break down the question into distinct actions that require interfacing with external systems.
The full list of available actions is domain-specific and supplied via few-shot examples to the LLM. It picks the actions that are most helpful for answering the question and acts on them.
Some few-shot examples for a question-answering task are shown below:

Few-shot examples for ReAct (Source: Yao et al.)
ReAct helps use cases like complex product search with multiple criteria:
Let's look at ReAct in the context of ERP chatbots.

For finding information relevant to a query in static documents — like FAQs, product descriptions, customer emails, or discussion forum posts — we implement a ReAct action named "search(query)." It does the following operations:
The framework also supports adding new documents or updating existing ones. After such changes, the document embeddings are recalculated and updated in the vector database.

The fetching of different data from ERP systems is implemented using ReAct actions. Depending on the prompt and the detailed metadata for these actions, the LLM decides on the fly whether to invoke one or more of these actions.
Some typical ERP actions are:
The exact module names and APIs depend on the ERP platform you're using. We explore such details for two popular ERP platforms further down under the chatbot integration section.
We can implement ReAct actions using GPT-4 function-calling. The advantage of the GPT-4 API is that it provides a much more structured way to specify actions compared to ReAct's original proposals.
OpenAI's API enables you to specify actions and their information in great detail as shown below:

OpenAI function calling API example (Source: OpenAI)
GPT-4 uses that semantic information and metadata — the function description, parameter property descriptions, parameter units, and so on — to make better decisions on when to invoke your actions based on your queries.
GPT-4 also enables the structured invocation of actions and transmission of action responses back to the LLM.
The framework combines all the retrieved document chunks and the relevant dynamic data into a coherent answer by appropriately prompting the LLM.
All that remains now is to get the user query from the ERP's or some other application's front end. Then we display the LLM's answer to the user via that same front end. That's explained in the next section.
Microsoft Dynamics 365 is a popular ERP software among small and medium enterprises. On the other hand, large corporations typically choose SAP S/4HANA because their size and business complexity require its flexibility.
In the following sections, we explain the approaches for integrating a custom chatbot with both platforms.
Such integration always involves fetching data from the ERP backend. However, the chatbot front end (user experience) is typically integrated with a separate business application like a CRM or a service helpdesk. But for some special use cases, it may be integrated directly with the ERP system's dashboards. We explore all these approaches.
Dynamics 365 ("D365" from here on) includes several products to manage different business aspects:
Each product consists of modules and module APIs to fetch and modify their respective data stored in the ERP's databases. Our chatbot framework integrates with these APIs as explained in the following sections.
D365 SCM's inventory management module provides an inventory visibility service that reports real-time inventory levels and availability across all facilities, warehouses, and channels. It also supports stock reservations to prevent problems like overselling and delayed fulfillment.
Our chatbots integrate with the visibility APIs via ReAct actions that are invoked by the LLM on demand. These APIs enable the chatbot to:
When GPT-4 invokes one of these actions, the chatbot's server-side logic calls these APIs. The chatbot's server-side logic is typically deployed as a standalone web application.
But when working with third-party systems, the chatbot may also be deployed as an integrated platform component rather than a standalone application. For example, if it's assisting salespersons via their Salesforce dashboards, its server-side logic runs on Salesforce-managed servers.
D365 also offers sales, CRM, and customer service capabilities. So it's possible that some clients want our custom chatbots shown directly on the D365 dashboard itself rather than some third-party application.
For such custom front-end integration, we develop the chatbot as a Power App and use the Power Apps component framework for a custom user interface.
S/4HANA provides components like:
These components publish API endpoints that our chatbots talk to as explained below.
The inventory APIs include:
Our chatbot ReAct actions invoke these APIs in response to instructions from GPT-4.
Our chatbots are typically deployed as part of other business systems like Salesforce or Zendesk rather than integrating directly into S/4HANA dashboards. The backend components of our chatbots talk to the S4/HANA inventory APIs to get ERP data, combine them with other static information stored outside the ERP system, and show a coherent answer on Salesforce or Zendesk dashboards.
However, in some special scenarios, some job roles and workflows may require direct integration with S4/HANA dashboards. For such cases, our chatbots integrate with the following technologies:
This chatbot pipeline strategy enables our chatbots to instantly and comprehensively answer very complex queries that you get from users and employees. By combining the awesome question-answering power of modern LLMs with real-time dynamic information from ERP systems and static knowledge from other sources, our chatbots provide unprecedented insights into business operations in real time and unparalleled productivity in business interactions.
Contact us to see how we can set up a custom chatbot for your ERP.