-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #26: Loop control in workflows
- Loading branch information
1 parent
6403cfd
commit 49cd890
Showing
13 changed files
with
693 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Foreach step provider | ||
|
||
This provider allows you to loop over a list of inputs and execute (potentially parallel) workflows for each item. The subworkflows must only have one possible output named "success" and this output will be collected into a list as a result. | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
your_step: | ||
kind: foreach | ||
workflow: some_workflow_file.yaml # This must be in the workflow directory | ||
items: !expr $.input.some_list_of_items | ||
parallelism: 5 # How many workflows to run in parallel | ||
output: | ||
result: !expr $.steps.your_step.outputs.success.data # This will be a list of result objects | ||
``` | ||
### Handling errors | ||
In case one or more subworkflows exit with an error, you can also recover. | ||
```yaml | ||
output: | ||
result: !expr $.steps.your_step.failed.error.data # This will be a map of int keys to provide the subworkflows with a successful execution. | ||
errors: !expr $.steps.your_step.failed.error.messages # This will be a map of int to error messages for the subworkflows that failed. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package foreach provides the ability to loop over items. | ||
package foreach |
Oops, something went wrong.