No refresh token (Google Big Query OAuth2)

Hello n8n community,

I’d just like to start off by thanking you for all of your amazing work, we absolutely love working with n8n.

Regarding our problem - we are working on using n8n as an ETL, to transfer data from all of our data sources (HubSpot, our webapp, emailing tools, etc.) into Google Big Query tables.

However, we are encountering a problem with the Refresh Token. We are using OAuth2 with the following setup:

After an initial connection, we are able to stream data into the Big Query tables for about an hour before the workflow starts failing for the following reason:

ERROR: Error: No refresh token

Error: Error: No refresh token
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest.node.js:806:27)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:416:47```

Opening the credentials and reconnecting will give us a new valid token for another hour.

Has anyone else encountered a similar issue?

Thanks,
Maxim

Hey @maximp!

Welcome to the community :tada:

Thank you for your love!

We recently added the Google BigQuery node. You can use the node to create and get your records. If there’s any specification functionality that the node is missing please let us know by creating a feature request :slight_smile:

Hey @maximp!

Were you able to get it working with the Google BigQuery node?

Hi @harshil1712!

Thanks for following up.

We are having some trouble updating n8n on Heroku, updating the N8N_VERSION config variable isn’t working as intended. It’s building to 0.112.0 for some reason.

I have pinged my CTO for assistance and will get back to you as soon as I have any news!

1 Like

Hi again @harshil1712!

We just got it up and running - and it works great!

It would be amazing to be able to query a specific table to return not all values but for example the answer to an SQL query.

We had this working with a HTTP request if it can help :slight_smile:

{
  "nodes": [
    {
      "parameters": {
        "authentication": "oAuth2",
        "requestMethod": "POST",
        "url": "=https://bigquery.googleapis.com/bigquery/v2/projects/[project_name]/queries",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "query",
              "value": "=SELECT act.campaign_id FROM [project_name] as act\nLEFT JOIN [project_name] as camp\nON act.campaign_id = camp.campaign_id\nWHERE camp.campaign_id IS NULL\nGROUP BY act.campaign_id"
            },
            {
              "name": "useLegacySql",
              "value": "false"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "Accept",
              "value": "application/json"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "queryParametersUi": {
          "parameter": [
            {
              "name": "key",
              "value": "[KEY]"
            }
          ]
        }
      },
      "name": "Get campaigns",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        -200,
        200
      ],
      "notesInFlow": true,
      "credentials": {
        "oAuth2Api": "Google Big Query OAuth 2"
      },
      "notes": "- group by campaign\n- left join + null\n- add remaining"
    }
  ],
  "connections": {}
}

Thanks for your help!

1 Like

Hey @maximp!

Awesome! Good to know that it works for you now :tada:

Can you open a Feature Request post for the functionality you need? It would help us if you can share some more details there :slight_smile:

1 Like