I'm trying to wrap my head around how the Creator workflow actions handle order. Is it expected behavior that the downstream actions do not have access to the upstream actions' input changes? And do downstream actions only start after the completion of upstream actions?
I set up a test with 5 workflow actions following each other. They each add their corresponding workflow number into a string field to test order and upstream action dependency. In workflow 2 and 4 I also added an API call to an external service and looped over 250 results and manipulated some data to add some lag. Below are actions 1-3, but 4 and 5 are the same as 2 and 3.
Action 1:
- info "Action 1";
- input.actions = "1";
Action 2:
- response = invokeurl
- [
- url :"https://restcountries.com/v3.1/all"
- type :GET
- ];
- countries = 0;
- countries_with_a = 0;
- for each country in response
- {
- name = country.get("name").get("common").replaceAllIgnoreCase("a","");
- if(name != country.get("name").get("common"))
- {
- countries_with_a = countries_with_a + 1;
- }
- countries = countries + 1;
- }
- info "Action 2. Countries: " + countries + ". Countries with 'a': " + countries_with_a;
- info "Previous attempt number was " + input.actions ;
- input.actions = input.actions + "2";
Action 3:
- info "Action 3";
- info "Previous attempt number was " + input.actions ;
- input.actions = input.actions + "3";
The results were not as I expected. The order of actions was preserved in the info logs. When I closed out the info windows, the first was "Action 5", then "Action 4", then "Action 3", then "Action 2", then "Action 1". However, the previous number was always an empty string, and the "actions" field only showed "5" instead of "12345". So while the order of actions seems to be preserved, each action only has access to the initial field value when the workflow was triggered (empty in this case). This whole workflow still executed under a second even with the api call and data manipulation (wish there was a sleep function to use in this test), so I can't be sure that downstream actions are triggered after the completion of upstream actions.
All this to say, It'd be great to be able to break out some of my deluge code across multiple actions that depend on upstream actions for readability and to utilize the action conditions. But it doesn't look like downstream actions can depend on upstream actions based on this test.