cschleiden / go-workflows

Embedded durable workflows for Golang similar to DTFx/Cadence/Temporal
https://cschleiden.github.io/go-workflows/
MIT License
218 stars 50 forks source link

UI errors when workflow has been created but not started executing #321

Open cspotcode opened 6 months ago

cspotcode commented 6 months ago

I have created a bunch of workflows but they have not started executing because the worker is logging an error "workflow NameOfMyWorkflowFunc not found" That error is probably unrelated to this bug report, but it's useful context.

Their history appears to contain a WorkflowTaskStarted and WorkflowExecutionFinished but not a WorkflowExecutionStarted. (I assume due to the error)

When I click a workflow in the Web UI and it tries to render the history details, it checks for WorkflowExecutionStarted and so fails with an error. The browser tab appears empty, no UI, no header.

Here is where it checks for WorkflowExecutionStarted https://github.com/cschleiden/go-workflows/blob/e9dff1b81342628d6366c492be0b6fec7ad58f0a/diag/app/src/Instance.tsx#L50-L54

Should it be checking instead for WorkflowTaskStarted?

cschleiden commented 6 months ago

WorkflowTaskStarted is added for every "execution slice", that wouldn't be the correct event to check here. I think the UI needs to be upated to handle this error scenario 🤔

cspotcode commented 6 months ago

I noticed that any workflows which cannot be executed are immediately closed. Should they be left open?

If, due to some operational hiccup, the worker believes it cannot execute a workflow, that workflow should be left pending, right? Ideally testing would catch something like this from ever reaching prod, but it still seems risky for a durable execution tool to close the workflows without doing whatever work is meant to happen.

I can create a separate ticket for this if you prefer.