Newbie needs help with first workflow connecting to a 3rd party API

Here is my code with hidden API key. I’m not getting any errors but also not getting anything in exports. LanguageList is not getting returned. Any help would be appreciated!

import axios from “axios”

const API_KEY = ‘<***>’
const API_URL = ‘https://api.fliki.ai/v1

async function languageList() {
try {
const { data } = await axios({
method: ‘get’,
url: ${API_URL}/languages,
headers: {
Authentication: Bearer ${API_KEY},
‘Content-Type’: ‘application/json’,
},
})

return data ? data.data : null

} catch (error) {
console.log(error)
}

return null
}

export default defineComponent({
async run({ steps, $ }) {
return languageList()
}
})

Hi @kosta0124

First off, welcome to the Pipedream community. Happy to have you!

Thanks for sharing your code and describing the issue.

Could you try moving the content of the languageList function into the run function?

Since neither Logs nor Exports are showing any data, I think the function isn’t being executed at all or there’s a race condition with the asynchronous code.