Better Oauth2.0 workflow for Pipedrive CRM with Supabase
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs when an HTTP GET request hits its webhook URL (plus 2 other triggers). Along the way it connects Supabase. It also calls oauth.pipedrive.com over HTTP.
How it runs
Trigger: When an HTTP GET request hits its webhook URL (plus 2 other triggers).
- convert clientId and secret to base (Code): runs custom JavaScript code
- Supabase: get
- Get Pipedrive Token (Supabase): get
- Generate Refresh Token from authcode (HTTP Request): calls oauth.pipedrive.com (POST)
- combine client id and secret (Edit Fields (Set)): sets 1 field: authheader
- Get contact from Pipedrive (HTTP Request): calls an HTTP API
- Look for the related record in Supabase (Supabase): get
- Get Pipedrive acess token (HTTP Request): calls oauth.pipedrive.com (POST)
- Access Token Invalid (If): checks a condition and branches into true / false
- If: checks a condition and branches into true / false
…plus 7 more steps. See the full node list below.
Services it uses
HTTP calls to: oauth.pipedrive.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (8)
- Stop and Error
n8n-nodes-base.stopAndError - Supabase
n8n-nodes-base.supabase - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Code
n8n-nodes-base.code - Edit Fields (Set)
n8n-nodes-base.set - Webhook
n8n-nodes-base.webhook
From the author
This workflow provides an OAuth 2.0 auth token refresh process for better control. Developers can utilize it as an alternative to n8n's built-in OAuth flow to achieve improved control and visibility. In this template, I've used Pipedrive API, but users can…