Return json response from back end workflows

Hi everyone,

  • I’m struggling to pass back responses to a front end workflow from a backend workflow (api workflow) as part of a scheduled call from FE.
  • When I call the API (openAI via bubble API connector) as a one-off from front end it works fine and bubble clearly reads the json response and let’s me handle/store the response in the FE.
  • But when I call the same API multiple times via the back end workflow and try to return the responses to the front end, the FE workflow doesn’t recognise the structure of the response.
  • I’m sending as JSON. I’ve defined the specific parameters that I need via the “return data from api” step in my BE workflow.

Clearly bubble handles responses from BE workflows in a different way to direct API responses called from front end workflows. I’ve been going round on this for hours - I know it will be something simple because i can see what i want to return to FE right there in the server logs! Thanks a lot to anyone who can help!

Can you share what you have set? API Connector and backend WF (return data from API)? Did you use other content-type instead to build your JSON?

Thanks for the quick reply! yes exactly - I have the API connector set up with an OpenAI API call. I then trigger this in the BE workflow. The response from the OpenAI API call is JSON. The OpenAI API call requires 2x text field inputs. I’ve tested the call via the API connector and it works fine.

What I mean is how do you trigger the backend workflow? using API connector? This is the only way to get a response from a backend WF to frontend…

ah sorry: I’m triggering via a “schedule API workflow” action in the frontend workflow

This won’T work. Return data from API will not be applied. You need to use API Connector for that. Or app connector