Hi all!
I am going to submit this to support but thought I’d see if any other have input or similar experience. Forewarning…this post is long.
I have been battling this issue for a few days now and no closer to identifying the cause. In a nutshell, I am seeing a Bot error due to timeout. The step causing the timeout is duplicating the set of row add entries EXACTLY 4 times - even finishing any triggered Bots (step set to trigger other bots) before fully halting.
- The issue DOES NOT occur if user selects smaller lists in Form (see background below).
- If I disable the triggered Bot, the issue DOES NOT occur.
- Issue DOES NOT occur in an undeployed app copy - so I can replicate it in a sample app.
A little background…
I am supporting a Crop Services app. In this app a user will create an Activity where they will choose a list of Fields and a list products to be applied. The Fields and Products are chosen in EnumList/Ref columns - one for Fields and one for Products. The process flow then triggers automation which uses API steps to expand the chosen lists to add associated rows to several tables (up to 8).
The tables related to this issue are Activity Farms and Activity Farm Products. We’ll focus on these two. Based on the chosen Field list, the assigned Farms are extracted and entered into their own table with calculated Acreage. Then Activity Farm Products is populated based on chosen Products and calculated Quantity based on Farm acreage. Following so far?
The process flow…
A user will enter an Activity, choosing a list of Fields and a list of Products (among other choices). When the Activity is Saved, a Bot populates the Activity Fields table and a second step populates the Activity Farms table. Both use API Tasks in attempts to add rows in bulk and speed up the overall processing.
Since API row adds may not be available for subsequent steps in a Bot, the Activity Farms add step uses the EnumList of chosen Fields (as opposed to the newly entered Activity Fields rows) from which to select a unique list of Farms. See the API JSON Code excerpt below designed to handle both adds and updates:
<<START:UNIQUE([ReportTask_Fields_Included][Farm_Link] - [Related Activity_Farms][Farm])>>
{
"Activity": "<<[ReportTaskID]>>",
"Entities": "<<[GrowerFarmsID].[Entities]>>",
"Farm": "<<[GrowerFarmsID]>>",
"Add_Products": "<<[Related REC_Products][Rec_Products_ID]>>"
}
<<END>>
The add Activity Farms step is set to trigger other bots, and for any newly added Activity Farm row where the “Add_Products” column is not blank, another Bot triggers and uses the “Add_Products” column in another API Task to insert rows into the Activity Farm Products table.
The Analysis…
Reviewing data, only the Activity Farms table rows are being duplicated. Based on row time stamps and physically watching the process, it appears the “Save Activity Farms” step ONLY is being re-executed multiple times.
But only when the list of chosen Fields is 15+ and the chosen Products is 5+. When the chosen listes are smaller, then everything executes as expected.
As noted at the beginning, if I disable the triggered bot that adds the Activity Farm Products, no duplication of adding Activity Farms occurs and automation completes successfully. Of course no Activity Farm Products rows are added!
Turning off “Trigger other bots” didn’t seem make any difference. Other bots were still triggered, duplication still happened and timeout error still occurred.
Conclusion…
It appears that when there are API steps adding rows that then trigger another Bot that also adds rows through an API step, the first API Task is being re-executed but only when there is a certain volume of these rows adds?
Any thoughts at all??
