"Failed to find complex object collection definition" when executing Flow via sn_fd.FlowAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 09:24 AM - edited 04-16-2025 09:25 AM
Our sub-instances are currently Yokohama, and our production instance is Washington DC.
In our Yokohama sub-instances, I was able to execute a Flow via script by copying the Code Snippet for the Flow and providing the appropriate 'changed_fields' Array.Object. Executing the following in an Xplore session works as expected:
try {
var inputs = {};
inputs['current'] = manufacturerGR; // GlideRecord
inputs['changed_fields'] = [
{
"current_display_value": "true",
"current_value": "true",
"field_name": "manufacturer",
"previous_display_value": "false",
"previous_value": "false"
}];
inputs['table_name'] = 'core_company';
// Execute Synchronously: Run in foreground.
sn_fd.FlowAPI.getRunner().flow('global.company_sync').inForeground().withInputs(inputs).run();
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
However, this flow is unable to be triggered via script in our Washington DC production environment. On execution of the above script, the following error is caught: "Failed to find complex object collection definition".
Removing the Try/Catch from the script, the uncaught exception is the following:
"com.snc.process_flow.exception.ProcessAutomationException: Failed to find complex object collection definition"
I have been unable to find any resources online that explains the exception and am unable to find another way to trigger this flow via script. Additionally, I have tried parsing the object in the 'changed_fields' array to JSON. I have also attempted to trigger the flow with the following function, as described in the docs linked here:
sn_fd.FlowAPI.executeFlow('global.company_sync', inputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 07:21 AM
Remove following code and try again.
inputs['changed_fields'] = [ { "current_display_value": "true", "current_value": "true", "field_name": "manufacturer", "previous_display_value": "false", "previous_value": "false" }];