HOW IT WORKS: This workflow automates the creation of Journal Entries in SAP Business One (SAP B1). Depending on the source of the input data, it dynamically transforms and sends accounting records in the appropriate format using the Service Layer API. It supports three input types: - π¦ JSON payloads - π Google Sheets data - π§βπ» Manual structured entries (via prompt + LLM) Each transaction is logged to Google Sheets for traceability. πΉ 1. Webhook Input Reception A Webhook node waits for a POST r

HOW IT WORKS: This workflow automates the creation of Journal Entries in SAP Business One (SAP B1). Depending on the source of the input data, it dynamically transforms and sends accounting records in the appropriate format using the Service Layer API. It supports three input types: - π¦ JSON payloads - π Google Sheets data - π§βπ» Manual structured entries (via prompt + LLM) Each transaction is logged to Google Sheets for traceability. πΉ 1. Webhook Input Reception A Webhook node waits for a POST request containing accounting data and metadata: The origen field determines the data source (JSON, GoogleSheets, or Manual) The sapurl, username, password, and companydb are used to connect to SAP B1 Payload can be a JSON list or tabular data (e.g., from Google Sheets) πΉ 2. SAP B1 Login Credentials are securely injected from the request body. A login request is sent to SAP B1's Service Layer to retrieve a valid session cookie (B1SESSION). πΉ 3. Dynamic Branching via Switch Node Depending on the value of origen, one of the following branches is activated: - JSON: Sends the JSON payload directly to SAP after restructuring - GoogleSheets: Loads rows, builds JSON, and merges context - Manual: Transforms data via OpenAI LLM prompt and generates SAP-compatible format πΉ 4. Data Transformation via LLM In Manual and GoogleSheets flows, the workflow uses an OpenAI node to: Parse line entries and convert them to JournalEntryLines[] Format the final JSON structure required by SAP LLM prompts are carefully crafted to return only clean JSON β no code blocks, comments, or explanations. πΉ 5. POST to SAP B1 Data is sent to {{SAPURL}}/JournalEntries using the Service Layer's POST method with the B1SESSION cookie attached. The body includes all JournalEntryLines. πΉ 6. Logging Success & Errors Each result (success or failure) is logged into a centralized Google Sheets log document: - β Success: Includes HTTP status, source URL, and JSON payload - β Failure: Logs the error code and message for review and traceability SETUP STEPS: 1. Create Required Credentials: - Google Sheets OAuth2 API (to log all responses and fetch data) - OpenAI API Key (used with the LangChain OpenAI node) - SAP Service Layer login data is passed securely via body parameters. 2. Use These Environment Variables (Recommended) or replace the data in the corresponding container: - SAPUSER, SAPPASSWORD, SAPCOMPANYDB - SAPURL 3. Prepare Google Sheets: - π Sheet 1: For source entries (e.g., for GoogleSheets origin) - π§Ύ Sheet 2: For logging execution results Make sure the logging spreadsheet contains these columns: workflow, method, url, json, statuscode, message EXTRA NOTES: π§ Uses OpenAI GPT-4o for natural language transformation of accounting rows π§© Modular logic with error-handling for all branches π Can be reused across multiple accounting integrations by changing the data source
Download the workflow JSON file after purchase.
Open n8n β click the menu β Import from File.
Select the downloaded JSON and import.
Set up credentials for each node that requires them.
Click Execute Workflow to test, then activate.
Setup guide included
Purchase to unlock the full step-by-step guide
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.