How to restart job in zeebe

317 Views Asked by At

I have method, as part of zeebe workflow job. And when it fails, I want to restart all job. I found, that it can be done with NewFailJobCommand, but it seems that the job fails on the first try. How I can restart the job if it fails?

err := w.workflowStore.InitScanEventsTTL(ctx, scanID, job.Msg.Tenant)
    if err != nil {
        return w.client.NewFailJobCommand().JobKey(job.Key).Retries(job.Retries - 
            1).ErrorMessage(reason).Send(ctx)
    }
1

There are 1 best solutions below

0
On

You need to specify the retry count in the task properties in the process model.