FLOWFUEL
Developer Docs
DEVELOPER INTEGRATION GUIDE

Connecting n8n Workflows to FlowFuel

Standard n8n nodes cannot dynamically pick arbitrary credentials per execution item. FlowFuel acts as an authenticated server-side broker that decrypts client credentials and routes calls to the live Orbio gateway.

n8n code integration

1. Add the HTTP Request Node in n8n

In your n8n workflow canvas, replace direct model API calls with an HTTP Request node pointing to FlowFuel. Authenticate with the shared workflow Bearer token and pass the client public identifier in the request body.

POST {{FLOWFUEL_BROKER_URL}}/api/runs
Headers:
  Authorization: Bearer {{FLOWFUEL_WORKFLOW_TOKEN}}
  Content-Type: application/json

Body:
{
  "clientId": "{{ $json.clientId }}",
  "workflowRunId": "{{ $execution.id }}",
  "task": { "type": "lead_intelligence", "input": "Research this company and include its public website URL: {{ $json.input }}" },
  "model": "google/gemini-2.5-flash",
  "maxOutputTokens": 256
}

2. Concurrency Locks and Idempotency

FlowFuel acquires an in-memory client lock during inference to prevent parallel branches from overlapping balance reads. Retries that reuse the same workflowRunId and client return the original encrypted agent result and receipt instead of billing the client wallet twice, so n8n retries are safe by default.

3. The Strict No-Fallback Invariant

If a client's activated Orbio balance is exhausted or unavailable, FlowFuel stops execution and returns HTTP 422 with status client_unfunded or quota_exceeded. The broker will never fall back to an agency master key or another client balance. Paused clients are rejected with HTTP 403 before any provider call.