This workflow automates the process of linking a new user on your LINE Official Account to their Google Account. When a user adds your LINE account as a friend, this workflow automatically sends them a message with a unique authentication link. After the user approves the connection, their Google profile information is fetched, and a confirmation message is sent, completing the loop.
Before you begin, ensure you have the following:
Follow these steps to configure the workflow.
LINE Webhook node in your n8n workflow.Google Auth Callback node in your n8n workflow.Import the workflow JSON into your n8n canvas and follow these steps to set it up.
First, set up the credentials that the HTTP Request nodes will use.
For the LINE Messaging API:
Name to Authorization.Value to Bearer YOUR_LINE_CHANNEL_ACCESS_TOKEN (replace with the token from Step 1).For the Google API (Dynamic Token):
Name to Authorization.Value, enter a placeholder like Bearer dummy_token. This will be replaced dynamically by the workflow.Now, update the parameters in the following nodes:
Create Google Auth URL node:
value field, replace YOUR_N8N_WEBHOOK_URL_FOR_GOOGLE with the webhook URL of the Google Auth Callback node.YOUR_GOOGLE_CLIENT_ID with the Client ID from GCP (Step 2).Get Google Access Token node:
jsonBody field, replace YOUR_GOOGLE_CLIENT_ID, YOUR_GOOGLE_CLIENT_SECRET, and YOUR_N8N_WEBHOOK_URL_FOR_GOOGLE with your actual GCP credentials and callback URL.Get Google User Info node:
Header Auth.Name to Authorization and the Value to the following expression to use the token from the previous step: Bearer {{ $node["Get Google Access Token"].json["access_token"] }}.Send Auth Link to LINE & Send Completion Message to LINE nodes:
Redirect to LINE OA node:
redirectURL parameter, replace YOUR_LINE_OFFICIAL_ACCOUNT_ID with your LINE OA's ID (e.g., @123abcde).Note: When you are ready for production, remember to replace the "Test" webhook URLs in the LINE and GCP consoles with the "Production" URLs from the n8n webhook nodes.