com.glide.plan.runners.FlowObjectAPIException: The current execution is in the waiting state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2024 09:20 AM
Hello all,
I'm running a script to execute a subflow and make use of the output (actually as part of a function in a scripted REST API). I'm using the standard method to run the subflow synchronously (in the foreground) to wait for the output. Here's a code snippet:
var inputs = {};
inputs['quoteids'] = quoteIds;
var result = sn_fd.FlowAPI.getRunner().subflow('x_canl_circuit_quo.proceed_customer_quote_to_opportunity').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();
var Orders = outputs['provisioningreqs'] || '';
I can see from the executions that the subflow runs OK. But the issue is, it has a Wait action in it (just for 2 seconds) and I think it's because of that that when I run the script, I get this error:
"com.glide.plan.runners.FlowObjectAPIException: The current execution is in the waiting state"
It's like FlowAPI does not want to wait for any time at all for the Wait action to finish. I guess it just sees the Wait action and then has a little freak out.
Have any of you experienced the same, and know how to deal with it?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 02:34 AM
@Jamsta1912 The error you're seeing"The current execution is in the waiting state" is a known behavior when using FlowAPI to execute a flow or subflow containing a Wait action. FlowAPI is not designed to handle Wait actions well because it expects immediate execution without pauses , you can run asynchronously so that won't run immediately.
hope this will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2024 06:05 AM
Hi Abhay,
Thank you for your reply. I can run the subflow asynchronously but that would defeat the purpose: I need to run it synchronously in order to make use of the output in the script where it's running.