littlehorse-enterprises / littlehorse

This repository contains the code for the LittleHorse Server, Dashboard, CLI, and Java/Go/Python SDK's. Brought to you by LittleHorse Enterprises LLC
https://littlehorse.dev/
Other
119 stars 11 forks source link

Render edge failure message #853

Open mijailr opened 6 months ago

mijailr commented 6 months ago

Context

There is not current implantation to display any ThreadRun errors to the user. The information that is currently implemented is not enough to differentiate the TaskRun error vs ThreadRun error. @eduwercamacaro will have to update the server to accommodate this issue.

For example:

{
  "id":  {
    "wfRunId":  {
      "id":  "6ef3902941bf48ab9163d1f545efdc45"
    },
    "threadRunNumber":  0,
    "position":  1
  },
  "wfSpecId":  {
    "name":  "example-basic",
    "majorVersion":  1,
    "revision":  0
  },
  "failureHandlerIds":  [],
  "status":  "COMPLETED",
  "arrivalTime":  "2024-05-31T20:38:09.616Z",
  "endTime":  "2024-05-31T20:38:09.645Z",
  "threadSpecName":  "entrypoint",
  "nodeName":  "1-greet-TASK",
  "failures":  [
    {
      "failureName":  "VAR_SUB_ERROR",
      "message":  "Failed evaluating edge with sink node 2-exit-EXIT: Mutating variable another with operation ASSIGN: Couldn't convert strVal to INT For input string: \"Hello, World!\"",
      "wasProperlyHandled":  false
    }
  ],
  "task":  {
    "taskRunId":  {
      "wfRunId":  {
        "id":  "6ef3902941bf48ab9163d1f545efdc45"
      },
      "taskGuid":  "d5210b7b89f54d52af4e7ee84e0d5d45"
    }
  }
}

It should check if $.failures[] is not null or empty and change the node status to ERROR. Rendering the $.failures[].failureName and $.failures[].message in a error box.

Components

dashboard server

HazimAr commented 6 months ago

You can reproduce this issue with this WfSpec in java

return new WorkflowImpl(
            "example-basic",
            wf -> {
                    WfRunVariable theName = wf.addVariable("input-name", VariableType.STR).searchable();
                WfRunVariable another = wf.addVariable("another", VariableType.INT).searchable();
                wf.execute("greet", theName);
                wf.mutate(another, VariableMutationType.ASSIGN, "Hello, World!");
            }
        );
HazimAr commented 5 months ago

We still need to discuss this as a team about how to implement this to make the UX enjoyable