I have an api response, see below (just a snippet). I have to run a backend workflow to save all the data to the database from an api response. The response has multiple seasons, fields and farms per contactid. Currently, I have set up recursive workflows to run through each season, field & farm, but with each workflow I’m calling the api to get a response then passes the info to the next workflow (again calling the api). For some reason this takes time, as running through a customer’s data can take a day or two. Surely there is a better / faster way to do this? Can I save the payload in the db and refer to that or pass the payload to an api workflow? I had a look at “api on a list” but I do not seem to have found a solution. I’ve tried to use the api response as “List to run on”, but it does not except the list.
I hope this makes sense Any help will be appreciated.
{
“api_2”: {
“Contact”: [
{
“ContactId”: -2147481555,
“farm.Farm”: [
{
“FarmId”: -2147480264,
“ContactIdLk”: -2147481555,
“Field”: [
{
“FieldId”: -2147469257,
“FarmIdLk”: -2147480264,
“CropAge”: 1,
“DateLastEstab”: “2022-02-07”,
“PlantSpacing”: “1ha 3.1X1.5m 2151 plants/ha”,
“Season”: [
{
“SeasonID”: -2147433488,
“FieldIDLk”: -2147469257,
“FieldName”: “2023-01 2023 (Banana)”,
“CropCommonName”: “Banana”,
“Cultivar”: null,
“Yield_tZha”: null,
“DateStart”: “2023-01-30T00:00:00”,
“SeasonEnd”: “2024-01-29T00:00:00”,
}
]
},
{
"FieldId": -2147469094,
"FarmIdLk": -2147480264,
"CropAge": 0,
"DateLastEstab": "2023-01-30",
"PlantSpacing": "1ha 3.1X1.5m 2151 plants/ha",
"Season": [
{
"SeasonID": -2147431139,
"FieldIDLk": -2147469094,
"FieldName": "2023-01 2023 (Banana)",
"CropCommonName": "Banana",
"Cultivar": null,
"Yield_tZha": null,
"DateStart": "2023-01-30T00:00:00",
"SeasonEnd": "2024-01-29T00:00:00",
}
]
}
]
}
]
}
]
}
}