@maxim what would be the best approach to terminate a workflow execution from the workflow itself depending on the response from an activity?
Is it ok to implement something similar to your code in the workflow method? should we use a local activity instead??
Thanks in advance.
PS: Just to clarify, I know that if we return from the method it will finish the execution, but the thing is that by finishing the workflow in that way, when you check in temporal web the workflow will appear as completed. I would like it to appear as ‘Failed’.
@ryland@maxim
i have a namespace → n
In that namespace
Let say i have a workflow->w1, in queue q1
Let say i have a workflow->w2, in queue q2
Can i teminate workflow w2 from workflow w1, if i have workflowID?
i have distributed architecture.
for each service, handles some resource, for each resource i am running workflow in a queue
I have named queues based on service name.
So resource 1 of servuce A resource 2 of service B are linked through FK key. If i want to terminate workflow of resource 1 , i also want to terminate all related workflows
Hello there, Im working with the Golang SDK attempting to terminate a workflow. In code we don’t actually care if there was a running workflow running already, we call Terminate() as part of deleting a tenant from a system. Per the lib annotations the method may return a couple of serviceerror errors. How do we check for those errors? I want to ignore NotFound instances. The following code does not work:
err := s.temporalClient.TerminateWorkflow(ctx, domain.BuildTenantAutorenewalWorkflowID(tenantID), "", "tenant deletion request")
if !errors.Is(err, &serviceerror.NotFound{}) && !errors.Is(err, sql.ErrNoRows) {
// if not found, nothing to delet, otherwise bubble up
s.l.Error("DeleteTenant: failed to delete autorenewal tenant workflow", zap.String("TenantID", tenantID.String()), zap.Error(err))
return fmt.Errorf("failed to delete autorenewal tenant workflow: %w", err)
}
And the actual error is literally sql.ErrNoRows
My log entry:
2023-10-31T01:14:22Z ERROR service/cert-monitor.go:372 DeleteTenant: failed to delete autorenewal tenant workflow {"TenantID": "9bcabd90-7748-11ee-a4bb-290f18bcdfca", "error": "sql: no rows in result set"}