i have a very large json. The format is as below:
{
"EmployeeDetails": {
"UserInfo": [
{
"EmployeeID": 25450,
"FirstName": "Ram",
"MiddleName": "Kumar",
"LastName": "Bharati",
"Username": "rambh111",
"Status": "ACT",
"WFHRecords": [
{
"Date": "2022-05-24",
"Year": "2022",
"Month": "5",
"Day": "24",
"WFH": true,
"WFHApproved": true,
"WFHRemarks": "Working from home"
},
{
"Date": "2024-07-02",
"Year": "2024",
"Month": "7",
"Day": "02",
"WFH": true,
"WFHApproved": true,
"WFHRemarks": "Working from home for COVID"
}
]
},
{
"EmployeeID": 25451,
"FirstName": "Rakshya",
"MiddleName": "",
"LastName": "Panta",
"Username": "rapan062",
"Status": "ACT",
"WFHRecords": [
{
"Date": "2023-10-20",
"Year": "2023",
"Month": "10",
"Day": "20",
"WFH": true,
"WFHApproved": true,
"WFHRemarks": "Work from home"
},
{
"Date": "2024-07-02",
"Year": "2024",
"Month": "7",
"Day": "02",
"WFH": true,
"WFHApproved": true,
"WFHRemarks": "Working from home"
}
]
}
]
}
}
There are many users and their WFHRecords is also very large. For above json, the flow is working fine But issue is showing for longer arrays (170 users and more than 500 WFHRecords ).

Apply_to_each_Employee keeps on running for longer json. Also while testing bad gateway is displayed. What is the issue here? Is it because the json is tooo large? cause this same flow works fine for smaller json.