Retry Tasks

Infinitic is still in active development. Subscribe here to follow its progress.

It is possible to retry one or more tasks from running workflows. Those tasks can be targeted by id, by status or by class.

// stub targeting a running HelloWorld workflow with a specific id
HelloWorld helloworld = client.getWorkflowById(HelloWorld.class, "05694902-5aa4-469f-824c-7015b0df906c);

// retry a specific task from this instance
client.retryTasks(helloworld, "f2ebeb38-5329-4348-90d4-615b4a5c2214");

// retry all failed tasks
client.retryTasks(helloworld, DeferredStatus.FAILED);

// retry all failed HelloWorldService tasks
client.retryTasks(helloworld, DeferredStatus.FAILED, HelloWorldService.class);

// stub targeting a running HelloWorld workflow with a specific id
val helloworld: HelloWorld = client.getWorkflowById(HelloWorld::class.java, "05694902-5aa4-469f-824c-7015b0df906c")

// retry a specific task from this instance
client.retryTasks(helloworld, "f2ebeb38-5329-4348-90d4-615b4a5c2214")

// retry all failed tasks of this instance
client.retryTasks(helloworld, DeferredStatus.FAILED)

// retry all failed HelloWorldService tasks of this instance
client.retryTasks(helloworld, DeferredStatus.FAILED, HelloWorldService::class.java)

We can also retry tasks on running workflows targeted by tag.

The retryTasks method returns when the adhoc message is sent to Pulsar. We can use the retryTasksAsync method if we want to send the adhoc message asynchronously.

Tasks are considered failed when all automatic retries have failed.

Edit this page on GitHub Updated at Sun, May 22, 2022