How to get failed task id?

How to get the id of the current failed task in a certain process instance?

Hello,

I am not sure what would "current" failed task mean, but if you are still within a process instance with a failed task, you can list all its flow nodes and find the one (or several) that is failed.

Otherwise, you have two "general" approaches.

You can list all process instances with at least one failed task and from there get the list of all there tasks and find the failed one - using searchFailedProcessInstances method.

Or you can use the searchFlowNodeInstances method and search for tasks with FAILED_STATE

Hope this helps