temporalio / samples-typescript

Other
324 stars 126 forks source link

[Feature Request] Is there a way to detect when workflow is in a Failed State but is still "Running" #373

Closed bijeebuss closed 4 months ago

bijeebuss commented 4 months ago

Is your feature request related to a problem? Please describe.

If I try to upsert a search attribute that does not exist like this https://github.com/temporalio/samples-typescript/compare/main...bijeebuss:samples-typescript:main and then start the workflow it will show up as "Running" but it's actually in a sort of failed state. It also does this in other cases like when you forget to export the workflow.

Things I tried

  1. Try/Catch (does not catch the error)
  2. Custom Logger: All I see in the logs is "workflow started" and "workflow completed" and the meta has no way to detect that it actually failed.
  3. setting retry: { maximumAttempts: 1 } when starting the workflow does not cause the workflow to enter an actual "Failed" state

Describe the solution you'd like

A way to detect when a workflow enters a state like this. Maybe it already exists but I can't find anything

bijeebuss commented 4 months ago

reposted here https://github.com/temporalio/temporal/issues/6275