Forum Academy Marketplace Showcase Pricing Features

Backend Workflow to Create Things - External API Data Not Populating?

I have a backend workflow that I creating things based upon a webhook coming in. The webhook comes in and the workflow is creating things appropriately with the data from the webhook + some fields where simple data is input (text for instance). What isn’t working is the same setup there are multiple fields on the thing which I’m using “Get Data from External API” to fetch additional info based on the webhook data and complete this “thing”.

This is all rolled into a single action for “Create a Thing”. Problem is… none of the fields from the External API are being filled out and the server logs aren’t showing any errors on this step. The exact same API call, in a non-thing creation use case, is returning appropriate data, so I know the API call is working.

So question is - what could be wrong here? Why would the API call work in one place and not as part of the thing creation?

Appreciate any help on this, thanks!

Are you adding the data from webhooks and external API into a single row?

Single thing, but i’m not mixing external API data and typed data into single fields. Green fields came across, red ones are not:

Does that help?

Seeing something odd here. Bubble seems to think that the API is returning a list when it’s only returning a single result. Possible is that the issue? I’m not sure why Bubble thinks its a list…

  1. Since you are adding web hook data along with api data. May be bubble is not waiting for the api data and move ahead. So what you can do is create the custom event and in that fetch the api data first and store in temp db and after that add this into thing.

  2. Why API is returning list? That you have to check from the backend (where you are writing the api)

I think it’s an authentication issue with the plugin since the backend workflows run as an anonymous user, the API isn’t getting the authorization tokens, etc. Is there a way to run a backend workflow as a specific user?

1 Like