[Tough problem to solve] Return data from API when this data is obtained from another backend workflow

@pachocastillosr I’m a little puzzled.

In Backend Workflow A, are you using the ‘Schedule API workflow on a list’ action and using Backend Workflow B as the selected workflow?

If so, how is the final list calculated on Backend Workflow B? Wouldn’t this just return a bunch of responses back to Backend Workflow A - none of which individually are final, but together make the final list?


If Backend Workflow B is able to return the desired output using the ‘Return data from API’ action and all you need to do is just return it back to James, then this is possible.

In my situation, I make a request to Workflow A, it then calls Workflow B via an API call. Workflow B then makes an external API call which returns some ugly XML, which I then format into JSON and respond to Workflow A with a nice format that Bubble can understand. Workflow A now has the right data and this can be returned to the end user.

You can do this with the help of the API connector to call Backend Workflow B from Backend Workflow A. In terms of process, this is generally what happens;

  1. James calls backend workflow A
  2. Backend workflow A calls backend workflow B via an API call setup in the API connector
  3. Backend workflow B then executes, with the last action being ‘Return data from API’
  4. Backend workflow A then gets this response
  5. Backend workflow A uses the ‘Return data from API’ and its dynamic expression is the result of the API Connector API call
  6. James gets the response he needs

Basic instructions to set this up;

  1. Create both backend workflow A and B, both should have ‘Return data from API’ as their final action. Add whatever other actions you need the API workflows to perform before that.
    image

  2. Jump into the API connector and create a new POST request using the URL for backend workflow B, including whatever parameters backend workflow B needs from backend workflow A to execute

I personally prefer to use the API functionality in a custom plugin because it lets you specify different URLs for dev and live which is useful for overall reliability but for the sake of this example, the API connector works too.

  1. Add the API call as an action for backend workflow A, making sure you pass the variables required

  2. Add ‘Return data from API’ action to backend workflow A, using the result of the API call as the response

1 Like