API workflow on a list - run some actions only on first pass

When running an API workflow on a list, what’s the simplest way to run some of the actions only on the first pass of the workflow? Do you have to set a counter somewhere or is there a simpler way?

Thanks!

Hi @philnauta - I’ve used the “List of Numbers” from the “Toolbox” plugin and am able to use the Count in the API workflow as a criteria, ie “Only when Count is 1”. This wasn’t the primary reason why I used the List of Numbers but was an added bonus I got from using it.

Aside from using the Toolbox plugin, you could setup a counter and pass that to the endpoint. When the counter is 1, then execute the step. You’d need to reset the counter at the end of the List you’re working on.

I don’t believe you can pass State values to the API workflow so that’s not an option.

Not sure if you can pass Index # of the List down to the API workflow (I don’t think you can but not sure)

One way might be to pass a number parameter and increment it by one each time the workflow runs, then set a condition on some steps to only run when that parameter is set to 1.

Thanks to you both. I ended up just running the one-time actions in one workflow and then the list actions in a second workflow, but I may circle back to trying a counter someday and if so, I’ll post the solution here.