Why is my backend workflow running 4 times on each item?

I’m recursively renaming files that have been uploaded using the MultiFile Uploader and running a backend workflow on the list of files to rename them. Can someone look at my workflow and tell me why it renames each file 4 times?

The end result looks like this:

Hi @iamjoshgreen, how are you?

Just by the looks of it, it might be because of the count. Do you know what number is being passed for the index and the count when tirggered?

The count seems correct, there are 5 images uploaded and the value it shows is (5)

When sending the index make sure to set it to 1 … hardcoded

Yeah I would double check what @cmarchan said just to make sure.

1 Like

Ya, I do that as well. It’s hardcoded.

Interesting. Oh I think I see what is happening, you are passing the list each time and it is the full list.

Try having it set up that it it minuses the list first item and each time it iterates and then it is creating an imagine from the new lists first item.

I hope that makes sense

1 Like

I am not busy atm, I am happy to jump in your app and have a look for you

Call the endpoint by using the action “Schedule api worlkflow” :slight_smile:

You are using the action “Schedule api workflow on a list” which as @pattokane says it is invoking the use of the endpoint 5 times … and inside it by invoking it through each loop …, goes through the list of 5 … 5 times …

The approach to remove the first item of the list during each loop works better also. The brake would be to end it when the first item of the looped list is empty.

2 Likes

@cmarchan That was it! THANKS! Now I get the list option better.

2 Likes

Nice. Yeah, I have made this mistake in the past a few times LOL