Actions7
Overview
This node, named "Unified MCP," enables interaction with SAP Business One through a Unified MCP Server. It supports two types of connections: direct database access and service layer API calls. The node facilitates various operations such as executing SQL queries, managing data records (insert, update, delete), handling transactions, authenticating users, and working with business entities like Business Partners, Items, Orders, and Invoices.
Common scenarios include:
- Running custom SQL queries directly on the SAP Business One database.
- Performing CRUD (Create, Read, Update, Delete) operations on business objects via the Service Layer.
- Managing authentication sessions for SAP Business One.
- Handling transactions to ensure data consistency.
- Executing custom API requests on the Service Layer for advanced use cases.
Practical examples:
- A user wants to fetch all customer records from SAP Business One using the Service Layer.
- Automating order creation by inserting data into the database or via the Service Layer.
- Starting a transaction, performing multiple updates, and committing or rolling back based on success.
- Logging in to SAP Business One programmatically to obtain a session for subsequent API calls.
Properties
Name | Meaning |
---|---|
Connection Type | Type of connection to use: "Direct Database" or "Service Layer" |
Since the Resource and Operation are fixed to "Default" in this request, only the "Connection Type" property is relevant here.
Output
The node outputs an array of JSON objects corresponding to the results of each input item processed. Each output item contains a json
field with the response data from the MCP server or database operation.
- For database queries, the output JSON includes query results or status of insert/update/delete operations.
- For Service Layer operations, the output JSON contains the API response data such as created records, fetched data, or authentication session info.
- When binary data is involved (not evident in this code), it would be included separately; however, this node does not handle binary data.
Dependencies
- Requires an API key credential to authenticate with the Unified MCP Server.
- Uses the Axios HTTP client library internally to make REST API calls.
- Needs proper configuration of the MCP Server URL and credentials within n8n.
- For Service Layer connections, maintains a session ID that must be managed (login/logout).
Troubleshooting
- Authentication failures: Ensure correct username, password, and company database name are provided for login operations.
- Invalid SQL queries: When using direct database queries, malformed SQL or incorrect parameters can cause errors.
- Session expiration: Service Layer operations require a valid session ID; if expired, re-login is necessary.
- Transaction errors: Committing or rolling back transactions requires a valid transaction ID; missing or invalid IDs will cause failures.
- JSON parsing errors: Input fields expecting JSON must be correctly formatted; otherwise, parsing will fail.
- Network issues: Connectivity problems with the MCP Server URL will prevent successful API calls.
To resolve errors, verify input parameters, check credentials, and consult MCP Server logs if accessible.