SAP B1 Logout
AI-generatedSummary
Invalidates a SAP Business One Service Layer session by POSTing to /b1s/v2/Logout with the supplied B1SESSION cookie, releasing the server-side session. Typically placed at the end of a workflow after a SAP B1 Login node.
Inputs
- b1Session (required) — B1SESSION cookie value to invalidate, usually an expression like {{ $('SAP B1 Login').item.json.b1Session }}. Whitespace is trimmed; an empty value throws an error.
- b1Route — ROUTEID cookie value for load-balanced Service Layer setups. It is declared but the source never reads it, so the logout request sends only the B1SESSION cookie.
Output shape
A single item with json: { success: true, message: 'SAP B1 session invalidated', b1Session, serverUrl } (serverUrl has trailing slashes removed).
The logout call is best-effort: any HTTP error (expired session, network failure, bad SSL) is swallowed, so success is always true once the session is non-empty. The server URL and the SSL-ignore setting come from the sapB1ServiceLayerApi credential, not from node parameters. Only the first item's parameter is read (index 0), so one item is output regardless of input count.
Examples
Example 1: Close the session at the end of a workflow that Login, queried and updated orders.
B1 Session = {{ $('SAP B1 Login').item.json.b1Session }}; leave B1 Route empty.
Example 2: Release a session on a load-balanced Service Layer.
B1 Session = {{ $('SAP B1 Login').item.json.b1Session }}; B1 Route = {{ $('SAP B1 Login').item.json.b1RouteId }} (not used in the logout request).