Bunq Session
AI-generatedSummary
Ensures a valid bunq API session exists for the configured bunqApi credentials, creating or reusing the installation, device registration and session token, and outputs the session details for use by downstream nodes.
Inputs
- forceRecreate — Boolean, default false. When true, discards the cached session data and redoes the full flow (installation, device registration, session creation). When false, cached data is reused and only missing or expired steps are redone.
Output shape
One output item per input item, each with the same session fields: sessionToken, deviceServerId, userId, sessionCreatedAt (epoch ms), sessionAge (ms since creation, 0 if unknown) and environment ('sandbox' or 'production'). Each item is paired to its input item.
The bunqApi credential (API key, public key, private key, environment) is required. Session state is cached in workflow static data and reused. A cached session is treated as expired after 50% of its timeout (default 604800 s). The node calls bunq's installation, device-server and session-server endpoints only when needed. The session-server endpoint is rate-limited to 1 call per 30 s, so the node may wait before creating a session. Concurrent runs with the same credentials share one in-flight creation. A 466 error on session creation clears the cached data. The output contains the live session token, so handle it as a secret. On error, the node throws a NodeApiError. With Continue On Fail enabled, it instead outputs items containing {error: message}.
Examples
Example 1: Get a session token at the start of a workflow before making custom bunq HTTP calls.
Leave Force Recreate Session off; the node reuses the cached session if it is still valid and outputs sessionToken, userId and deviceServerId.
Example 2: Recover from a revoked or broken session after authentication errors.
Turn Force Recreate Session on for one run to rebuild the installation, device and session from scratch.