SAP Service Layer Login
This minimal utility workflow connects to the SAP Business One Service Layer API to verify login credentials and return the session ID. It's ideal for testing access or using as a sub-workflow to retrieve the B1SESSION token for other operations.
++โ๏ธ HOW IT WORKS:++ ๐น 1. Trigger Manually
The workflow is initiated using a Manual Trigger.
Ideal for testing or debugging credentials before automation.
๐น 2. Set SAP Login Data
The Set Login Data node defines four key input variables:
sap_url: Base URL of the SAP B1 Service Layer (e.g. https://sap-server:50000/b1s/v1/)
sap_username: SAP B1 username
sap_password: SAP B1 password
sap_companydb: SAP B1 Company DB name
๐น 3. Connect to SAP
A HTTP Request node performs a POST to the Login endpoint.
The body is structured as:
{ "UserName": "your_sap_username", "Password": "your_sap_password", "CompanyDB": "your_sap_companydb" }
If successful, the response contains a SessionId which is essential for authenticated requests.
๐น 4. Return Session or Error
The response is branched:
On success โ the sessionID is extracted and returned.
On failure โ the error message and status code are stored separately.
++๐ SETUP STEPS:++ 1๏ธโฃ Create SAP Service Layer Credentials Although this workflow uses manual inputs (via Set), it's best to define your connection details as environment variables for reuse:
SAP_URL=https://your-sap-host:50000/b1s/v1/ SAP_USER=your_sapuser SAP_PASSWORD=your_password SAP_COMPANY_DB=your_companyDB
Alternatively, update the Set Login Data node directly with your values.
2๏ธโฃ Run the Workflow Click "Execute Workflow" in n8n.
Watch the response from SAP:
If successful: sessionID will be available in the Success node.
If failed: statusCode and errorMessage will be available in the Failed node.
++โ USE CASES:++ ๐ Reusable Login Module Export this as a reusable sub-workflow for other SAP-integrated flows.
๐ Credential Testing Tool Validate new environments, test credentials before deployment.
Related Templates
Automate Daily Keyword Research with Google Sheets, Suggest API & Custom Search
Who's it for This workflow is perfect for SEO specialists, marketers, bloggers, and content creators who want to automa...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
Add product ideas to Google Sheets via a Slack
Use Case This workflow is a slight variation of a workflow we're using at n8n. In most companies, employees have a lot o...
๐ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments