Retries using with-items runs a retry even on objects that succeeded as well
We use the with-items to loop over and run an action. If it fails for even one of them, it retries over all the items in the array again, instead of just retrying the failed ones.
For instance, if param1 was set to 1,2,3,4 in the below sample workflow:
version: 1.0
description: Test retry workflow
input:
- param1
- slack_channel
tasks:
split_list:
action: core.noop
next:
- when: <% succeeded() %>
do: print_val
publish:
- list_vals: <% ctx(param1).split(',') %>
print_val:
with: <% ctx(list_vals) %>
action: core.local
input :
cmd : >
val=<% item() %>;
if [ $val -eq 2 ];then exit -1;fi
retry:
when: <% failed() %>
count: 5
delay: 2
next:
- when: <% succeeded() %>
publish:
- status: "SUCCESS"
- when: <% failed() %>
do:
- send_failed_alert
publish:
- status: "FAILED"
send_failed_alert:
action: slack.chat.postMessage
input:
channel: "#<% ctx(slack_channel) %>"
text: "ERROR: failed on param <% ctx(param1) %> failed"`
And here is the output of the run.

In current implementation, the retry is scoped to the task so it retry the task and not the items in the case of with items. We can add an option in the retry spec to retry only failed items.
The following is one possible solution for the retry spec to support per-item retry.
retry:
items:
when: <% some condition on the action execution for the item %>
count: 3
delay: 1
The following is one possible solution for the retry spec to support per-item retry.
retry: items: when: <% some condition on the action execution for the item %> count: 3 delay: 1
Your proposed solution per-item retry does not work.
@kyildiz It was a proposal and not supported yet.
you can wrap your action in a workflow and put the retry logic in the subworkflow for now as a workaround.