[✅ Solution] Call other Automation with parameters?

I have a task, where the first automation pulls some data from an api and stores it in an array. Then for each result in the array, it will call the second automation that should handle the task: upsert - search and update, or create a new record for each of the array entries.

This would make the run time predictable and will not run into script limits: 1 starter run + x single runs compared to 1 complete run, that may run into script timing limits depending on the amount of data.

I already managed to call the other automation (turning “Call automation on collected” into a script) via the script block (the current record). Can I also hand over data directly to this automation to be worked on?

If thats not possible:

Alternative 1)
The better way would still be to have it all in one automation, but somehow call it recursively. As long as there is more results in the array, it should restart the flow for the next batch until all results have been worked on. Somehow I need to preserve the data, so the next run starts at the next page of api results. If we can’t send parameters with the recursive call of an automation, I would need to store it in the current record. Will this be sure, the result is written, before the recursive call reads it from the record? Or will I run into racing conditions?

Alternative 2)
Another way would be to send webhooks from the first to the to the other automation with payload. But although this probably works it really sounds like a real dirty workaround.

1 Like

OK… I never found / used this before, but it seems to be the solution:

image

2 Likes

To make it complete:

Make sure to use “Calculation” for an array, not “Set Value” - as otherwise the array doesn’t make it through to the other Workflow.

3 Likes