Hello All,
I was hoping to get some help with a workflow issue I am running into.
The first step of the workflow is to query my RetoolDB to get all the access_tokens which we will call query1. Below is the response:
{"data":[{"access_token":"123"},{"access_token":"456"},{"access_token":"789"},{"access_token":"012"},{"access_token":"345"},{"access_token":"678"},{"access_token":"901"}
After that I want to query an API endpoint using each access_token which we will call query2. I cannot use the loop function because the query times out even after increasing the timeout amount, so what I did was create a separate query for each access_token which works fine for me. The response from one of the access_tokens returns with an array which includes an account_id and institution_id like this:
{"data":{"accounts":[{"account_id":"123456789","balances":{"available":123,"current":123,"iso_currency_code":"USD","limit":null,"unofficial_currency_code":null},"mask":"2222","name":"Bank Basic Business Checking","official_name":"Bank Basic Business Checking","subtype":"checking","type":"depository"},{"account_id":"987654321","balances":{"available":456,"current":456,"iso_currency_code":"USD","limit":null,"unofficial_currency_code":null},"mask":"3333","name":"Bank Basic Business Checking","official_name":"Bank Basic Business Checking","subtype":"checking","type":"depository"}],"item":{"available_products":["balance"],"billed_products":["transactions"],"consent_expiration_time":null,"error":null,"institution_id":"ins_09","item_id":"Pr4YP","products":["transactions"],"update_type":"background","webhook":""},"request_id":"saNM"}}
The final step is where I want to insert a record into my RetoolDB with the access_token from query1, and then the associated numerous account_id and institution_id from query2. How can I achieve that?
Any help would be appreciated.
Thanks