{"product_id":"optimize-btg-oauth2-callback-in-n8n-with-data-table-storage","title":"Optimize BTG OAuth2 Callback in n8n with Data Table Storage","description":"\u003cp\u003eStreamline your BTG Empresas OAuth2 integration with this comprehensive n8n workflow that automatically handles authentication callbacks, token exchange, and secure storage in Data Tables. Perfect for developers building financial applications that need reliable BTG API access management.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eThis workflow creates a complete OAuth2 callback handler for BTG Empresas authentication:\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eReceives GET requests on the \u003ccode\u003e\/webhook\/btg-callback\u003c\/code\u003e endpoint when BTG redirects users after OAuth login\u003c\/li\u003e\n\u003cli\u003eExtracts the authorization code from the callback URL's query parameters\u003c\/li\u003e\n\u003cli\u003eExchanges the authorization code for access and refresh tokens via BTG's token endpoint at \u003ccode\u003ehttps:\/\/id.btgpactual.com\/oauth2\/token\u003c\/code\u003e\n\u003c\/li\u003e\n\u003cli\u003eStores both tokens securely in an n8n Data Table called \u003ccode\u003ebtg_tokens\u003c\/code\u003e using upsert operations\u003c\/li\u003e\n\u003cli\u003eReturns a JSON success message to the browser confirming authentication completion\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cp\u003eThis BTG OAuth2 workflow is ideal for:\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eFinancial application developers\u003c\/strong\u003e building integrations with BTG Empresas banking services\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eSaaS platforms\u003c\/strong\u003e requiring automated BTG API authentication for their users\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eBusiness automation teams\u003c\/strong\u003e connecting BTG accounts to n8n workflows for financial data processing\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eFintech startups\u003c\/strong\u003e implementing secure token management for BTG Pactual integrations\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cp\u003eBuilt with essential n8n nodes:\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cstrong\u003eWebhook node:\u003c\/strong\u003e Handles BTG OAuth2 callback requests\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eSet node:\u003c\/strong\u003e Maps authorization code from query parameters\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eHTTP Request node:\u003c\/strong\u003e Exchanges code for tokens with BTG's OAuth2 endpoint\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eData Table nodes:\u003c\/strong\u003e Securely stores access and refresh tokens\u003c\/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eRespond to Webhook node:\u003c\/strong\u003e Returns success confirmation\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003eSetup requires creating a \u003ccode\u003ebtg_tokens\u003c\/code\u003e Data Table with key-value columns, registering your n8n webhook URL in BTG's developer portal, and configuring your Base64-encoded client credentials. This workflow ensures your BTG Empresas integration maintains proper OAuth2 compliance while providing reliable token storage and management.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45544313454771,"sku":"N8N-16009","price":20.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/LMOB8J87nOuLLOuJDbt20_7bcaa482265045d4a070abd2cf665a63.jpg?v=1780089849","url":"https:\/\/buyflowscripts.com\/products\/optimize-btg-oauth2-callback-in-n8n-with-data-table-storage","provider":"N8N Commerce","version":"1.0","type":"link"}