Skip to main content

Flexible currency rate uploads for SAP B1 with AI validation & multiple sources

Workflow preview

Workflow preview
100%
Flexible currency rate uploads for SAP B1 with AI validation & multiple sources preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow automates currency rate uploads into SAP Business One via Service Layer, using flexible input sources such as JSON (API), SQL Server, Google Sheets, or manual values. It leverages log...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.switch, n8n-nodes-base.httprequest, n8n-nodes-base.microsoftsql, n8n-nodes-base.set, n8n-nodes-base.limit, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.splitout

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Raquel Giugliano.

Original n8n.io source

1.1 Workflow description

Title
Flexible currency rate uploads for SAP B1 with AI validation & multiple sources
Workflow name
Flexible currency rate uploads for SAP B1 with AI validation & multiple sources

This workflow automates currency rate uploads into SAP Business One via Service Layer, using flexible input sources such as JSON (API), SQL Server, Google Sheets, or manual values. It leverages logic branching, AI validation, and logging for complete control and traceability.

++⚙️ HOW IT WORKS:++ 🔹 1. Receive Data via Webhook

The workflow listens on the endpoint /formulario-datos via HTTP POST.

The request body should include:

origen: one of JSON, SQL, GoogleSheets, or Manual

Depending on the value, the flow branches accordingly.

🔹 2. Authenticate with SAP Business One

A POST request is sent to SAP B1’s Login endpoint.

A session cookie (B1SESSION) is retrieved and used in all subsequent API calls.

🔹 3. Switch by Origin The flow branches into four processing paths based on origen:

  • JSON:

The payload is normalized using OpenAI to extract an array of rates.

Each rate is sent to SAP individually after parsing.

  • SQL:

The SQL query provided in the payload is executed on a connected Microsoft SQL Server.

The results are checked by AI to validate the date format.

If valid, rates are sent to SAP.

  • GoogleSheets:

Rates are pulled from a connected spreadsheet.

Each entry is sent to SAP in sequence.

  • Manual:

Uses currency, rate, and rateDate directly from the webhook payload.

Sends the result directly to SAP.

🔹 4. AI-Powered Enhancements (Optional but enabled)

  • Normalize JSON: Uses OpenAI (LangChain node) to convert any messy structure into a uniform array under the key rate.

  • Date Formatting: Another OpenAI call ensures RateDate is in yyyyMMdd format (required by SAP), converting from ISO, timestamp, or other formats.

🔹 5. Send to SAP Business One (Service Layer) All paths send a POST request to:

/SBOBobService_SetCurrencyRate With a payload such as:

{ "Currency": "USD", "Rate": "0.92", "RateDate": "20250612" }

🔹 6. Log Results

All success/failure results are appended to a Google Sheets log (LOGS_N8N)

The log includes method, URL, sent payload, status code, and message.

++🛠 SETUP STEPS:++

1️⃣ Create Required Credentials: Go to Credentials > + New Credential and configure:

  • SAP Business One (Service Layer)

Type: HTTP Request Auth or Token

Base URL: https://<your-host>:50000/b1s/v1/

Provide Username, Password, and CompanyDB via variables or fields

  • Google Sheets

OAuth2 connection to a Google account with access

  • Microsoft SQL Server

SQL login credentials and host

  • OpenAI

API key with access to models like GPT-4o

2️⃣ Environment Variables (Recommended) Set these variables in n8n → Settings → Variables:

SAP_URL=https://<host>:50000/b1s/v1/ SAP_USER=your_username SAP_PASSWORD=your_password SAP_COMPANY_DB=your_companyDB

3️⃣ Prepare Google Sheets

  • Sheet 1: RATE (for charging the data)

Columns: Currency, Rate, RateDate

  • Sheet 2: LOGS_N8N (to save the logs, success or failed)

Columns: workflow, method, url, json, status_code, message

4️⃣ Activate and Test Deploy the webhook and grab the URL.

++✅ BONUS++

  • Built-in AI assistance for input validation and structure

  • Logs all results for compliance and audit

  • Flexible integration paths: perfect for hybrid or transitional systems

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 1

Block 2 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 3 - Enviar SAP (JSON)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Conectar SAP

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Microsoft SQL

Type / Role
n8n-nodes-base.microsoftSql - microsoftSql
Config choices
Version 1.1

Block 6 - Extraer Query

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Enviar SAP (SQL)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Limit

Type / Role
n8n-nodes-base.limit - limit
Config choices
Version 1

Block 9 - Enviar SAP (MANUAL)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 11 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 12 - Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 13 - Enviar SAP (SHEET)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Success

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 15 - Fallo

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 16 - Success1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 17 - Comprobar Fecha

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 18 - Fallo1

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 19 - Success2

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 20 - Fallo2

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 21 - Success3

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 22 - Fallo3

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

3. Summary Table

Workflow Flexible currency rate uploads for SAP B1 with AI validation & multiple sources
Complexity advanced
Nodes 22
Categories Engineering, AI Summarization
Author Raquel Giugliano
Published 14 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4931/4931.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Flexible currency rate uploads for SAP B1 with AI validation & multiple sources do?

This workflow automates currency rate uploads into SAP Business One via Service Layer, using flexible input sources such as JSON (API), SQL Server, Google Sheets, or manual values. It leverages log...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.