Using flow variables for tokens in GET requests does not work in New Dialog

Hallo,

What it’s about: For a project, I need to read data from sensors via a REST interface and store it in a database. To do this, I have to use a token for n users, which I have to determine. This token must then be used later for the GET request nodes.

The token is determined using the Python node and stored in a flow variable.

I use a loop to create the URL for the GET request for a specific period of time.

The URL and token are then used by the GET request.

It is very important that this works 100%. The created worksheet must ultimately run in specific cycles. The token is occasionally renewed by the provider.

I’m absolutely certain that I managed to do it in the old dialog. Unfortunately, I no longer have a screenshot of the old dialog. It was this dialog

I’ve been working on the worksheet for weeks now, and yesterday I spent two hours trying to figure out why some GET requests work and some don’t. There was a new token. So I could continue working, I manually inserted the new token everywhere.

The new dialog is now also available for GET requests. Here, using the flow variable for the token doesn’t work for me.

It works with the flow variable for the URL.

Credentials:

Token inserted manually here. I can also select the flow variable manually. If I do this, the Credentials field cannot be changed. However, this has no effect; the token is not taken from the flow variable. Even if I leave the field blank.

When I use variables and select my flow variable with the token, something is transferred to the Credentials variable, but it doesn’t work.

Am I doing something wrong?

This functionality is essential for a scientific university project. The worksheet should run automatically in two weeks.

If it is a bug, how quickly can it be fixed?

Best regards

Patrik

Hi @PatrikS

I could not really follow how you create this credential variable in python. In general, even if it has the new UI, the node works 1:1 like in the classic UI. If we introduce breaking changes, you will notice the old node gets (deprecated) added to the node name and there will be a new node with exacly the same name.

But the MISSING indicates that
a) the variable is not there anymore OR
b) there might be a session timeout after you have set the variable (e.g. If a Google session expires and the list of Google Sheets can no longer be retrieved, a previously configured selection of the sheet to be read will be shown as MISSING. You then need to rerun the session)

1 Like

Hello,

Here’s how I create the token:

Everything works with this setting. I think I copied the “Tocken” part here.

If the provider changes the token, nothing will work anymore. This happened at the office.

If I change it as follows, “missing” and the token appear. I copied the entry and it matches the created token.

GET Request

Execute failed: No credentials stored to name “ …And the token is displayed here…..

Hallo,

Okay, I’ve looked at everything again.

The fact is, I can select a flow variable manually. However, this isn’t supported.

Why?

It only works if I copy the token into the input field. That’s it.

If I select “Variable” and then the flow variable, the error occurs as described.

The fact that the flow variable isn’t used manually only came to light because the provider changed the token. I was initially told it would never change for a customer. But apparently, that’s not the case.

I then searched through the examples and found the following approach, which also doesn’t work.

The actual worksheet was developed over the last few weeks, and there have never been any timeouts or other problems. Hundreds of GET requests are made every day.

The workflow is now set up, and it’s crucial that it continues to run even if the token changes.

So, how do I achieve this?

For manual implementation, I need to be able to use a flow variable.

Regards,
Patrik

Hi Patrick,

It seems to me that you are trying to use a flow variable of StringType as bearer token input. But this was never supported, you need to create a credentials flow variable for your token.

When we migrated this node to the modern UI dialogs we missed to remove the flow variable control icon from the “Token“ text input field and from the credentials dropdown which makes it confusing to use.

So you need to use the “Variable to Credentials“ node to first create a credentials flow variable for your token, then choose “Bearer Token“ as authentication method, select “Variable“ credentials type and use the dropdown to select you credentials flow variable.

Hope that helps

Magnus

3 Likes