-
Feature
-
Resolution: Unresolved
-
Major
-
1.34.0
-
None
-
False
-
None
-
False
-
-
Having this piece of code:
package com.example; import org.kie.kogito.serverless.workflow.executor.StaticWorkflowApplication; import org.kie.kogito.serverless.workflow.models.JsonNodeModel; import org.kie.kogito.serverless.workflow.utils.ServerlessWorkflowUtils; import org.kie.kogito.serverless.workflow.utils.WorkflowFormat; import io.serverlessworkflow.api.Workflow; import org.kie.kogito.process.Process; import java.io.FileReader; import java.io.IOException; import java.io.Reader; import java.util.Collections; public class DefinitionFileExecutor { public static void main(String[] args) throws IOException { System.out.printf("Initialize the workflow: %s\n", args[0]); try (Reader reader = new FileReader(args[0]); StaticWorkflowApplication application = StaticWorkflowApplication.create()) { Workflow workflow = ServerlessWorkflowUtils.getWorkflow(reader, WorkflowFormat.JSON); application.process(workflow); System.out.println("Workflow execution result is correct"); } catch (Exception e) { System.err.println("Workflow is not valid: " + e.getMessage()); } } }
And this json
{ "id": "hello", "version": "1.0", "name": "Hello Workflow", "description": "Inject Hello World", "start": "Hello", "functions": [ { "name": "getIP", "type": "custom", "operation": "rest:get:https://ipinfo.io/json" }, { "name": "pushData", "type": "custom", "operation": "rest:post:https://httpbin.org/post" }, { "name": "logInfo", "type": "custom", "operation": "sysout:INFO" } ], "errors":[], "states": [ { "name": "Hello", "type": "inject", "data": { "greeting": "Hello World", "mantra": "Serverless Workflow is awesome!" }, "end": true }, { "name": "Get public IP", "type": "operation", "actions": [ { "functionRef": { "refName": "getIPO" }, "actionDataFilter": { "toStateData": ".ip_info" } } ], "onErrors": [ { "errorRef": "notAvailable", "transition": "logError" } ], "transition": "push_host_data" } ] }
I can only get one error, I would like to get all the errors, like not GetIPO function, no notAvailable error, etc..
The reason is to use this in RHDH AI, where a workflow need to "autofixed" by the AI, so the idea is to say, in the given workflow are the following errors:
Error1: CXXXX
Error2: XXXXX
When this happens, the AI will fix the error. Having one error, means that the fix iterations are exponential, and the cost per each request is expensive (We pass the jsonschema which is 10k tokens ish) so things get super expensive in each iteration.