Why is My Pipedream Workflow Throwing a 401 Error when Accessing an External API Despite API Key Being Correctly Updated?

This topic was automatically generated from Slack. You can find the original thread here.

Hi , I have a workflow that used to work but now throw a 401 error accessing the exernal API. I have reset the API key and updated it, I have tested the api key manually and it seems to work. When I try to see how pipedream is constructing the payload URL by outputting it to console, the API key comes up as undefined.
Is it really undefined (if so, thats my problem and how do i fix it?) or is it a security feature to not display the apikey?
Please help, I’m at my wits end.

what’s the app?

elvanto

Is that an integrated app? Where are you storing and reseting the API key?

its not integrated. the key is stored in /settings/env-vars and accessed via process.env.API_KEY
but accessing it that way and outputting to console returns undefined

Did you update the key in the Pipedream UI or from within a workflow?

Can you see the API key here? https://pipedream.com/settings/env-vars

in the pipedream UI.
yes I can

Can you paste the code here that you’re using to log it?

(obviously please do not paste the API key here)

console.log(“api_Key:”, process.env.ELVANTO_API_KEY)

api_Key: undefined

Do you see the editor auto-completing when you type process.env?

yes

Hm, I just validated that I can log env vars on my end

its weird huh?

Can you doublecheck you’re in the same workspace where that env var is stored?

yes, but if its relevant, originally this workflow was just sitting in the workspace. recently i was getting popups about how new workflows have ot be in projects so I moved the workflow into a new project. same workspace though.

That shouldn’t matter

Can you log other env vars?