Know when an API workflow on a list finishes

Here is a tersely described part of a workflow:

Get back an array/list of URLs from a custom plugin.

Schedule an API workflow on a list to process the list.

That all works.

I then want to send ONE email when the API workflow on a list completes.

I’m not seeing how I can know when the API workflow on a list completes.

Does anyone know?

Kevin

1 Like

Instead of scheduling on a list, you can schedule it on just the first item on your list while also passing the full list to a new parameter on that API workflow, and then having the API workflow call itself for item 2 on the list, then item 3, etc. until item n (which is the # of items on the list). On the calling-itself step, add a condition that the “next item” (another variable in the self-scheduling call that you set to = n+1) must be <=n. Finally, add one more step to your API workflow, with condition only when next item > n, to send the email you want.

I’m replying quickly just because I happened to catch this question, but I won’t be able to help you further due to time. Play around and you should be able to get it working. Good luck!

1 Like

That makes sense. I’ll give it a shot.

The use of a recursive workflow did not work. When I triggered “Schedule API workflow” but not “Schedule API workflow on a list”, every URL that was put into the DB was the same URL.

However, my partner gave me a blinding flash of the obvious when he said to initialize and use a counter to keep track of how many URLs from the list are imported, and when the number of imported URLs equals the number of rows in the list (which we already know), THEN send the email.

This is working.

I do thank you for your suggestion. It was worth checking out.

1 Like

Just another suggestion:

This is what I have done. For each item you put through the backend just add another field that says “status = completed”, or something like that. Then after each pass, at the end, you can do a search for your whole list with a parameter set as “status = complete” then do a count of all the items. If the count = 0 then send yourself an email saying the workflow is complete.

Want to learn more?

www.nocodeminute.com

Presenting

I hope that makes sense. :blush:

2 Likes

That does make sense. Thank you.

1 Like

Cool. Hope that helps. :slight_smile: Let me know later if it works.

This topic was automatically closed after 70 days. New replies are no longer allowed.