diff --git a/.gherkin-lintrc b/.gherkin-lintrc new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/.gherkin-lintrc @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.github/labeler.yml b/.github/labeler.yml index 831cb403..7b749fa8 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -11,6 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +--- workflow: - - ./* \ No newline at end of file + - ./* diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 981b1911..45cdd746 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,13 +18,12 @@ # To use this workflow, you will need to set up a .github/labeler.yml # file with configuration. For more information, see: # https://github.com/actions/labeler/blob/master/README.md - +--- name: Labeler -on: [pull_request] +on: [pull_request] # yamllint disable-line rule:truthy jobs: label: - runs-on: ubuntu-latest steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..526b4ad3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,70 @@ +# Copyright 2020 The Serverless Workflow Specification Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This workflow will run a set of linters on all files in the repository +# to ensure consistent formatting and style. It uses the super-linter +# action, which is a combination of many linters and formatters. +# +# For more information, see: +# https://github.com/super-linter/super-linter/blob/main/README.md +--- +name: Lint +on: # yamllint disable-line rule:truthy + push: + branches: ["main"] + paths: + - "**/*.md" + - "**/*.yaml" + pull_request: + branches: ["main"] + paths: + - "**/*.md" + - "**/*.yaml" + +jobs: + lint: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + - uses: super-linter/super-linter@v6.5.1 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # relative to $DEFAULT_WORKSPACE=$GITHUB_WORKSPACE + LINTER_RULES_PATH: "." + + # check all files (including unmodified) in the repository + VALIDATE_ALL_CODEBASE: true + + VALIDATE_MARKDOWN: true + MARKDOWN_CONFIG_FILE: .markdownlint.yaml + + VALIDATE_YAML: true + YAML_CONFIG_FILE: .yamllint.yaml + + VALIDATE_GHERKIN: true + VALIDATE_GITHUB_ACTIONS: true + VALIDATE_JSON: true diff --git a/.github/workflows/schema-check.yaml b/.github/workflows/schema-check.yaml index 6505b290..6bc2d4eb 100644 --- a/.github/workflows/schema-check.yaml +++ b/.github/workflows/schema-check.yaml @@ -18,20 +18,20 @@ # To use this workflow, you will need to set up a .github/labeler.yml # file with configuration. For more information, see: # https://github.com/actions/labeler/blob/master/README.md - +--- name: Verify Specification Examples -on: +on: # yamllint disable-line rule:truthy push: - branches: [ "main" ] + branches: ["main"] paths: - - 'schema/**' - - 'examples/**' + - "schema/**" + - "examples/**" pull_request: - branches: [ "main" ] + branches: ["main"] paths: - - 'schema/**' - - 'examples/**' + - "schema/**" + - "examples/**" jobs: build: @@ -44,12 +44,12 @@ jobs: node-version: [21.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - cache-dependency-path: .ci/validation/package-lock.json - - run: npm install - - run: npm test + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + cache-dependency-path: .ci/validation/package-lock.json + - run: npm install + - run: npm test diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2337a4af..694c6a7a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,27 +11,40 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +--- name: Mark stale issues and pull requests -on: +on: # yamllint disable-line rule:truthy schedule: - cron: "0 0 * * *" jobs: stale: - runs-on: ubuntu-latest steps: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' - stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.' - stale-issue-label: 'Stale Issue' - exempt-issue-labels: 'Status: Blocked, Status: In progress, Status: On hold, Status: Awaiting response' - stale-pr-label: 'Stale PR' - exempt-pr-labels: 'Status: Blocked, Status: In progress, Status: On hold, Status: Awaiting response' + stale-issue-message: > + This issue has been automatically marked as stale because it has + not had recent activity. It will be closed if no further activity + occurs. Thank you for your contributions. + stale-pr-message: > + This pull request has been automatically marked as stale because it + has not had recent activity. It will be closed if no further + activity occurs. Thank you for your contributions. + stale-issue-label: "Stale Issue" + exempt-issue-labels: > + Status: Blocked, + Status: In progress, + Status: On hold, + Status: Awaiting response + stale-pr-label: "Stale PR" + exempt-pr-labels: > + Status: Blocked, + Status: In progress, + Status: On hold, + Status: Awaiting response days-before-stale: 45 days-before-close: 20 diff --git a/.markdownlint.yaml b/.markdownlint.yaml index ee4a52fc..f6aa43a8 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -11,13 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +--- { "default": true, - "MD024": { "allow_different_nesting": true }, + "MD024": { "siblings_only": true }, "MD029": { "style": "ordered" }, - "ul-style": false, # MD004 - "line-length": false, # MD013 - "no-inline-html": false, # MD033 - "fenced-code-language": false # MD040 + "ul-style": false, # MD004 + "line-length": false, # MD013 + "no-inline-html": false, # MD033 + "fenced-code-language": false, # MD040 } diff --git a/.typo-ci.yml b/.typo-ci.yml index 5eddc282..556da6ce 100644 --- a/.typo-ci.yml +++ b/.typo-ci.yml @@ -1,5 +1,4 @@ --- - # What language dictionaries should it use? Currently Typo CI supports: # de # en @@ -22,7 +21,7 @@ excluded_files: - ".typo-ci.yml" - ".markdownlint.yaml" - "Makefile" - + # Any typos we should ignore? excluded_words: - typoci diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..c0d3d8f3 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["davidanson.vscode-markdownlint", "redhat.vscode-yaml"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index d1289e8e..70c5499a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,22 @@ { - "rewrap.wrappingColumn": 80, - "editor.rulers": [80], - "markdownlint.config": { - "MD004": false, - "MD013": false, - "MD024": {"allow_different_nesting": true}, - "MD029": {"style": "ordered"}, - "MD033": false, - "MD040": false, - }, + "rewrap.wrappingColumn": 80, + "editor.rulers": [80], + "yaml.format.singleQuote": false, + "yaml.format.proseWrap": "always", + "yaml.format.bracketSpacing": true, + "yaml.format.enable": true, + "[yaml]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + }, + "[markdown]": { + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" + }, + "markdownlint.config": { + "MD004": false, + "MD013": false, + "MD024": { "siblings_only": true }, + "MD029": { "style": "ordered" }, + "MD033": false, + "MD040": false + } } diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..eb4c37dd --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,9 @@ +--- +extends: default + +rules: + comments: + min-spaces-from-content: 1 + braces: + min-spaces-inside: 1 + max-spaces-inside: 1 diff --git a/MAINTAINERS.md b/MAINTAINERS.md index b444819f..fff9f5da 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,9 +1,10 @@ # Serverless Workflow Org Maintainers -* [Antonio Mendoza Pérez](https://github.com/antmendoza) -* [Charles d'Avernas](https://github.com/cdavernas) -* [Ricardo Zanini](https://github.com/ricardozanini) -* [Tihomir Surdilovic](https://github.com/tsurdilo) +- [Antonio Mendoza Pérez](https://github.com/antmendoza) +- [Charles d'Avernas](https://github.com/cdavernas) +- [Ricardo Zanini](https://github.com/ricardozanini) +- [Tihomir Surdilovic](https://github.com/tsurdilo) # Maintainers Mailing list -[cncf-serverlessws-maintainers](mailto:cncf-serverlessws-maintainers@lists.cncf.io) \ No newline at end of file + +[cncf-serverlessws-maintainers](mailto:cncf-serverlessws-maintainers@lists.cncf.io) diff --git a/code-of-conduct.md b/code-of-conduct.md index 97a8526a..d5320231 100644 --- a/code-of-conduct.md +++ b/code-of-conduct.md @@ -7,5 +7,6 @@ We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/mai If your project isn't prepared to handle reports, remove the project email address and just have reporters send to conduct@cncf.io. --> + Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io) in order to report violations of the Code of Conduct. diff --git a/community/README.md b/community/README.md index 456e19b7..08489275 100644 --- a/community/README.md +++ b/community/README.md @@ -1,7 +1,7 @@ -# Community +# Community Here you can find information about our: - [Contributors](contributors.md): People and companies contributing to the Serverless workflow specification and ecosystem -- [Presentations](https://serverlessworkflow.io/): Community presentations about the project (see the 'Resources' section) \ No newline at end of file +- [Presentations](https://serverlessworkflow.io/): Community presentations about the project (see the 'Resources' section) diff --git a/community/contributors.md b/community/contributors.md index 5fcaf6e4..2ddcc1ea 100644 --- a/community/contributors.md +++ b/community/contributors.md @@ -1,85 +1,102 @@ # Community Contributors -This list acknowledges community contributors to the Serverless Workflow -project. +This list acknowledges community contributors to the Serverless Workflow +project. -We welcome everyone to join our community and contribute. +We welcome everyone to join our community and contribute. For more information on how, please reference the ['how to contribute'](../contributing.md) doc. -We try to add every contributor here, but if for some reason we missed -adding your name, feel free to add it via pull request to this document or let +We try to add every contributor here, but if for some reason we missed +adding your name, feel free to add it via pull request to this document or let us know in chat or team meeting. -* **Independent** - * Louis Fourie - * Achilleas Tzenetopoulos - * Richard Gibson - * Lucas Stocksmeier - -* **Accenture** - * Mona Borham +- **Independent** + - Louis Fourie + - Achilleas Tzenetopoulos + - Richard Gibson + - Lucas Stocksmeier +- **Accenture** -* **Camunda** - * Mauricio Salatino - * Falko Menge + - Mona Borham -* **Chargebee** - * Manickavasagam Sundaram +- **Camunda** -* **Fujitsu** - * Naohiro Tamura + - Mauricio Salatino + - Falko Menge -* **Google** - * Evan Anderson - * Rachael Myers +- **Chargebee** -* **Huawei** - * Cathy Hong Zhang - * Farhad Sunavala + - Manickavasagam Sundaram -* **IBM** - * Doug Davis +- **Fujitsu** -* **Microsoft** - * Josh Lane - * Chris Gillum + - Naohiro Tamura -* **Neuroglia** - * Charles d'Avernas - * Jean-Baptiste Bianchi +- **Google** -* **Nokia** - * Manuel Stein - * Istemi Ekin Akkus + - Evan Anderson + - Rachael Myers -* **OpenEnterprise** - * Maciek Swiderski +- **Huawei** -* **Oracle** - * Varun Madan + - Cathy Hong Zhang + - Farhad Sunavala -* **Oracle Cloud Infrastructure** - * Kay Singh - * Jorgen Johnson +- **IBM** -* **Red Hat** - * Ruben Romero Montes - * Ricardo Zanini - * Lucas Caparelli - * Paul Morie + - Doug Davis -* **SecureDocs, Inc** - * Stephen Crosby +- **Microsoft** -* **Serverless** - * Brian Neisler + - Josh Lane + - Chris Gillum -* **Sophos** - * Matt Nicholls +- **Neuroglia** -* **Temporal Technologies** - * Antonio Mendoza Pérez - * Tihomir Surdilovic + - Charles d'Avernas + - Jean-Baptiste Bianchi -* **WSO2** - * Chathura Ekanayake \ No newline at end of file +- **Nokia** + + - Manuel Stein + - Istemi Ekin Akkus + +- **OpenEnterprise** + + - Maciek Swiderski + +- **Oracle** + + - Varun Madan + +- **Oracle Cloud Infrastructure** + + - Kay Singh + - Jorgen Johnson + +- **Red Hat** + + - Ruben Romero Montes + - Ricardo Zanini + - Lucas Caparelli + - Paul Morie + +- **SecureDocs, Inc** + + - Stephen Crosby + +- **Serverless** + + - Brian Neisler + +- **Sophos** + + - Matt Nicholls + +- **Temporal Technologies** + + - Antonio Mendoza Pérez + - Tihomir Surdilovic + +- **WSO2** + - Chathura Ekanayake diff --git a/contributing.md b/contributing.md index 55347397..4ad37a13 100644 --- a/contributing.md +++ b/contributing.md @@ -57,26 +57,26 @@ first comment in the issue to include `Assigned to: @person` ## Versioning -The versioning strategy for the Serverless Workflow DSL is structured to accommodate different types of changes introduced through pull requests (PRs). +The versioning strategy for the Serverless Workflow DSL is structured to accommodate different types of changes introduced through pull requests (PRs). -If a PR is labeled with `change: documentation`, indicating modifications related to improving or clarifying documentation, it does not trigger a version change. +If a PR is labeled with `change: documentation`, indicating modifications related to improving or clarifying documentation, it does not trigger a version change. -Conversely, if the PR addresses a fix, labeled as `change: fix`, it results in an increase in the patch version (0.0.x). -A fix typically refers to corrections made to resolve bugs or errors in the DSL specification or its implementations, ensuring smoother functionality and reliability. +Conversely, if the PR addresses a fix, labeled as `change: fix`, it results in an increase in the patch version (0.0.x). +A fix typically refers to corrections made to resolve bugs or errors in the DSL specification or its implementations, ensuring smoother functionality and reliability. -Similarly, when a PR introduces a new feature, labeled as `change: feature`, it prompts an increase in the minor version (0.x.0). -A feature denotes the addition of significant capabilities, enhancements, or functionalities that extend the DSL's capabilities or improve its usability. +Similarly, when a PR introduces a new feature, labeled as `change: feature`, it prompts an increase in the minor version (0.x.0). +A feature denotes the addition of significant capabilities, enhancements, or functionalities that extend the DSL's capabilities or improve its usability. -Lastly, if the PR is marked as `change: breaking`, indicating alterations that are incompatible with previous versions, it leads to an increase in the major version (x.0.0). A breaking change signifies modifications that necessitate adjustments in existing workflows or implementations, potentially impacting backward compatibility. +Lastly, if the PR is marked as `change: breaking`, indicating alterations that are incompatible with previous versions, it leads to an increase in the major version (x.0.0). A breaking change signifies modifications that necessitate adjustments in existing workflows or implementations, potentially impacting backward compatibility. This versioning strategy ensures clarity and transparency in tracking changes and communicating their impact on users and implementations. -| Label | Version Change | Description | -|:-- |:---:|:---| -| `change: documentation` | - | Modifications related to documentation improvements or clarifications. | -| `change: fix` | `0.0.x` | Corrections made to resolve bugs or errors in the DSL specification or its implementations. | -| `change: feature` | `0.x.0` | Addition of significant capabilities, enhancements, or functionalities that extend the DSL's capabilities or improve its usability. | -| `change: breaking` | `x.0.0` | Alterations that are incompatible with previous versions, necessitating adjustments in existing workflows or implementations. | +| Label | Version Change | Description | +| :---------------------- | :------------: | :---------------------------------------------------------------------------------------------------------------------------------- | +| `change: documentation` | - | Modifications related to documentation improvements or clarifications. | +| `change: fix` | `0.0.x` | Corrections made to resolve bugs or errors in the DSL specification or its implementations. | +| `change: feature` | `0.x.0` | Addition of significant capabilities, enhancements, or functionalities that extend the DSL's capabilities or improve its usability. | +| `change: breaking` | `x.0.0` | Alterations that are incompatible with previous versions, necessitating adjustments in existing workflows or implementations. | In addition to versioning changes denoted by labels in pull requests, pre-release versions will be suffixed with either `alphaX`, `betaX`, or `rcX` where `X` represents the pre-release version number (ex: `1.0.0-alpha1`). These pre-release versions are designated to indicate different stages of development and testing before the final release. @@ -103,8 +103,7 @@ Documents in this repository will adhere to the following rules: Markdown files should be appropriately formatted before a pull request is sent out. In this repository, we follow the [markdownlint rules](https://github.com/DavidAnson/markdownlint#rules--aliases) -with some customizations. See [markdownlint](.markdownlint.yaml) or -[settings](.vscode/settings.json) for details. +with some customizations. See [markdownlint](.markdownlint.yaml) for details. We highly encourage using line breaks in markdown files at `80` characters wide. Some tools can do it for you effectively. Please submit the proposal @@ -115,18 +114,59 @@ If you are using Visual Studio Code, you can also use the `fixAll` command of the [vscode markdownlint extension](https://github.com/DavidAnson/vscode-markdownlint). -To otherwise check for style violations, use: +To otherwise check for style violations, use one of the following commands: ```bash -# Ruby and gem are required for mdl -gem install mdl -mdl -c .mdlrc . +npm install -g markdownlint-cli +markdownlint **/*.md +``` + +```bash +brew install markdownlint-cli +markdownlint **/*.md ``` To fix style violations, follow the [instruction](https://github.com/DavidAnson/markdownlint#optionsresultversion) with the Node version of markdownlint. +### YAML style + +YAML files should be appropriately formatted before a pull request is sent out. +In this repository, we follow the +[yamllint rules](https://github.com/adrienverge/yamllint/blob/master/docs/rules.rst). +See [yamllint](.yamllint.yaml) for details. + +We highly encourage using line breaks in markdown files at `80` characters +wide. Some tools can do it for you effectively. Please submit the proposal +to include your editor settings required to enable this behavior so the +out-of-the-box settings for this repository will be consistent. + +If you are using Visual Studio Code, +you can also use the formatter of the +[vscode YAML Language Support extension](https://github.com/redhat-developer/vscode-yaml). + +To install yamllint follow the [instructions outlined here](https://github.com/adrienverge/yamllint/blob/master/docs/quickstart.rst#installing-yamllint). + +### Gherkin style + +Gherkin files should be appropriately formatted before a pull request is sent out. +In this repository, we follow the +[gherkin-lint rules](https://github.com/gherkin-lint/gherkin-lint?tab=readme-ov-file#available-rules). +See [gherkin-lint](.gherkin-lintrc) for details. + +We highly encourage using line breaks in markdown files at `80` characters +wide. Some tools can do it for you effectively. Please submit the proposal +to include your editor settings required to enable this behavior so the +out-of-the-box settings for this repository will be consistent. + +To install gherkin-lint run: + +```bash +npm install -g gherkin-lint +gherkin-lint **/*.feature +``` + ### Typos In addition, please make sure to clean up typos before you submit the change. diff --git a/ctk/README.md b/ctk/README.md index a1db9817..1ae0e017 100644 --- a/ctk/README.md +++ b/ctk/README.md @@ -4,30 +4,30 @@ - [Introduction](#introduction) - [Using the CTK](#using-the-ctk) - + [Conformance testing](#conformance-testing) - + [Behavior Driven Development](#behavior-driven-development-bdd) + - [Conformance testing](#conformance-testing) + - [Behavior Driven Development](#behavior-driven-development-bdd) - [Writing Features and Scenarios](#writing-features-and-scenarios) - + [Feature File Structure](#feature-file-structure) - + [Steps](#steps) - - [Arrange](#arrange) - + [Define workflow](#define-workflow) - + [Set workflow input](#set-workflow-input) - - [Act](#act) - + [Execute Workflow](#execute-workflow) - - [Assert](#assert) - - [Workflow has been cancelled](#workflow-has-been-cancelled) - - [Workflow ran to completion](#workflow-ran-to-completion) - - [Workflow has faulted](#workflow-has-faulted) - - [Workflow output should have properties](#workflow-output-should-have-properties) - - [Workflow output should have property with value](#workflow-output-should-have-property-with-value) - - [Workflow output should have property with item count](#workflow-output-should-have-property-with-item-count) - - [Task ran first](#task-ran-first) - - [Task ran last](#task-ran-last) - - [Task ran before](#task-ran-before) - - [Task ran after](#task-ran-after) - - [Task has been cancelled](#task-has-been-cancelled) - - [Task ran to completion](#task-ran-to-completion) - - [Task has faulted](#task-has-faulted) + - [Feature File Structure](#feature-file-structure) + - [Steps](#steps) + - [Arrange](#arrange) + - [Define workflow](#define-workflow) + - [Set workflow input](#set-workflow-input) + - [Act](#act) + - [Execute Workflow](#execute-workflow) + - [Assert](#assert) + - [Workflow has been cancelled](#workflow-has-been-cancelled) + - [Workflow ran to completion](#workflow-ran-to-completion) + - [Workflow has faulted](#workflow-has-faulted) + - [Workflow output should have properties](#workflow-output-should-have-properties) + - [Workflow output should have property with value](#workflow-output-should-have-property-with-value) + - [Workflow output should have property with item count](#workflow-output-should-have-property-with-item-count) + - [Task ran first](#task-ran-first) + - [Task ran last](#task-ran-last) + - [Task ran before](#task-ran-before) + - [Task ran after](#task-ran-after) + - [Task has been cancelled](#task-has-been-cancelled) + - [Task ran to completion](#task-ran-to-completion) + - [Task has faulted](#task-has-faulted) ## Introduction @@ -44,15 +44,18 @@ The Serverless Workflow CTK serves two primary purposes: conformance testing and Conformance testing is the process of verifying that an implementation adheres to a given specification. By running the CTK, developers can ensure that their implementations of the Serverless Workflow DSL behave as expected and meet the defined standards. This is crucial for maintaining interoperability and consistency across different implementations of the Serverless Workflow specification. 1. **Clone the Repository**: Start by cloning the Serverless Workflow CTK repository to your local machine. - + ```sh git clone https://github.com/serverlessworkflow/specification.git ``` + 2. **Install Dependencies**: Ensure that you have all the necessary dependencies installed. This typically involves setting up a testing framework that can execute Gherkin tests. -3. **Run the Tests**: Execute the Gherkin features using your preferred test runner. + +3. **Run the Tests**: Execute the Gherkin features using your preferred test runner. + 4. **Review Results**: After running the tests, review the results to ensure that your implementation passes all the scenarios. Any failures indicate deviations from the Serverless Workflow specification. ### Behavior-Driven Development (BDD) @@ -98,17 +101,17 @@ Feature: ### Steps -For clarity, we've categorized the Gherkin steps used in the Serverless Workflow CTK into three main groups: Arrange, Act, and Assert. +For clarity, we've categorized the Gherkin steps used in the Serverless Workflow CTK into three main groups: Arrange, Act, and Assert. -These divisions help clarify the purpose of each step and streamline scenario comprehension. +These divisions help clarify the purpose of each step and streamline scenario comprehension. The Arrange section sets up the initial state or context, the Act section describes the action, and the Assert section verifies the outcome. This structure enhances readability, aiding stakeholders in understanding the scenario flow and step intent. #### Arrange -Sets up the initial conditions for the test scenario. +Sets up the initial conditions for the test scenario. -It includes steps to define the workflow, set the input data for the workflow, and prepare any necessary resources or configurations required for executing the workflow. +It includes steps to define the workflow, set the input data for the workflow, and prepare any necessary resources or configurations required for executing the workflow. The arrange section of the test ensures that the environment is properly configured before the workflow execution begins. @@ -150,9 +153,9 @@ When the workflow is executed #### Assert -Contains assertions that verify the outcome of the workflow execution. +Contains assertions that verify the outcome of the workflow execution. -It includes steps to check various conditions such as whether the workflow was canceled, completed successfully, or encountered any faults or errors during execution. +It includes steps to check various conditions such as whether the workflow was canceled, completed successfully, or encountered any faults or errors during execution. The assert section ensures that the workflow behaves as expected and meets the specified criteria for correctness and reliability. @@ -223,7 +226,6 @@ And the workflow output should have a '' property with value: And the workflow output should have a '' property containing items ``` - ##### Task ran first Asserts that a specific task within the workflow executed first during workflow execution. It ensures the correct sequence of task execution based on the provided workflow definition. @@ -296,4 +298,4 @@ And should fault with error: """yaml """ -``` \ No newline at end of file +``` diff --git a/dsl-reference.md b/dsl-reference.md index 64d3beb7..fb710ff8 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -4,50 +4,50 @@ - [Abstract](#abstract) - [Definitions](#definitions) - + [Workflow](#workflow) + - [Workflow](#workflow) - [Document](#document) - [Use](#use) - [Schedule](#schedule) - + [Task](#task) + - [Task](#task) - [Call](#call) - + [AsyncAPI](#asyncapi-call) - + [gRPC](#grpc-call) - + [HTTP](#http-call) - + [OpenAPI](#openapi-call) + - [AsyncAPI](#asyncapi-call) + - [gRPC](#grpc-call) + - [HTTP](#http-call) + - [OpenAPI](#openapi-call) - [Composite](#composite) - [Emit](#emit) - [For](#for) - [Listen](#listen) - [Raise](#raise) - [Run](#run) - + [Container](#container-process) - + [Shell](#shell-process) - + [Script](#script-process) - + [Workflow](#workflow-process) + - [Container](#container-process) + - [Shell](#shell-process) + - [Script](#script-process) + - [Workflow](#workflow-process) - [Switch](#switch) - [Set](#set) - [Try](#try) - [Wait](#wait) - + [Flow Directive](#flow-directive) - + [External Resource](#external-resource) - + [Authentication](#authentication) + - [Flow Directive](#flow-directive) + - [External Resource](#external-resource) + - [Authentication](#authentication) - [Basic](#basic-authentication) - [Bearer](#bearer-authentication) - [Certificate](#certificate-authentication) - [Digest](#digest-authentication) - [OAUTH2](#oauth2-authentication) - + [Extension](#extension) - + [Error](#error) + - [Extension](#extension) + - [Error](#error) - [Standard Error Types](#standard-error-types) - + [Event Consumption Strategy](#event-consumption-strategy) - + [Event Filter](#event-filter) - + [Retry](#retry) - + [Input](#input) - + [Output](#output) - + [Timeout](#timeout) - + [Duration](#duration) - + [HTTP Response](#http-response) - + [HTTP Request](#http-request) + - [Event Consumption Strategy](#event-consumption-strategy) + - [Event Filter](#event-filter) + - [Retry](#retry) + - [Input](#input) + - [Output](#output) + - [Timeout](#timeout) + - [Duration](#duration) + - [HTTP Response](#http-response) + - [HTTP Request](#http-request) ## Abstract @@ -61,63 +61,63 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t #### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`document`](#document) | `yes` | Documents the defined workflow. | -| input | [`input`](#input) | `no` | Configures the workflow's input. | -| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. | -| do | [`map[string, task]`](#task) | `yes` | The [task(s)](#task) that must be performed by the [workflow](#workflow). | -| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. | -| output | [`output`](#output) | `no` | Configures the workflow's output. | -| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. | -| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. | +| Name | Type | Required | Description | +| :------- | :--------------------------: | :------: | :------------------------------------------------------------------------ | +| document | [`document`](#document) | `yes` | Documents the defined workflow. | +| input | [`input`](#input) | `no` | Configures the workflow's input. | +| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. | +| do | [`map[string, task]`](#task) | `yes` | The [task(s)](#task) that must be performed by the [workflow](#workflow). | +| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. | +| output | [`output`](#output) | `no` | Configures the workflow's output. | +| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. | +| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. | #### Document Documents the workflow definition. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| dsl | `string` | `yes` | The version of the DSL used to define the workflow. | -| namespace | `string` | `yes` | The workflow's namespace.
| -| name | `string` | `yes` | The workflow's name.
| -| version | `string` | `yes` | The workflow's [semantic version] -| title | `string` | `no` | The workflow's title. | -| summary | `string` | `no` | The workflow's Markdown summary. | -| tags | `map[string, string]` | `no` | A key/value mapping of the workflow's tags, if any. | +| Name | Type | Required | Description | +| :-------- | :-------------------: | :------: | :-------------------------------------------------- | +| dsl | `string` | `yes` | The version of the DSL used to define the workflow. | +| namespace | `string` | `yes` | The workflow's namespace.
| +| name | `string` | `yes` | The workflow's name.
| +| version | `string` | `yes` | The workflow's [semantic version] | +| title | `string` | `no` | The workflow's title. | +| summary | `string` | `no` | The workflow's Markdown summary. | +| tags | `map[string, string]` | `no` | A key/value mapping of the workflow's tags, if any. | #### Use Defines the workflow's reusable components. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| authentications | [`map[string, authentication]`](#authentication) | `no` | A name/value mapping of the workflow's reusable authentication policies. | -| errors | [`map[string, error]`](#error) | `no` | A name/value mapping of the workflow's reusable errors. | -| extensions | [`map[string, extension]`](#extension) | `no` | A name/value mapping of the workflow's reusable extensions. | -| functions | [`map[string, task]`](#task) | `no` | A name/value mapping of the workflow's reusable tasks. | -| retries | [`map[string, retryPolicy]`](#retry) | `no` | A name/value mapping of the workflow's reusable retry policies. | -| secrets | `string[]` | `no` | A list containing the workflow's secrets. | +| Name | Type | Required | Description | +| :-------------- | :----------------------------------------------: | :------: | :----------------------------------------------------------------------- | +| authentications | [`map[string, authentication]`](#authentication) | `no` | A name/value mapping of the workflow's reusable authentication policies. | +| errors | [`map[string, error]`](#error) | `no` | A name/value mapping of the workflow's reusable errors. | +| extensions | [`map[string, extension]`](#extension) | `no` | A name/value mapping of the workflow's reusable extensions. | +| functions | [`map[string, task]`](#task) | `no` | A name/value mapping of the workflow's reusable tasks. | +| retries | [`map[string, retryPolicy]`](#retry) | `no` | A name/value mapping of the workflow's reusable retry policies. | +| secrets | `string[]` | `no` | A list containing the workflow's secrets. | #### Schedule Configures the schedule of a workflow. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| every | [`duration`](#duration) | `no` | Specifies the duration of the interval at which the workflow should be executed. Unlike `after`, this option will run the workflow regardless of whether the previous run is still in progress.
*Required when no other property has been set.* | -| cron | `string` | `no` | Specifies the schedule using a CRON expression, e.g., '0 0 * * *' for daily at midnight.
*Required when no other property has been set.* | -| after | [`duration`](#duration) | `no` | Specifies a delay duration that the workflow must wait before starting again after it completes. In other words, when this workflow completes, it should run again after the specified amount of time.
*Required when no other property has been set.* | -| on | [`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Specifies the events that trigger the workflow execution.
*Required when no other property has been set.* | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------------------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| every | [`duration`](#duration) | `no` | Specifies the duration of the interval at which the workflow should be executed. Unlike `after`, this option will run the workflow regardless of whether the previous run is still in progress.
_Required when no other property has been set._ | +| cron | `string` | `no` | Specifies the schedule using a CRON expression, e.g., '0 0 \* \* *' for daily at midnight.
*Required when no other property has been set.\* | +| after | [`duration`](#duration) | `no` | Specifies a delay duration that the workflow must wait before starting again after it completes. In other words, when this workflow completes, it should run again after the specified amount of time.
_Required when no other property has been set._ | +| on | [`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Specifies the events that trigger the workflow execution.
_Required when no other property has been set._ | #### Evaluate Configures a workflow's runtime expression evaluation. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| language | `string` | `yes` | The language used for writting runtime expressions.
*Defaults to `jq`.* | -| mode | `string` | `yes` | The runtime expression evaluation mode.
*Supported values are:*
- `strict`: requires all expressions to be enclosed within `${ }` for proper identification and evaluation.
- `loose`: evaluates any value provided. If the evaluation fails, it results in a string with the expression as its content.
*Defaults to `strict`.* +| Name | Type | Required | Description | +| :------- | :------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| language | `string` | `yes` | The language used for writting runtime expressions.
_Defaults to `jq`._ | +| mode | `string` | `yes` | The runtime expression evaluation mode.
_Supported values are:_
- `strict`: requires all expressions to be enclosed within `${ }` for proper identification and evaluation.
- `loose`: evaluates any value provided. If the evaluation fails, it results in a string with the expression as its content.
_Defaults to `strict`._ | #### Examples @@ -204,11 +204,11 @@ do: ### Task -A task within a [workflow](#workflow) represents a discrete unit of work that contributes to achieving the overall objectives defined by the [workflow](#workflow). +A task within a [workflow](#workflow) represents a discrete unit of work that contributes to achieving the overall objectives defined by the [workflow](#workflow). -It encapsulates a specific action or set of actions that need to be executed in a predefined order to advance the workflow towards its completion. +It encapsulates a specific action or set of actions that need to be executed in a predefined order to advance the workflow towards its completion. -[Tasks](#task) are designed to be modular and focused, each serving a distinct purpose within the broader context of the [workflow](#workflow). +[Tasks](#task) are designed to be modular and focused, each serving a distinct purpose within the broader context of the [workflow](#workflow). By breaking down the [workflow](#workflow) into manageable [tasks](#task), organizations can effectively coordinate and track progress, enabling efficient collaboration and ensuring that work is completed in a structured and organized manner. @@ -220,20 +220,20 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su - [For](#for), used to iterate over a collection of items, and conditionally perform a task for each of them. - [Listen](#listen), used to listen for an [event](#event) or more. - [Raise](#raise), used to raise an [error](#error) and potentially fault the [workflow](#workflow). -- [Run](#run), used to run a [container](#container), a [script](#script) or event a [shell](#shell) command. +- [Run](#run), used to run a [container](#container), a [script](#script) or event a [shell](#shell) command. - [Switch](#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions -- [Set](#set), used to dynamically set or update the [workflow](#workflow)'s data during the its execution. +- [Set](#set), used to dynamically set or update the [workflow](#workflow)'s data during the its execution. - [Try](#try), used to attempt executing a specified [task](#task), and to handle any resulting [errors](#error) gracefully, allowing the [workflow](#workflow) to continue without interruption. - [Wait](#wait), used to pause or wait for a specified duration before proceeding to the next task. #### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. | -| output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. | -| timeout | [`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any. | -| then | [`flowDirective`](#flow-directive) | `no` | The flow directive to execute next.
*If not set, defaults to `continue`.* | +| Name | Type | Required | Description | +| :------ | :--------------------------------: | :------: | :-------------------------------------------------------------------------------- | +| input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. | +| output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. | +| timeout | [`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any. | +| then | [`flowDirective`](#flow-directive) | `no` | The flow directive to execute next.
_If not set, defaults to `continue`._ | #### Call @@ -241,19 +241,19 @@ Enables the execution of a specified function within a workflow, allowing seamle ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| call | `string` | `yes` | The name of the function to call. | -| with | `map` | `no` | A name/value mapping of the parameters to call the function with | +| Name | Type | Required | Description | +| :--- | :------: | :------: | :--------------------------------------------------------------- | +| call | `string` | `yes` | The name of the function to call. | +| with | `map` | `no` | A name/value mapping of the parameters to call the function with | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: getPetById: call: http @@ -275,24 +275,24 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the operation to call. | -| operationRef | `string` | `yes` | A reference to the AsyncAPI operation to call. | -| server | `string` | `no` | A reference to the server to call the specified AsyncAPI operation on.
If not set, default to the first server matching the operation's channel. | -| message | `string` | `no` | The name of the message to use.
If not set, defaults to the first message defined by the operation. | -| binding | `string` | `no` | The name of the binding to use.
If not set, defaults to the first binding defined by the operation | -| payload | `any` | `no` | The operation's payload, as defined by the configured message | -| authentication | `string`
[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. | +| Name | Type | Required | Description | +| :------------- | :---------------------------------------------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the operation to call. | +| operationRef | `string` | `yes` | A reference to the AsyncAPI operation to call. | +| server | `string` | `no` | A reference to the server to call the specified AsyncAPI operation on.
If not set, default to the first server matching the operation's channel. | +| message | `string` | `no` | The name of the message to use.
If not set, defaults to the first message defined by the operation. | +| binding | `string` | `no` | The name of the binding to use.
If not set, defaults to the first binding defined by the operation | +| payload | `any` | `no` | The operation's payload, as defined by the configured message | +| authentication | `string`
[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: greetUser: call: asyncapi @@ -312,24 +312,24 @@ The [gRPC Call](#grpc-call) enables communication with external systems via the ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| proto | [`externalResource`](#external-resource) | `yes` | The proto resource that describes the GRPC service to call. | -| service.name | `string` | `yes` | The name of the GRPC service to call. | -| service.host | `string` | `yes` | The hostname of the GRPC service to call. | -| service.port | `integer` | `no` | The port number of the GRPC service to call. | -| service.authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the GRPC service. | -| method | `string` | `yes` | The name of the GRPC service method to call. | -| arguments | `map` | `no` | A name/value mapping of the method call's arguments, if any. | +| Name | Type | Required | Description | +| :--------------------- | :--------------------------------------: | :------: | :--------------------------------------------------------------------------------------------------------- | +| proto | [`externalResource`](#external-resource) | `yes` | The proto resource that describes the GRPC service to call. | +| service.name | `string` | `yes` | The name of the GRPC service to call. | +| service.host | `string` | `yes` | The hostname of the GRPC service to call. | +| service.port | `integer` | `no` | The port number of the GRPC service to call. | +| service.authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the GRPC service. | +| method | `string` | `yes` | The name of the GRPC service method to call. | +| arguments | `map` | `no` | A name/value mapping of the method call's arguments, if any. | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: greetUser: call: grpc @@ -350,22 +350,22 @@ The [HTTP Call](#http-call) enables workflows to interact with external services ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| method | `string` | `yes` | The HTTP request method. | -| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. | -| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. | -| body | `any` | `no` | The HTTP request body, if any. | -| output | `string` | `no` | The http call's output format.
*Supported values are:*
*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*
*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*
*- `response`, which outputs the [http response](#http-response).*
*Defaults to `content`.* | +| Name | Type | Required | Description | +| :------- | :---------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| method | `string` | `yes` | The HTTP request method. | +| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. | +| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. | +| body | `any` | `no` | The HTTP request body, if any. | +| output | `string` | `no` | The http call's output format.
_Supported values are:_
_- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any._
_- `content`, which outputs the content of [http response](#http-response), possibly deserialized._
_- `response`, which outputs the [http response](#http-response)._
_Defaults to `content`._ | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: getPetById: call: http @@ -380,22 +380,22 @@ The [OpenAPI Call](#openapi-call) enables workflows to interact with external se ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`externalResource`](#external-resource) | `yes` | The OpenAPI document that defines the operation to call. | -| operationId | `string` | `yes` | The id of the OpenAPI operation to call. | -| arguments | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. | -| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. | -| output | `string` | `no` | The OpenAPI call's output format.
*Supported values are:*
*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*
*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*
*- `response`, which outputs the [http response](#http-response).*
*Defaults to `content`.* | +| Name | Type | Required | Description | +| :------------- | :--------------------------------------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| document | [`externalResource`](#external-resource) | `yes` | The OpenAPI document that defines the operation to call. | +| operationId | `string` | `yes` | The id of the OpenAPI operation to call. | +| arguments | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. | +| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. | +| output | `string` | `no` | The OpenAPI call's output format.
_Supported values are:_
_- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any._
_- `content`, which outputs the content of [http response](#http-response), possibly deserialized._
_- `response`, which outputs the [http response](#http-response)._
_Defaults to `content`._ | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: getPets: call: openapi @@ -408,25 +408,26 @@ do: #### Composite - Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations. By encapsulating and coordinating various subtasks, this task type facilitates the efficient execution of intricate workflows. +Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations. By encapsulating and coordinating various subtasks, this task type facilitates the efficient execution of intricate workflows. ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| execute.sequentially | [`map(string, task)`](#task) | `no` | The tasks to perform sequentially.
*Required if `execute.concurrently` has not been set, otherwise ignored.*
*If set, must contains **at least** two [`tasks`](#task).* | -| execute.concurrently | [`map(string, task)`](#task) | `no` | The tasks to perform concurrently.
*Required if `execute.sequentially` has not been set, otherwise ignored.*
*If set, must contains **at least** two [`tasks`](#task).* | -| execute.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output.
*Ignored if `execute.sequentially` has been set. Defaults to `false`.*
*Must **not** be set if the [`tasks`](#task) are executed sequentially.* | +| Name | Type | Required | Description | +| :------------------- | :--------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| execute.sequentially | [`map(string, task)`](#task) | `no` | The tasks to perform sequentially.
_Required if `execute.concurrently` has not been set, otherwise ignored._
_If set, must contains **at least** two [`tasks`](#task)._ | +| execute.concurrently | [`map(string, task)`](#task) | `no` | The tasks to perform concurrently.
_Required if `execute.sequentially` has not been set, otherwise ignored._
_If set, must contains **at least** two [`tasks`](#task)._ | +| execute.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output.
_Ignored if `execute.sequentially` has been set. Defaults to `false`._
_Must **not** be set if the [`tasks`](#task) are executed sequentially._ | ##### Examples -*Executing tasks sequentially:* +_Executing tasks sequentially:_ + ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: bookTrip: execute: @@ -435,7 +436,7 @@ do: call: http with: method: post - endpoint: + endpoint: uri: https://fake-booking-agency.com/hotels/book authentication: fake-booking-agency-oauth2 body: @@ -446,33 +447,34 @@ do: call: http with: method: post - endpoint: + endpoint: uri: https://fake-booking-agency.com/flights/book authentication: fake-booking-agency-oauth2 body: departure: - date: '01/01/26' - time: '07:25:00' + date: "01/01/26" + time: "07:25:00" from: airport: BRU city: Zaventem country: Belgium arrival: - date: '01/01/26' - time: '11:12:00' + date: "01/01/26" + time: "11:12:00" to: airport: LIS city: Lisbon country: Portugal ``` -*Executing tasks concurrently:* +_Executing tasks concurrently:_ + ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: raiseAlarm: execute: @@ -501,18 +503,18 @@ Allows workflows to publish events to event brokers or messaging systems, facili ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| emit.event | [`event`](#event) | `yes` | Defines the event to emit. | +| Name | Type | Required | Description | +| :--------- | :---------------: | :------: | :------------------------- | +| emit.event | [`event`](#event) | `yes` | Defines the event to emit. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: placeOrder: emit: @@ -525,8 +527,8 @@ do: firstName: Cruella lastName: de Vil items: - - breed: dalmatian - quantity: 101 + - breed: dalmatian + quantity: 101 ``` #### For @@ -535,22 +537,22 @@ Allows workflows to iterate over a collection of items, executing a defined set ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.
Defaults to `item`. | -| for.in | `string` | `yes` | A [runtime expression](#runtime-expressions) used to get the collection to enumerate. | -| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.
Defaults to `index`. | -| while | `string` | `no` | A [runtime expression](#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. | -| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. | +| Name | Type | Required | Description | +| :------- | :-------------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------- | +| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.
Defaults to `item`. | +| for.in | `string` | `yes` | A [runtime expression](#runtime-expressions) used to get the collection to enumerate. | +| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.
Defaults to `index`. | +| while | `string` | `no` | A [runtime expression](#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. | +| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: checkup: for: @@ -567,40 +569,40 @@ do: with: type: com.fake.petclinic.pets.checkup.completed.v2 output: - to: '.pets + [{ "id": $pet.id }]' + to: '.pets + [{ "id": $pet.id }]' ``` #### Listen -Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems. +Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems. ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. | +| Name | Type | Required | Description | +| :-------- | :-------------------------------------------------------: | :------: | :--------------------------------------------------- | +| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: callDoctor: listen: to: any: - - with: - type: com.fake-hospital.vitals.measurements.temperature - data: - temperature: ${ .temperature > 38 } - - with: - type: com.fake-hospital.vitals.measurements.bpm - data: - temperature: ${ .bpm < 60 or .bpm > 100 } + - with: + type: com.fake-hospital.vitals.measurements.temperature + data: + temperature: ${ .temperature > 38 } + - with: + type: com.fake-hospital.vitals.measurements.bpm + data: + temperature: ${ .bpm < 60 or .bpm > 100 } ``` #### Raise @@ -609,18 +611,18 @@ Intentionally triggers and propagates errors. By employing the "Raise" task, wor ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| raise.error | [`error`](#error) | `yes` | Defines the error to raise. | +| Name | Type | Required | Description | +| :---------- | :---------------: | :------: | :-------------------------- | +| raise.error | [`error`](#error) | `yes` | Defines the error to raise. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: processTicket: switch: @@ -641,9 +643,9 @@ do: type: https://fake.com/errors/tickets/undefined-priority status: 400 title: Undefined Priority - escalateToManager: {...} - assignToSpecialist: {...} - resolveTicket: {...} + escalateToManager: { ... } + assignToSpecialist: { ... } + resolveTicket: { ... } ``` #### Run @@ -652,23 +654,22 @@ Provides the capability to execute external [containers](#container-process), [s ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| run.container | [`container`](#container-process) | `no` | The definition of the container to run.
*Required if `script`, `shell` and `workflow` have not been set.* | -| run.script | [`script`](#script-process) | `no` | The definition of the script to run.
*Required if `container`, `shell` and `workflow` have not been set.* | -| run.shell | [`shell`](#shell-process) | `no` | The definition of the shell command to run.
*Required if `container`, `script` and `workflow` have not been set.* | -| run.workflow | [`workflow`](#workflow-process) | `no` | The definition of the workflow to run.
*Required if `container`, `script` and `shell` have not been set.* | +| Name | Type | Required | Description | +| :------------ | :-------------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------- | +| run.container | [`container`](#container-process) | `no` | The definition of the container to run.
_Required if `script`, `shell` and `workflow` have not been set._ | +| run.script | [`script`](#script-process) | `no` | The definition of the script to run.
_Required if `container`, `shell` and `workflow` have not been set._ | +| run.shell | [`shell`](#shell-process) | `no` | The definition of the shell command to run.
_Required if `container`, `script` and `workflow` have not been set._ | +| run.workflow | [`workflow`](#workflow-process) | `no` | The definition of the workflow to run.
_Required if `container`, `script` and `shell` have not been set._ | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: - runContainer: run: container: @@ -699,22 +700,22 @@ Enables the execution of external processes encapsulated within a containerized ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| image | `string` | `yes` | The name of the container image to run | -| command | `string` | `no` | The command, if any, to execute on the container | -| ports | `map` | `no` | The container's port mappings, if any | -| volumes | `map` | `no` | The container's volume mappings, if any | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------: | :------: | :--------------------------------------------------------------------------------------------------- | +| image | `string` | `yes` | The name of the container image to run | +| command | `string` | `no` | The command, if any, to execute on the container | +| ports | `map` | `no` | The container's port mappings, if any | +| volumes | `map` | `no` | The container's volume mappings, if any | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: runContainer: run: @@ -728,21 +729,21 @@ Enables the execution of custom scripts or code within a workflow, empowering wo ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| language | `string` | `yes` | The language of the script to run | -| code | `string` | `no` | The script's code.
*Required if `source` has not been set.* | -| source | [externalResource](#external-resource) | `no` | The script's resource.
*Required if `code` has not been set.* | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------------------------------------: | :------: | :--------------------------------------------------------------------------------------------------- | +| language | `string` | `yes` | The language of the script to run | +| code | `string` | `no` | The script's code.
_Required if `source` has not been set._ | +| source | [externalResource](#external-resource) | `no` | The script's resource.
_Required if `code` has not been set._ | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: runScript: run: @@ -758,20 +759,20 @@ Enables the execution of shell commands within a workflow, enabling workflows to ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| command | `string` | `yes` | The shell command to run | -| arguments | `map` | `no` | A list of the arguments of the shell command to run | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------: | :------: | :--------------------------------------------------------------------------------------------------- | +| command | `string` | `yes` | The shell command to run | +| arguments | `map` | `no` | A list of the arguments of the shell command to run | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: runShell: run: @@ -785,20 +786,20 @@ Enables the invocation and execution of nested workflows within a parent workflo ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| name | `string` | `yes` | The name of the workflow to run | -| version | `string` | `yes` | The version of the workflow to run. Defaults to `latest` | -| input | `any` | `no` | The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified | +| Name | Type | Required | Description | +| :------ | :------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | `yes` | The name of the workflow to run | +| version | `string` | `yes` | The version of the workflow to run. Defaults to `latest` | +| input | `any` | `no` | The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: runShell: run: @@ -814,9 +815,9 @@ A task used to set data. ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| set | `object` | `yes` | A name/value mapping of the data to set. | +| Name | Type | Required | Description | +| :--- | :------: | :------: | :--------------------------------------- | +| set | `object` | `yes` | A name/value mapping of the data to set. | ##### Examples @@ -825,7 +826,7 @@ document: dsl: 1.0.0-alpha1 namespace: default name: set - version: '0.1.0' + version: "0.1.0" do: initialize: set: @@ -840,18 +841,18 @@ Enables conditional branching within workflows, allowing them to dynamically sel ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| switch | [`map[string, case]`](#switch-case) | `yes` | A name/value map of the cases to switch on | +| Name | Type | Required | Description | +| :----- | :---------------------------------: | :------: | :----------------------------------------- | +| switch | [`map[string, case]`](#switch-case) | `yes` | A name/value map of the cases to switch on | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: processOrder: switch: @@ -866,31 +867,31 @@ do: processElectronicOrder: execute: sequentially: - validatePayment: {...} - fulfillOrder: {...} + validatePayment: { ... } + fulfillOrder: { ... } then: exit processPhysicalOrder: execute: sequentially: - checkInventory: {...} - packItems: {...} - scheduleShipping: {...} + checkInventory: { ... } + packItems: { ... } + scheduleShipping: { ... } then: exit handleUnknownOrderType: execute: sequentially: - logWarning: {...} - notifyAdmin: {...} + logWarning: { ... } + notifyAdmin: { ... } ``` ##### Switch Case Defines a switch case, encompassing of a condition for matching and an associated action to execute upon a match. -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| when | `string` | `no` | A runtime expression used to determine whether or not the case matches.
*If not set, the case will be matched by default if no other case match.*
*Note that there can be only one default case, all others **MUST** set a condition.* -| then | [`flowDirective`](#flow-directive) | `yes` | The flow directive to execute when the case matches. | +| Name | Type | Required | Description | +| :--- | :--------------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| when | `string` | `no` | A runtime expression used to determine whether or not the case matches.
_If not set, the case will be matched by default if no other case match._
_Note that there can be only one default case, all others **MUST** set a condition._ | +| then | [`flowDirective`](#flow-directive) | `yes` | The flow directive to execute when the case matches. | #### Try @@ -898,19 +899,19 @@ Serves as a mechanism within workflows to handle errors gracefully, potentially ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| try | [`task`](#task) | `yes` | The task to perform. | -| catch | [`catch`](#catch) | `yes` | Configures the errors to catch and how to handle them. | +| Name | Type | Required | Description | +| :---- | :---------------: | :------: | :----------------------------------------------------- | +| try | [`task`](#task) | `yes` | The task to perform. | +| catch | [`catch`](#catch) | `yes` | Configures the errors to catch and how to handle them. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: processOrder: try: @@ -940,14 +941,14 @@ Defines the configuration of a catch clause, which a concept used to catch error ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch | -| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. | -| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error | -| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | -| retry | [`retryPolicy`](#retry) | `no` | The retry policy to use, if any, when catching errors | -| do | [`task`](#task) | `no` | The definition of the task to run when catching an error | +| Name | Type | Required | Description | +| :--------- | :---------------------: | :------: | :------------------------------------------------------------------------------------- | +| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch | +| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. | +| when | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | +| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | +| retry | [`retryPolicy`](#retry) | `no` | The retry policy to use, if any, when catching errors | +| do | [`task`](#task) | `no` | The definition of the task to run when catching an error | #### Wait @@ -955,18 +956,18 @@ Allows workflows to pause or delay their execution for a specified period of tim ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| wait | `string`
[`duration`](#duration) | `yes` | The amount of time to wait.
If a `string`, must be a valid [ISO 8601](#) duration expression. | +| Name | Type | Required | Description | +| :--- | :---------------------------------: | :------: | :----------------------------------------------------------------------------------------------- | +| wait | `string`
[`duration`](#duration) | `yes` | The amount of time to wait.
If a `string`, must be a valid [ISO 8601](#) duration expression. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: delay10Seconds: wait: @@ -977,11 +978,11 @@ do: Flow Directives are commands within a workflow that dictate its progression. -| Directive | Description | -| --------- | ----------- | +| Directive | Description | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `continue` | Instructs the workflow to proceed with the next task in line. This action may conclude the execution of a particular workflow or branch if there are not task defined after the continue one. | -| `exit` | Halts the current branch's execution, potentially terminating the entire workflow if the current task resides within the main branch. | -| `end` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. | +| `exit` | Halts the current branch's execution, potentially terminating the entire workflow if the current task resides within the main branch. | +| `end` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. | ### External Resource @@ -989,11 +990,11 @@ Defines an external resource. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| name | `string` | `no` | The name, if any, of the defined resource. | -| uri | `string` | `yes` | The URI at which to get the defined resource. | -| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when fecthing the resource. | +| Property | Type | Required | Description | +| -------------- | :---------------------------------: | :------: | ------------------------------------------------------------------------------------------------------- | +| name | `string` | `no` | The name, if any, of the defined resource. | +| uri | `string` | `yes` | The URI at which to get the defined resource. | +| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when fecthing the resource. | ##### Examples @@ -1012,22 +1013,22 @@ Defines the mechanism used to authenticate users and workflows attempting to acc #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| basic | [`basicAuthentication`](#basic-authentication) | `no` | The `basic` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| bearer | [`bearerAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| Property | Type | Required | Description | +| ----------- | :--------------------------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------- | +| basic | [`basicAuthentication`](#basic-authentication) | `no` | The `basic` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| bearer | [`bearerAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: secrets: usernamePasswordSecret: {} @@ -1039,7 +1040,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: sampleBasicFromSecret ``` @@ -1050,19 +1051,19 @@ Defines the fundamentals of a 'basic' authentication. ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| username | `string` | `yes` | The username to use. | -| password | `string` | `yes` | The password to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | -------------------- | +| username | `string` | `yes` | The username to use. | +| password | `string` | `yes` | The password to use. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: authentication: sampleBasic: @@ -1074,7 +1075,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: sampleBasic ``` @@ -1085,24 +1086,24 @@ Defines the fundamentals of a 'bearer' authentication ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| token | `string` | `yes` | The bearer token to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | ------------------------ | +| token | `string` | `yes` | The bearer token to use. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: getMessages: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: bearer: @@ -1111,28 +1112,26 @@ do: #### Certificate Authentication - #### Digest Authentication - #### OAUTH2 Authentication Defines the fundamentals of an 'oauth2' authentication ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| authority | `string` | `yes` | The URI that references the OAuth2 authority to use. | -| grant | `string` | `yes` | The grant type to use. -| client.id | `string` | `yes` | The client id to use. | -| client.secret | `string` | `no` | The client secret to use, if any. | -| scopes | `string[]` | `no` | The scopes, if any, to request the token for. | -| audiences | `string[]` | `no` | The audiences, if any, to request the token for. | -| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. | -| password | `string` | `no` | The password to use. Used only if the grant type is `Password`. | -| subject | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the party on behalf of whom the request is being made. | -| actor | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the acting party. | +| Property | Type | Required | Description | +| ------------- | :----------------------------: | :------: | --------------------------------------------------------------------------------------------------------- | +| authority | `string` | `yes` | The URI that references the OAuth2 authority to use. | +| grant | `string` | `yes` | The grant type to use. | +| client.id | `string` | `yes` | The client id to use. | +| client.secret | `string` | `no` | The client secret to use, if any. | +| scopes | `string[]` | `no` | The scopes, if any, to request the token for. | +| audiences | `string[]` | `no` | The audiences, if any, to request the token for. | +| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. | +| password | `string` | `no` | The password to use. Used only if the grant type is `Password`. | +| subject | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the party on behalf of whom the request is being made. | +| actor | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the acting party. | ##### Examples @@ -1147,7 +1146,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: oauth2: @@ -1166,10 +1165,10 @@ Represents the definition of an OAUTH2 token ###### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| token | `string` | `yes` | The security token to use to use. | -| type | `string` | `yes` | The type of security token to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | ---------------------------------- | +| token | `string` | `yes` | The security token to use to use. | +| type | `string` | `yes` | The type of security token to use. | ### Extension @@ -1179,16 +1178,17 @@ Extensions enable the execution of tasks prior to those they extend, offering th #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| extend | `string` | `yes` | The type of task to extend
Supported values are: `call`, `composite`, `emit`, `extension`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` | -| when | `string` | `no` | A runtime expression used to determine whether or not the extension should apply in the specified context | -| before | [`task`](#task) | `no` | The task to execute, if any, before the extended task | -| after | [`task`](#task) | `no` | The task to execute, if any, after the extended task | +| Property | Type | Required | Description | +| -------- | :-------------: | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| extend | `string` | `yes` | The type of task to extend
Supported values are: `call`, `composite`, `emit`, `extension`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` | +| when | `string` | `no` | A runtime expression used to determine whether or not the extension should apply in the specified context | +| before | [`task`](#task) | `no` | The task to execute, if any, before the extended task | +| after | [`task`](#task) | `no` | The task to execute, if any, after the extended task | #### Examples -*Perform logging before and after any non-extension task is run:* +_Perform logging before and after any non-extension task is run:_ + ```yaml document: dsl: '1.0.0-alpha1' @@ -1221,13 +1221,14 @@ do: endpoint: https://fake.com/sample ``` -*Intercept HTTP calls to 'https://mocked.service.com' and mock its response:* +_Intercept HTTP calls to 'https://mocked.service.com' and mock its response:_ + ```yaml -document: - dsl: '1.0.0-alpha1' +document: + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: extensions: mockService: @@ -1256,13 +1257,13 @@ Defines the [Problem Details RFC](https://datatracker.ietf.org/doc/html/rfc7807) #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| type | `string` | `yes` | A URI reference that identifies the [`error`](#error) type.
For cross-compatibility concerns, it is strongly recommended to use [Standard Error Types](#standard-error-types) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | -| status | `integer` | `yes` | The status code generated by the origin for this occurrence of the [`error`](#error).
For cross-compatibility concerns, it is strongly recommended to use [HTTP Status Codes](https://datatracker.ietf.org/doc/html/rfc7231#section-6) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | -| instance | `string` | `yes` | A [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) used to reference the component the [`error`](#error) originates from.
Runtimes **MUST** set the property when raising or escalating the [`error`](#error). Otherwise ignore. | -| title | `string` | `no` | A short, human-readable summary of the [`error`](#error). | -| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error). | +| Property | Type | Required | Description | +| -------- | :-------: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | `string` | `yes` | A URI reference that identifies the [`error`](#error) type.
For cross-compatibility concerns, it is strongly recommended to use [Standard Error Types](#standard-error-types) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | +| status | `integer` | `yes` | The status code generated by the origin for this occurrence of the [`error`](#error).
For cross-compatibility concerns, it is strongly recommended to use [HTTP Status Codes](https://datatracker.ietf.org/doc/html/rfc7231#section-6) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | +| instance | `string` | `yes` | A [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) used to reference the component the [`error`](#error) originates from.
Runtimes **MUST** set the property when raising or escalating the [`error`](#error). Otherwise ignore. | +| title | `string` | `no` | A short, human-readable summary of the [`error`](#error). | +| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error). | #### Examples @@ -1276,18 +1277,18 @@ status: 503 Standard error types serve the purpose of categorizing errors consistently across different runtimes, facilitating seamless migration from one runtime environment to another. -| Type | Status¹ | Description | -|------|:-------:|-------------| -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/configuration](#) | `400` | Errors resulting from incorrect or invalid configuration settings, such as missing or misconfigured environment variables, incorrect parameter values, or configuration file errors. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/validation](#) | `400` | Errors arising from validation processes, such as validation of input data, schema validation failures, or validation constraints not being met. These errors indicate that the provided data or configuration does not adhere to the expected format or requirements specified by the workflow. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/expression](#) | `400` | Errors occurring during the evaluation of runtime expressions, such as invalid syntax or unsupported operations. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authentication](#) | `401` | Errors related to authentication failures. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authorization](#) | `403` | Errors related to unauthorized access attempts or insufficient permissions to perform certain actions within the workflow. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/timeout](#) | `408` | Errors caused by timeouts during the execution of tasks or during interactions with external services. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/communication](#) | `500` | Errors encountered while communicating with external services, including network errors, service unavailable, or invalid responses. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/runtime](#) | `500` | Errors occurring during the runtime execution of a workflow, including unexpected exceptions, errors related to resource allocation, or failures in handling workflow tasks. These errors typically occur during the actual execution of workflow components and may require runtime-specific handling and resolution strategies. | +| Type | Status¹ | Description | +| --------------------------------------------------------------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/configuration](#) | `400` | Errors resulting from incorrect or invalid configuration settings, such as missing or misconfigured environment variables, incorrect parameter values, or configuration file errors. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/validation](#) | `400` | Errors arising from validation processes, such as validation of input data, schema validation failures, or validation constraints not being met. These errors indicate that the provided data or configuration does not adhere to the expected format or requirements specified by the workflow. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/expression](#) | `400` | Errors occurring during the evaluation of runtime expressions, such as invalid syntax or unsupported operations. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authentication](#) | `401` | Errors related to authentication failures. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authorization](#) | `403` | Errors related to unauthorized access attempts or insufficient permissions to perform certain actions within the workflow. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/timeout](#) | `408` | Errors caused by timeouts during the execution of tasks or during interactions with external services. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/communication](#) | `500` | Errors encountered while communicating with external services, including network errors, service unavailable, or invalid responses. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/runtime](#) | `500` | Errors occurring during the runtime execution of a workflow, including unexpected exceptions, errors related to resource allocation, or failures in handling workflow tasks. These errors typically occur during the actual execution of workflow components and may require runtime-specific handling and resolution strategies. | -¹ *Default value. The `status code` that best describe the error should always be used.* +¹ _Default value. The `status code` that best describe the error should always be used._ ### Event Consumption Strategy @@ -1295,11 +1296,11 @@ Represents the configuration of an event consumption strategy. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| all | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for all defined events before resuming execution.
*Required if `any` and `one` have not been set.* | -| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.
*Required if `all` and `one` have not been set.* | -| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.
*Required if `all` and `any` have not been set.* | +| Property | Type | Required | Description | +| -------- | :------------------------------: | :------: | -------------------------------------------------------------------------------------------------------------------------------------------- | +| all | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for all defined events before resuming execution.
_Required if `any` and `one` have not been set._ | +| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.
_Required if `all` and `one` have not been set._ | +| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.
_Required if `all` and `any` have not been set._ | ### Event Filter @@ -1307,10 +1308,10 @@ An event filter is a mechanism used to selectively process or handle events base #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| with | `object` | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. | -| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. | +| Property | Type | Required | Description | +| --------- | :----------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------ | +| with | `object` | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. | +| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. | ### Correlation @@ -1318,10 +1319,10 @@ A correlation is a link between events and data, established by mapping event at #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| from | `string` | `yes` | A runtime expression used to extract the correlation value from the filtered event. | -| expect | `string` | `no` | A constant or a runtime expression, if any, used to determine whether or not the extracted correlation value matches expectations.
If not set, the first extracted value will be used as the correlation's expectation. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| from | `string` | `yes` | A runtime expression used to extract the correlation value from the filtered event. | +| expect | `string` | `no` | A constant or a runtime expression, if any, used to determine whether or not the extracted correlation value matches expectations.
If not set, the first extracted value will be used as the correlation's expectation. | ### Retry @@ -1329,42 +1330,42 @@ The Retry is a fundamental concept in the Serverless Workflow DSL, used to defin #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| when | `string` | `no` | A a runtime expression used to determine whether or not to retry running the task, in a given context. | -| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to retry running the task, in a given context. | -| limit | [`retry`](#retry-limit) | `no` | The limits, if any, to impose to the retry policy. | -| backoff | [`backoff`](#backoff) | `no` | The backoff strategy to use, if any. | -| jitter | [`jitter`](#jitter) | `no` | The parameters, if any, that control the randomness or variability of the delay between retry attempts. | +| Property | Type | Required | Description | +| ---------- | :---------------------: | :------: | ------------------------------------------------------------------------------------------------------- | +| when | `string` | `no` | A a runtime expression used to determine whether or not to retry running the task, in a given context. | +| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to retry running the task, in a given context. | +| limit | [`retry`](#retry-limit) | `no` | The limits, if any, to impose to the retry policy. | +| backoff | [`backoff`](#backoff) | `no` | The backoff strategy to use, if any. | +| jitter | [`jitter`](#jitter) | `no` | The parameters, if any, that control the randomness or variability of the delay between retry attempts. | #### Retry Limit The definition of a retry policy. -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| attempt.count | `integer` | `no` | The maximum attempts count. | -| attempt.duration | [`duration`](#duration) | `no` | The duration limit, if any, for all retry attempts. | -| duration | [`duration`](#duration) | `no` | The maximum duration, if any, during which to retry a given task. | +| Property | Type | Required | Description | +| ---------------- | :---------------------: | :------: | ----------------------------------------------------------------- | +| attempt.count | `integer` | `no` | The maximum attempts count. | +| attempt.duration | [`duration`](#duration) | `no` | The duration limit, if any, for all retry attempts. | +| duration | [`duration`](#duration) | `no` | The maximum duration, if any, during which to retry a given task. | #### Backoff The definition of a retry backoff strategy. -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| constant | `object` | `no` | The definition of the constant backoff to use, if any.
*Required if `exponential` and `linear` are not set, otherwise ignored.* | -| exponential | `object` | `no` | The definition of the exponential backoff to use, if any.
*Required if `constant` and `linear` are not set, otherwise ignored.* | -| linear | `object` | `no` | The definition of the linear backoff to use, if any.
*Required if `constant` and `exponential` are not set, otherwise ignored.* | +| Property | Type | Required | Description | +| ----------- | :------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| constant | `object` | `no` | The definition of the constant backoff to use, if any.
_Required if `exponential` and `linear` are not set, otherwise ignored._ | +| exponential | `object` | `no` | The definition of the exponential backoff to use, if any.
_Required if `constant` and `linear` are not set, otherwise ignored._ | +| linear | `object` | `no` | The definition of the linear backoff to use, if any.
_Required if `constant` and `exponential` are not set, otherwise ignored._ | #### Jitter Represents the definition of the parameters that control the randomness or variability of a delay, typically between retry attempts -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| from | [`duration`](#duration) | `yes` | The minimum duration of the jitter range. | -| to | [`duration`](#duration) | `yes` | The maximum duration of the jitter range. | +| Property | Type | Required | Description | +| -------- | :---------------------: | :------: | ----------------------------------------- | +| from | [`duration`](#duration) | `yes` | The minimum duration of the jitter range. | +| to | [`duration`](#duration) | `yes` | The maximum duration of the jitter range. | #### Examples @@ -1382,10 +1383,10 @@ When set, runtimes must validate input data against the defined schema, unless d #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate input data.
*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* | -| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. | +| Property | Type | Required | Description | +| -------- | :------------------: | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate input data.
_Even though the schema is not required, it is strongly encouraged to document it, whenever feasible._ | +| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. | #### Examples @@ -1397,7 +1398,7 @@ schema: properties: petId: type: string - required: [ petId ] + required: [petId] from: .order.pet ``` @@ -1411,11 +1412,11 @@ When set, runtimes must validate output data against the defined schema, unless #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate output data.
*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* | -| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. | -| to | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to update the context, using both output and context data. | +| Property | Type | Required | Description | +| -------- | :------------------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate output data.
_Even though the schema is not required, it is strongly encouraged to document it, whenever feasible._ | +| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. | +| to | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to update the context, using both output and context data. | #### Examples @@ -1427,10 +1428,10 @@ schema: properties: petId: type: string - required: [ petId ] + required: [petId] from: - petId: '${ .pet.id }' -to: '.petList += [ . ]' + petId: "${ .pet.id }" +to: ".petList += [ . ]" ``` ### Schema @@ -1439,15 +1440,16 @@ Describes a data schema. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| format | `string` | `yes` | The schema format.
*Supported values are:*
*- `json`, which indicates the [JsonSchema](https://json-schema.org/) format.* | -| document | `object` | `no` | The inline schema document.
*Required if `resource` has not been set, otherwise ignored.* | -| resource | [`externalResource`](#external-resource) | `no` | The schema external resource.
*Required if `document` has not been set, otherwise ignored.* | +| Property | Type | Required | Description | +| -------- | :--------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------- | +| format | `string` | `yes` | The schema format.
_Supported values are:_
_- `json`, which indicates the [JsonSchema](https://json-schema.org/) format._ | +| document | `object` | `no` | The inline schema document.
_Required if `resource` has not been set, otherwise ignored._ | +| resource | [`externalResource`](#external-resource) | `no` | The schema external resource.
_Required if `document` has not been set, otherwise ignored._ | #### Examples -*Example of an inline JsonSchema:* +_Example of an inline JsonSchema:_ + ```yaml format: json document: @@ -1459,10 +1461,11 @@ document: type: string lastName: type: string - required: [ id, firstName, lastName ] + required: [id, firstName, lastName] ``` -*Example of a JsonSchema based on an external resource:* +_Example of a JsonSchema based on an external resource:_ + ```yaml format: json resource: @@ -1475,18 +1478,18 @@ Defines a workflow or task timeout. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| after | [`duration`](#duration) | `yes` | The duration after which the workflow or task times out. | +| Property | Type | Required | Description | +| -------- | :---------------------: | :------: | -------------------------------------------------------- | +| after | [`duration`](#duration) | `yes` | The duration after which the workflow or task times out. | #### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: default name: sample - version: '0.1.0' + version: "0.1.0" do: waitFor60Seconds: wait: @@ -1502,17 +1505,18 @@ Defines a duration. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| Days | `integer` | `no` | Number of days, if any. | -| Hours | `integer` | `no` | Number of hours, if any. | -| Minutes | `integer` | `no`| Number of minutes, if any. | -| Seconds | `integer` | `no`| Number of seconds, if any. | -| Milliseconds | `integer` | `no`| Number of milliseconds, if any. | +| Property | Type | Required | Description | +| ------------ | :-------: | :------: | ------------------------------- | +| Days | `integer` | `no` | Number of days, if any. | +| Hours | `integer` | `no` | Number of hours, if any. | +| Minutes | `integer` | `no` | Number of minutes, if any. | +| Seconds | `integer` | `no` | Number of seconds, if any. | +| Milliseconds | `integer` | `no` | Number of milliseconds, if any. | #### Examples -*Example of a duration of 2 hours, 15 minutes and 30 seconds:* +_Example of a duration of 2 hours, 15 minutes and 30 seconds:_ + ```yaml hours: 2 minutes: 15 @@ -1525,12 +1529,12 @@ Describes an HTTP response. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| request | [`request`](#http-request) | `yes` | The HTTP request associated with the HTTP response. | -| statusCode | `integer` | `yes` | The HTTP response status code. | -| headers | `map[string, string]` | `no` | The HTTP response headers, if any. | -| content | `any` | `no` | The HTTP response content, if any.
*If the request's content type is one of the following, should contain the deserialized response content. Otherwise, should contain the base-64 encoded response content, if any.*| +| Property | Type | Required | Description | +| ---------- | :------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| request | [`request`](#http-request) | `yes` | The HTTP request associated with the HTTP response. | +| statusCode | `integer` | `yes` | The HTTP response status code. | +| headers | `map[string, string]` | `no` | The HTTP response headers, if any. | +| content | `any` | `no` | The HTTP response content, if any.
_If the request's content type is one of the following, should contain the deserialized response content. Otherwise, should contain the base-64 encoded response content, if any._ | #### Examples @@ -1555,11 +1559,11 @@ Describes an HTTP request. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| method | `string` | `yes` | The request's method. | -| uri | `uri` | `yes` | The request's URI. | -| headers | `map[string, string]` | `no` | The HTTP request headers, if any. | +| Property | Type | Required | Description | +| -------- | :-------------------: | :------: | --------------------------------- | +| method | `string` | `yes` | The request's method. | +| uri | `uri` | `yes` | The request's URI. | +| headers | `map[string, string]` | `no` | The HTTP request headers, if any. | #### Examples @@ -1568,4 +1572,4 @@ method: get uri: https://petstore.swagger.io/v2/pet/1 headers: Content-Type: application/json -``` \ No newline at end of file +``` diff --git a/dsl.md b/dsl.md index 900c5fb0..5e88f6c3 100644 --- a/dsl.md +++ b/dsl.md @@ -6,31 +6,31 @@ - [Motivation](#motivation) - [Design](#design) - [Concepts](#concepts) - + [Workflow](#workflow) + - [Workflow](#workflow) - [Status Phases](#status-phases) - [Components](#components) - + [Task](#task) + - [Task](#task) - [Scheduling](#scheduling) - + [Task Flow](#task-flow) - + [Data Flow](#data-flow) - + [Runtime Expressions](#runtime-expressions) + - [Task Flow](#task-flow) + - [Data Flow](#data-flow) + - [Runtime Expressions](#runtime-expressions) - [Arguments](#runtime-expression-arguments) - + [Fault Tolerance](#fault-tolerance) - + [Timeouts](#timeouts) - + [Interoperability](#interoperability) + - [Fault Tolerance](#fault-tolerance) + - [Timeouts](#timeouts) + - [Interoperability](#interoperability) - [Supported Protocols](#supported-protocols) - [Custom and Non-Standard Interactions](#custom-and-non-standard-interactions) - [Creating a Custom Function](#creating-a-custom-function) - [Using a Custom Function](#using-a-custom-function) - [Publishing a Custom Function](#publishing-a-custom-function) - + [Events](#events) - + [Extensions](#extensions) - + [External Resources](#external-resources) - + [Authentication](#authentication) + - [Events](#events) + - [Extensions](#extensions) + - [External Resources](#external-resources) + - [Authentication](#authentication) ## Abstract -This document proposes the creation of a Domain Specific Language (DSL) called Serverless Workflow, tailored for building platform agnostic workflows. +This document proposes the creation of a Domain Specific Language (DSL) called Serverless Workflow, tailored for building platform agnostic workflows. Serverless Workflow aims to simplify the orchestration of complex processes across diverse environments, providing developers with a unified syntax and set of tools for defining and executing serverless workflows. @@ -60,9 +60,9 @@ Moreover, the DSL eschews strong-typed enumerations wherever feasible, fostering ### Workflow -A Serverless Workflow is a sequence of specific [tasks](#tasks) that are executed in a defined order. By default, this order follows the declaration sequence within the workflow definition. Workflows are designed to automate processes and orchestrate various serverless functions and services. +A Serverless Workflow is a sequence of specific [tasks](#tasks) that are executed in a defined order. By default, this order follows the declaration sequence within the workflow definition. Workflows are designed to automate processes and orchestrate various serverless functions and services. -Workflows can be triggered in different ways: upon request, scheduled using CRON expressions, or initiated upon correlation with specific events. +Workflows can be triggered in different ways: upon request, scheduled using CRON expressions, or initiated upon correlation with specific events. Additionally, workflows may optionally accept inputs and produce outputs, allowing for data processing and transformation within the workflow execution. @@ -70,18 +70,18 @@ Additionally, workflows may optionally accept inputs and produce outputs, allowi Workflows in the Serverless Workflow DSL can exist in several phases, each indicating the current state of the workflow execution. These phases include: -| Phase | Description | -| --- | --- | -| `pending` | The workflow has been initiated and is pending execution. | -| `running` | The workflow is currently in progress. | -| `waiting` | The workflow execution has been paused or halted temporarily and is waiting for something to happen. | -| `cancelled` | The workflow execution has been terminated before completion. | -| `faulted` | The workflow execution has encountered an error. | -| `completed` | The workflow execution has successfully finished all tasks. | +| Phase | Description | +| ----------- | ---------------------------------------------------------------------------------------------------- | +| `pending` | The workflow has been initiated and is pending execution. | +| `running` | The workflow is currently in progress. | +| `waiting` | The workflow execution has been paused or halted temporarily and is waiting for something to happen. | +| `cancelled` | The workflow execution has been terminated before completion. | +| `faulted` | The workflow execution has encountered an error. | +| `completed` | The workflow execution has successfully finished all tasks. | -Additionally, the flow of execution within a workflow can be controlled using [directives*](#flow-directives), which provide instructions to the workflow engine on how to manage and handle specific aspects of workflow execution. +Additionally, the flow of execution within a workflow can be controlled using [directives\*](#flow-directives), which provide instructions to the workflow engine on how to manage and handle specific aspects of workflow execution. -**To learn more about flow directives and how they can be utilized to control the execution and behavior of workflows, please refer to [Flow Directives](dsl-reference.md#flow-directive).* +\*_To learn more about flow directives and how they can be utilized to control the execution and behavior of workflows, please refer to [Flow Directives](dsl-reference.md#flow-directive)._ #### Components @@ -106,9 +106,9 @@ The Serverless Workflow DSL defines several default [task](dsl-reference.md#task - [For](dsl-reference.md#for), used to iterate over a collection of items, and conditionally perform a task for each of them. - [Listen](dsl-reference.md#listen), used to listen for an [event](dsl-reference.md#event) or more. - [Raise](dsl-reference.md#raise), used to raise an [error](dsl-reference.md#error) and potentially fault the [workflow](dsl-reference.md#workflow). -- [Run](dsl-reference.md#run), used to run a [container](dsl-reference.md#container), a [script](dsl-reference.md#script) or event a [shell](dsl-reference.md#shell) command. +- [Run](dsl-reference.md#run), used to run a [container](dsl-reference.md#container), a [script](dsl-reference.md#script) or event a [shell](dsl-reference.md#shell) command. - [Switch](dsl-reference.md#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions -- [Set](dsl-reference.md#set), used to dynamically set or update the [workflow](dsl-reference.md#workflow)'s data during the its execution. +- [Set](dsl-reference.md#set), used to dynamically set or update the [workflow](dsl-reference.md#workflow)'s data during the its execution. - [Try](dsl-reference.md#try), used to attempt executing a specified [task](dsl-reference.md#task), and to handle any resulting [errors](dsl-reference.md#error) gracefully, allowing the [workflow](dsl-reference.md#workflow) to continue without interruption. - [Wait](dsl-reference.md#wait), used to pause or wait for a specified duration before proceeding to the next task. @@ -122,9 +122,9 @@ Runtime **must** implement a mechanism capable of providing the workflow with th #### Scheduling -Workflow scheduling in ServerlessWorkflow allows developers to specify when and how their workflows should be executed, ensuring timely response to events and efficient resource utilization. It offers four key properties: `every`, `cron`, `after`, and `on`. +Workflow scheduling in ServerlessWorkflow allows developers to specify when and how their workflows should be executed, ensuring timely response to events and efficient resource utilization. It offers four key properties: `every`, `cron`, `after`, and `on`. -- The `every` property defines the interval for workflow execution, ensuring periodic runs regardless of the previous run's status. +- The `every` property defines the interval for workflow execution, ensuring periodic runs regardless of the previous run's status. - With `cron`, developers can use CRON expressions to schedule workflow execution at specific times or intervals. - `after` specifies a delay duration before restarting the workflow after completion. - `on` enables event-driven scheduling, triggering workflow execution based on specified events. @@ -139,43 +139,43 @@ Once the task has been executed, different things can happen: - `continue`: the task ran to completion, and the next task, if any, should be executed. The task to run next is implictly the next in declaration order, or explicitly defined by the `then` property of the executed task. If the executed task is the last task, then the workflow's execution gracefully ends. - `fault`: the task raised an uncaught error, which abruptly halts the workflow's execution and makes it transition to `faulted` [status phase](#status-phases). -- `end`: the task explicitly and gracefully ends the workflow's execution. +- `end`: the task explicitly and gracefully ends the workflow's execution. ### Data Flow -In Serverless Workflow DSL, data flow management is crucial to ensure that the right data is passed between tasks and to the workflow itself. +In Serverless Workflow DSL, data flow management is crucial to ensure that the right data is passed between tasks and to the workflow itself. Here's how data flows through a workflow based on various filtering stages: 1. **Filter Workflow Input** -Before the workflow starts, the input data provided to the workflow can be filtered to ensure only relevant data is passed into the workflow context. This step allows the workflow to start with a clean and focused dataset, reducing potential overhead and complexity in subsequent tasks. + Before the workflow starts, the input data provided to the workflow can be filtered to ensure only relevant data is passed into the workflow context. This step allows the workflow to start with a clean and focused dataset, reducing potential overhead and complexity in subsequent tasks. -*Example: If the workflow receives a JSON object as input, a filter can be applied to remove unnecessary fields and retain only those that are required for the workflow's execution.* +_Example: If the workflow receives a JSON object as input, a filter can be applied to remove unnecessary fields and retain only those that are required for the workflow's execution._ 2. **Filter First Task Input** -The input data for the first task can be filtered to match the specific requirements of that task. This ensures that the first task receives only the necessary data it needs to perform its operations. + The input data for the first task can be filtered to match the specific requirements of that task. This ensures that the first task receives only the necessary data it needs to perform its operations. -*Example: If the first task is a function call that only needs a subset of the workflow input, a filter can be applied to provide only those fields needed for the function to execute.* +_Example: If the first task is a function call that only needs a subset of the workflow input, a filter can be applied to provide only those fields needed for the function to execute._ 3. **Filter First Task Output** -After the first task completes, its output can be filtered before passing it to the next task or storing it in the workflow context. This helps in managing the data flow and keeping the context clean by removing any unnecessary data produced by the task. + After the first task completes, its output can be filtered before passing it to the next task or storing it in the workflow context. This helps in managing the data flow and keeping the context clean by removing any unnecessary data produced by the task. -*Example: If the first task returns a large dataset, a filter can be applied to retain only the relevant results needed for subsequent tasks.* +_Example: If the first task returns a large dataset, a filter can be applied to retain only the relevant results needed for subsequent tasks._ 4. **Filter Last Task Input** -Before the last task in the workflow executes, its input data can be filtered to ensure it receives only the necessary information. This step is crucial for ensuring that the final task has all the required data to complete the workflow successfully. + Before the last task in the workflow executes, its input data can be filtered to ensure it receives only the necessary information. This step is crucial for ensuring that the final task has all the required data to complete the workflow successfully. -*Example: If the last task involves generating a report, the input filter can ensure that only the data required for the report generation is passed to the task.* +_Example: If the last task involves generating a report, the input filter can ensure that only the data required for the report generation is passed to the task._ 5. **Filter Last Task Output** -After the last task completes, its output can be filtered before it is considered as the workflow output. This ensures that the workflow produces a clean and relevant output, free from any extraneous data that might have been generated during the task execution. + After the last task completes, its output can be filtered before it is considered as the workflow output. This ensures that the workflow produces a clean and relevant output, free from any extraneous data that might have been generated during the task execution. -*Example: If the last task outputs various statistics, a filter can be applied to retain only the key metrics that are relevant to the stakeholders.* +_Example: If the last task outputs various statistics, a filter can be applied to retain only the key metrics that are relevant to the stakeholders._ 6. **Filter Workflow Output** -Finally, the overall workflow output can be filtered before it is returned to the caller or stored. This step ensures that the final output of the workflow is concise and relevant, containing only the necessary information that needs to be communicated or recorded. + Finally, the overall workflow output can be filtered before it is returned to the caller or stored. This step ensures that the final output of the workflow is concise and relevant, containing only the necessary information that needs to be communicated or recorded. -*Example: If the workflow's final output is a summary report, a filter can ensure that the report contains only the most important summaries and conclusions, excluding any intermediate data.* +_Example: If the workflow's final output is a summary report, a filter can ensure that the report contains only the most important summaries and conclusions, excluding any intermediate data._ By applying filters at these strategic points, Serverless Workflow DSL ensures that data flows through the workflow in a controlled and efficient manner, maintaining clarity and relevance at each stage of execution. This approach helps in managing complex workflows and ensures that each task operates with the precise data it requires, leading to more predictable and reliable workflow outcomes. @@ -199,11 +199,11 @@ When the evaluation of an expression fails, runtimes **must** raise an error wit #### Runtime expression arguments -| Name | Type | Description | -|:-----|:----:|:------------| -| context | `map` | The task's context data. | -| input | `any` | The task's filtered input. | -| task | [`taskDescriptor`](#task-descriptor) | Describes the current task. | +| Name | Type | Description | +| :------- | :-----------------------------------------: | :------------------------------ | +| context | `map` | The task's context data. | +| input | `any` | The task's filtered input. | +| task | [`taskDescriptor`](#task-descriptor) | Describes the current task. | | workflow | [`workflowDescritor`](#workflow-descriptor) | Describes the current workflow. | ### Fault Tolerance @@ -216,7 +216,8 @@ Overall, the fault tolerance features in Serverless Workflow enhance its robustn Errors in Serverless Workflow are described using the [Problem Details RFC](https://datatracker.ietf.org/doc/html/rfc7807). This specification helps to standardize the way errors are communicated, using the `instance` property as a [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) to identify the specific component of the workflow that has raised the error. By adhering to this standard, authors and runtimes can consistently describe and handle errors. -*Example error:* +_Example error:_ + ```yaml type: https://https://serverlessworkflow.io/spec/1.0.0/errors/communication title: Service Unavailable @@ -233,7 +234,8 @@ See the [DSL reference](dsl-reference.md#error) for more details about errors. Errors are critical for both authors and runtimes as they provide a means to communicate and describe the occurrence of problems. This, in turn, enables the definition of mechanisms to catch and act upon these errors. For instance, some errors caught using a [`try`](dsl-reference.md#try) block may be transient and temporary, such as a `503 Service Unavailable`. In such cases, the DSL provides a mechanism to retry a faulted task, allowing for recovery from temporary issues. -*Retrying 5 times when an error with 503 is caught:* +_Retrying 5 times when an error with 503 is caught:_ + ```yaml try: call: http @@ -268,7 +270,8 @@ A timeout error **must** have its `type` set to `https://https://serverlessworkf Serverless Workflow DSL is designed to seamlessly interact with a variety of services, ensuring robust service interoperability. #### Supported Protocols - - [**HTTP**](dsl-reference.md#http-call): Allows the workflow to make standard HTTP requests to web services. This is useful for RESTful services and web APIs that communicate over the HTTP protocol. + +- [**HTTP**](dsl-reference.md#http-call): Allows the workflow to make standard HTTP requests to web services. This is useful for RESTful services and web APIs that communicate over the HTTP protocol. - [**gRPC**](dsl-reference.md#grpc-call): Supports Remote Procedure Call (RPC) using gRPC, a high-performance, open-source universal RPC framework. This is suitable for connecting to services that require low-latency and high-throughput communication. - [**AsyncAPI**](dsl-reference.md#asyncapi-call): Facilitates interaction with asynchronous messaging protocols. AsyncAPI is designed for event-driven architectures, allowing workflows to publish and subscribe to events. - [**OpenAPI**](dsl-reference.md#openapi-call): Enables communication with services that provide OpenAPI specifications, which is useful for defining and consuming RESTful APIs. @@ -277,13 +280,13 @@ Runtimes **must** raise an error with type `https://https://serverlessworkflow.i #### Custom and Non-Standard Interactions - In addition to the default supported protocols, the DSL also provides mechanisms to interact with services in non-standard or unsupported ways using custom processes. This flexibility allows workflows to extend their capabilities beyond the built-in protocols and integrate with any service, regardless of the communication method. +In addition to the default supported protocols, the DSL also provides mechanisms to interact with services in non-standard or unsupported ways using custom processes. This flexibility allows workflows to extend their capabilities beyond the built-in protocols and integrate with any service, regardless of the communication method. For custom interactions, the workflow can define [tasks](dsl-reference.md#run) that [execute shell commands](dsl-reference.md#shell-process), [execute scripts](dsl-reference.md#script-process) or [run containers](dsl-reference.md#container-process) to handle unique service communication requirements. This ensures that the workflow can still maintain interoperability even with services that do not adhere to the standard supported protocols. ##### Creating a Custom Function -Serverless Workflow DSL supports the creation and publication of custom functions to extend the DSL capabilities. +Serverless Workflow DSL supports the creation and publication of custom functions to extend the DSL capabilities. Custom functions allow you to define specific tasks and interactions that are not covered by the default supported protocols. Here’s how you can define and use custom functions within your workflows. @@ -318,10 +321,9 @@ validateEmailAddress: } const emailAddress = '${ .emailAddress }'; return { isValid: validateEmail(emailAddress) }; - ``` -3. Optionally, add all the local files your function might need into its directory. +3. Optionally, add all the local files your function might need into its directory. 4. Commit and push your function to your repository. @@ -329,17 +331,17 @@ validateEmailAddress: ##### Using a Custom Function -Once a custom function is defined, it can be used within a workflow to perform specific tasks. +Once a custom function is defined, it can be used within a workflow to perform specific tasks. The following example demonstrates how to use the `validateEmailAddress` custom function in a workflow. ```yaml # workflow.yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: default name: customFunctionWorkflow - version: '0.1.0' + version: "0.1.0" do: validateEmail: @@ -350,7 +352,7 @@ do: ##### Publishing a Custom Function -Consider submitting your function to the Serverless Workflow Function Registry. +Consider submitting your function to the Serverless Workflow Function Registry. This optional step allows users to discover and utilize your function, enhancing its visibility and usability within the Serverless Workflow community. By registering your function, you contribute to a shared repository of resources that can streamline workflow development for others. @@ -362,7 +364,7 @@ Events in Serverless Workflow adhere to the [Cloud Events specification](https:/ #### Emitting Events -The Emit task allows workflows to publish events to event brokers or messaging systems. This capability enables workflows to broadcast notifications about various events, such as order placements, data updates, or system events. +The Emit task allows workflows to publish events to event brokers or messaging systems. This capability enables workflows to broadcast notifications about various events, such as order placements, data updates, or system events. By emitting events, workflows can seamlessly integrate with event-driven architectures, facilitating event-driven decision-making and enabling reactive behavior based on incoming events. For example, a workflow handling order processing might emit an event signaling the successful placement of an order, triggering downstream processes like inventory management or shipping. @@ -400,7 +402,8 @@ Overall, extensions empower developers to build complex workflows with enhanced See the [DSL reference](dsl-reference.md#extension) for more details about extensions. -*Sample logging extension:* +_Sample logging extension:_ + ```yaml document: dsl: '1.0.0-alpha1' @@ -435,9 +438,9 @@ do: ### External Resources -External resources in Serverless Workflow allow you to define and access external assets or services required for workflow execution. +External resources in Serverless Workflow allow you to define and access external assets or services required for workflow execution. -These resources can include APIs, databases, files, or any other external entities needed by the workflow. Each external resource can be identified by a unique name and is associated with a URI that specifies its location. +These resources can include APIs, databases, files, or any other external entities needed by the workflow. Each external resource can be identified by a unique name and is associated with a URI that specifies its location. Optionally, you can specify an authentication policy to ensure secure access to the resource. For instance, you can use basic authentication with a username and password, or you can reference a pre-configured authentication policy by name. @@ -452,6 +455,7 @@ Amonst others, [external resources](dsl-reference.md#external-resource) and [cal The Serverless Workflow DSL supports a suite of standard authentication mechanisms, amongst which are: - **Basic Authentication**: Utilizes a username-password pair for authentication. + ```yaml sampleBasic: basic: @@ -460,12 +464,14 @@ sampleBasic: ``` - **Bearer Authentication**: Uses a bearer token for authentication. + ```yaml sampleBearer: bearer: ${ .user.token } ``` - **OAuth2 Authentication**: Implements OAuth2 authorization framework for secure access. + ```yaml sampleOAuth2: oauth2: @@ -474,10 +480,12 @@ sampleOAuth2: client: id: workflow-runtime secret: workflow-runtime-client-secret - scopes: [ api ] - audiences: [ runtime ] + scopes: [api] + audiences: [runtime] ``` -These authentication schemes can be defined globally in the authentication section or associated with specific endpoints. They provide secure access to resources while ensuring proper authorization and identity verification. +These authentication schemes can be defined globally in the authentication +section or associated with specific endpoints. They provide secure access to +resources while ensuring proper authorization and identity verification. -See the [DSL reference](dsl-reference.md#authentication) for more details about authentication. \ No newline at end of file +See the [DSL reference](dsl-reference.md#authentication) for more details about authentication. diff --git a/examples/accumulate-room-readings.yaml b/examples/accumulate-room-readings.yaml index d7d91eec..258833e5 100644 --- a/examples/accumulate-room-readings.yaml +++ b/examples/accumulate-room-readings.yaml @@ -1,3 +1,4 @@ +--- document: dsl: 1.0.0-alpha1 namespace: examples @@ -43,4 +44,4 @@ do: operationId: produceReport timeout: after: - hours: 1 \ No newline at end of file + hours: 1 diff --git a/examples/bearer-auth-uri-format.yaml b/examples/bearer-auth-uri-format.yaml index 622aae2d..239169f1 100644 --- a/examples/bearer-auth-uri-format.yaml +++ b/examples/bearer-auth-uri-format.yaml @@ -1,3 +1,4 @@ +--- document: dsl: 1.0.0-alpha1 namespace: examples diff --git a/examples/bearer-auth.yaml b/examples/bearer-auth.yaml index f4b2227c..45db1ed7 100644 --- a/examples/bearer-auth.yaml +++ b/examples/bearer-auth.yaml @@ -1,3 +1,4 @@ +--- document: dsl: 1.0.0-alpha1 namespace: examples diff --git a/examples/switch-then-string.yaml b/examples/switch-then-string.yaml index 7db53745..f895aa62 100644 --- a/examples/switch-then-string.yaml +++ b/examples/switch-then-string.yaml @@ -1,8 +1,9 @@ +--- document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: processOrder: switch: @@ -45,4 +46,4 @@ do: log: warn notifyAdmin: set: - message: something's wrong \ No newline at end of file + message: something's wrong diff --git a/owners.md b/owners.md index e22f6629..61c49acd 100644 --- a/owners.md +++ b/owners.md @@ -1,9 +1,11 @@ # See the GOVERNANCE.md document for the definition of the roles and responsibilities + maintainers: - - antmendoza - - cdavernas - - ricardozanini - - tsurdilo -reviewers: - - JBBianchi - - manick02 \ No newline at end of file + +- antmendoza +- cdavernas +- ricardozanini +- tsurdilo + reviewers: +- JBBianchi +- manick02 diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 75c2093e..f7892b38 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -1,3 +1,4 @@ +--- $id: https://serverlessworkflow.io/schemas/1.0.0-alpha1/workflow.json $schema: http://json-schema.org/draft-07/schema description: Serverless Workflow DSL - Workflow Schema @@ -8,7 +9,7 @@ properties: properties: dsl: type: string - pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ # yamllint disable-line rule:line-length description: The version of the DSL used by the workflow. namespace: type: string @@ -20,7 +21,7 @@ properties: description: The workflow's name. version: type: string - pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ + pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ # yamllint disable-line rule:line-length description: The workflow's semantic version. title: type: string @@ -32,10 +33,10 @@ properties: type: object description: A key/value mapping of the workflow's tags, if any. additionalProperties: true - required: [ dsl, namespace, name, version ] + required: [dsl, namespace, name, version] description: Documents the workflow input: - $ref: '#/$defs/input' + $ref: "#/$defs/input" description: Configures the workflow's input. use: type: object @@ -43,27 +44,27 @@ properties: authentications: type: object additionalProperties: - $ref: '#/$defs/authenticationPolicy' + $ref: "#/$defs/authenticationPolicy" description: The workflow's reusable authentication policies. errors: type: object additionalProperties: - $ref: '#/$defs/error' + $ref: "#/$defs/error" description: The workflow's reusable errors. extensions: type: object additionalProperties: - $ref: '#/$defs/extension' + $ref: "#/$defs/extension" description: The workflow's extensions. functions: type: object additionalProperties: - $ref: '#/$defs/task' + $ref: "#/$defs/task" description: The workflow's reusable functions. retries: type: object additionalProperties: - $ref: '#/$defs/retryPolicy' + $ref: "#/$defs/retryPolicy" description: The workflow's reusable retry policies. secrets: type: array @@ -75,28 +76,34 @@ properties: type: object minProperties: 1 additionalProperties: - $ref: '#/$defs/task' + $ref: "#/$defs/task" description: Defines the tasks the workflow must perform timeout: - $ref: '#/$defs/timeout' + $ref: "#/$defs/timeout" description: The workflow's timeout configuration, if any. output: - $ref: '#/$defs/output' + $ref: "#/$defs/output" description: Configures the workflow's output. schedule: type: object properties: every: - $ref: '#/$defs/duration' - description: Specifies the duration of the interval at which the workflow should be executed. + $ref: "#/$defs/duration" + description: | + Specifies the duration of the interval at which the workflow should be + executed. cron: type: string - description: Specifies the schedule using a cron expression, e.g., '0 0 * * *' for daily at midnight." + description: | + Specifies the schedule using a cron expression, e.g., '0 0 * * *' + for daily at midnight. after: - $ref: '#/$defs/duration' - description: Specifies a delay duration that the workflow must wait before starting again after it completes. - on: - $ref: '#/$defs/eventConsumptionStrategy' + $ref: "#/$defs/duration" + description: | + Specifies a delay duration that the workflow must wait before starting + again after it completes. + on: # yamllint disable-line rule:truthy + $ref: "#/$defs/eventConsumptionStrategy" description: Specifies the events that trigger the workflow execution. description: Schedules the workflow $defs: @@ -104,29 +111,30 @@ $defs: type: object properties: input: - $ref: '#/$defs/input' + $ref: "#/$defs/input" description: Configure the task's input. output: - $ref: '#/$defs/output' + $ref: "#/$defs/output" description: Configure the task's output. timeout: - $ref: '#/$defs/timeout' + $ref: "#/$defs/timeout" description: The task's timeout configuration, if any. then: - $ref: '#/$defs/flowDirective' - description: The flow directive to be performed upon completion of the task. + $ref: "#/$defs/flowDirective" + description: | + The flow directive to be performed upon completion of the task. oneOf: - - $ref: '#/$defs/callTask' - - $ref: '#/$defs/compositeTask' - - $ref: '#/$defs/emitTask' - - $ref: '#/$defs/forTask' - - $ref: '#/$defs/listenTask' - - $ref: '#/$defs/raiseTask' - - $ref: '#/$defs/runTask' - - $ref: '#/$defs/setTask' - - $ref: '#/$defs/switchTask' - - $ref: '#/$defs/tryTask' - - $ref: '#/$defs/waitTask' + - $ref: "#/$defs/callTask" + - $ref: "#/$defs/compositeTask" + - $ref: "#/$defs/emitTask" + - $ref: "#/$defs/forTask" + - $ref: "#/$defs/listenTask" + - $ref: "#/$defs/raiseTask" + - $ref: "#/$defs/runTask" + - $ref: "#/$defs/setTask" + - $ref: "#/$defs/switchTask" + - $ref: "#/$defs/tryTask" + - $ref: "#/$defs/waitTask" callTask: type: object oneOf: @@ -138,31 +146,42 @@ $defs: type: object properties: document: - $ref: '#/$defs/externalResource' - description: The document that defines the AsyncAPI operation to call. + $ref: "#/$defs/externalResource" + description: | + The document that defines the AsyncAPI operation to call. operationRef: type: string description: A reference to the AsyncAPI operation to call. server: type: string - description: A a reference to the server to call the specified AsyncAPI operation on. If not set, default to the first server matching the operation's channel. + description: | + A a reference to the server to call the specified AsyncAPI + operation on. If not set, default to the first server matching + the operation's channel. message: type: string - description: The name of the message to use. If not set, defaults to the first message defined by the operation. + description: | + The name of the message to use. If not set, defaults to the + first message defined by the operation. binding: type: string - description: The name of the binding to use. If not set, defaults to the first binding defined by the operation. + description: | + The name of the binding to use. If not set, defaults to the + first binding defined by the operation. payload: type: object - description: The payload to call the AsyncAPI operation with, if any. + description: | + The payload to call the AsyncAPI operation with, if any. authentication: - description: The authentication policy, if any, to use when calling the AsyncAPI operation. + description: | + The authentication policy, if any, to use when calling the + AsyncAPI operation. oneOf: - - $ref: '#/$defs/authenticationPolicy' + - $ref: "#/$defs/authenticationPolicy" - type: string - required: [ document, operationRef ] + required: [document, operationRef] description: Defines the AsyncAPI call to perform. - required: [ call, with ] + required: [call, with] - properties: call: type: string @@ -171,8 +190,9 @@ $defs: type: object properties: proto: - $ref: '#/$defs/externalResource' - description: The proto resource that describes the GRPC service to call. + $ref: "#/$defs/externalResource" + description: | + The proto resource that describes the GRPC service to call. service: type: object properties: @@ -189,21 +209,22 @@ $defs: max: 65535 description: The port number of the GRPC service to call. authentication: - description: The endpoint's authentication policy, if any. oneOf: - - $ref: '#/$defs/authenticationPolicy' + - $ref: "#/$defs/authenticationPolicy" - type: string - required: [ name, host ] + description: The endpoint's authentication policy, if any. + required: [name, host] method: type: string - description: The name of the method to call on the defined GRPC service. + description: | + The name of the method to call on the defined GRPC service. arguments: type: object additionalProperties: true description: The arguments, if any, to call the method with. - required: [ proto, service, method ] + required: [proto, service, method] description: Defines the GRPC call to perform. - required: [ call, with ] + required: [call, with] - properties: call: type: string @@ -217,21 +238,23 @@ $defs: endpoint: description: The HTTP endpoint to send the request to. oneOf: - - $ref: '#/$defs/endpoint' + - $ref: "#/$defs/endpoint" - type: string format: uri-template headers: type: object - description: A name/value mapping of the headers, if any, of the HTTP request to perform. + description: | + A name/value mapping of the headers, if any, of the HTTP + request to perform. body: description: The body, if any, of the HTTP request to perform. output: type: string - enum: [ raw, content, response ] + enum: [raw, content, response] description: The http call output format. Defaults to 'content'. - required: [ method, endpoint ] + required: [method, endpoint] description: Defines the HTTP call to perform. - required: [ call, with ] + required: [call, with] - properties: call: type: string @@ -240,27 +263,32 @@ $defs: type: object properties: document: - $ref: '#/$defs/externalResource' - description: The document that defines the OpenAPI operation to call. + $ref: "#/$defs/externalResource" + description: | + The document that defines the OpenAPI operation to call. operationId: type: string description: The id of the OpenAPI operation to call. parameters: type: object additionalProperties: true - description: A name/value mapping of the parameters of the OpenAPI operation to call. + description: | + A name/value mapping of the parameters of the OpenAPI + operation to call. authentication: - description: The authentication policy, if any, to use when calling the OpenAPI operation. oneOf: - - $ref: '#/$defs/authenticationPolicy' + - $ref: "#/$defs/authenticationPolicy" - type: string + description: | + The authentication policy, if any, to use when calling the + OpenAPI operation. output: type: string - enum: [ raw, content, response ] + enum: [raw, content, response] description: The http call output format. Defaults to 'content'. - required: [ document, operationId ] + required: [document, operationId] description: Defines the OpenAPI call to perform. - required: [ call, with ] + required: [call, with] - properties: call: type: string @@ -270,36 +298,48 @@ $defs: with: type: object additionalProperties: true - description: A name/value mapping of the parameters, if any, to call the function with. - required: [ call ] + description: | + A name/value mapping of the parameters, if any, to call the + function with. + required: [call] compositeTask: type: object properties: execute: type: object oneOf: - - properties: - concurrently: - type: object - minProperties: 2 - additionalProperties: - $ref: '#/$defs/task' - description: A name/definition mapping of the tasks to perform concurrently. - compete: - type: boolean - description: Indicates whether or not the concurrent tasks are racing against each other, with a single possible winner, which sets the composite task's output. - required: [ concurrently ] - - properties: - sequentially: - type: object - minProperties: 2 - additionalProperties: - $ref: '#/$defs/task' - description: A name/definition mapping of the tasks to perform sequentially. - required: [ sequentially ] + - properties: + concurrently: + type: object + minProperties: 2 + additionalProperties: + $ref: "#/$defs/task" + description: | + A name/definition mapping of the tasks to perform + concurrently. + compete: + type: boolean + description: | + Indicates whether or not the concurrent tasks are racing + against each other, with a single possible winner, which + sets the composite task's output. + required: [concurrently] + - properties: + sequentially: + type: object + minProperties: 2 + additionalProperties: + $ref: "#/$defs/task" + description: | + A name/definition mapping of the tasks to perform + sequentially. + required: [sequentially] description: Configures the task execution strategy to use - required: [ execute ] - description: Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations + required: [execute] + description: | + Serves as a pivotal orchestrator within workflow systems, enabling the + seamless integration and execution of multiple subtasks to accomplish + complex operations emitTask: type: object properties: @@ -318,7 +358,9 @@ $defs: description: Identifies the context in which an event happened type: type: string - description: This attribute contains a value describing the type of event related to the originating occurrence. + description: | + This attribute contains a value describing the type of event + related to the originating occurrence. time: type: string format: date-time @@ -326,20 +368,26 @@ $defs: type: string datacontenttype: type: string - description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. + description: | + Content type of data value. This attribute enables data to + carry any type of content, whereby format and encoding might + differ from that of the chosen event format. dataschema: type: string format: uri - required: [ source, type ] + required: [source, type] additionalProperties: true - required: [ event ] - required: [ emit ] - description: Allows workflows to publish events to event brokers or messaging systems, facilitating communication and coordination between different components and services. + required: [event] + required: [emit] + description: | + Allows workflows to publish events to event brokers or messaging systems, + facilitating communication and coordination between different components + and services. flowDirective: additionalProperties: false anyOf: - type: string - enum: [ continue, exit, end ] + enum: [continue, exit, end] default: continue - type: string forTask: @@ -350,23 +398,34 @@ $defs: properties: each: type: string - description: The name of the variable used to store the current item being enumerated. + description: | + The name of the variable used to store the current item being + enumerated. default: item in: type: string - description: A runtime expression used to get the collection to enumerate. + description: | + A runtime expression used to get the collection to enumerate. at: type: string - description: The name of the variable used to store the index of the current item being enumerated. + description: | + The name of the variable used to store the index of the current + item being enumerated. default: index - required: [ in ] + required: [in] while: type: string - description: A runtime expression that represents the condition, if any, that must be met for the iteration to continue. + description: | + A runtime expression that represents the condition, if any, that must + be met for the iteration to continue. do: - $ref: '#/$defs/task' - description: Allows workflows to iterate over a collection of items, executing a defined set of subtasks for each item in the collection. This task type is instrumental in handling scenarios such as batch processing, data transformation, and repetitive operations across datasets. - required: [ for, do ] + $ref: "#/$defs/task" + description: | + Allows workflows to iterate over a collection of items, executing a + defined set of subtasks for each item in the collection. This task type is + instrumental in handling scenarios such as batch processing, + data transformation, and repetitive operations across datasets. + required: [for, do] listenTask: type: object properties: @@ -374,11 +433,13 @@ $defs: type: object properties: to: - $ref: '#/$defs/eventConsumptionStrategy' + $ref: "#/$defs/eventConsumptionStrategy" description: Defines the event(s) to listen to. - required: [ to ] - required: [ listen ] - description: Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems. + required: [to] + required: [listen] + description: | + Provides a mechanism for workflows to await and react to external events, + enabling event-driven behavior within workflow systems. raiseTask: type: object properties: @@ -386,10 +447,10 @@ $defs: type: object properties: error: - $ref: '#/$defs/error' + $ref: "#/$defs/error" description: Defines the error to raise. - required: [ error ] - required: [ raise ] + required: [error] + required: [raise] description: Intentionally triggers and propagates errors. runTask: type: object @@ -406,7 +467,8 @@ $defs: description: The name of the container image to run. command: type: string - description: The command, if any, to execute on the container + description: | + The command, if any, to execute on the container ports: type: object description: The container's port mappings, if any. @@ -415,10 +477,14 @@ $defs: description: The container's volume mappings, if any. environment: type: object - description: A key/value mapping of the environment variables, if any, to use when running the configured process. - required: [ image ] - required: [ container ] - description: Enables the execution of external processes encapsulated within a containerized environment. + description: | + A key/value mapping of the environment variables, if any, + to use when running the configured process. + required: [image] + required: [container] + description: | + Enables the execution of external processes encapsulated within + a containerized environment. - properties: script: type: object @@ -429,21 +495,27 @@ $defs: environment: type: object additionalProperties: true - description: A key/value mapping of the environment variables, if any, to use when running the configured process. + description: | + A key/value mapping of the environment variables, if any, + to use when running the configured process. oneOf: - - properties: - code: - type: string - required: [ code ] - description: The script's code. - - properties: - source: - $ref: '#/$defs/externalResource' - description: The script's resource. - required: [ code ] - required: [ language ] - required: [ script ] - description: Enables the execution of custom scripts or code within a workflow, empowering workflows to perform specialized logic, data processing, or integration tasks by executing user-defined scripts written in various programming languages. + - properties: + code: + type: string + required: [code] + description: The script's code. + - properties: + source: + $ref: "#/$defs/externalResource" + description: The script's resource. + required: [code] + required: [language] + required: [script] + description: | + Enables the execution of custom scripts or code within a workflow, + empowering workflows to perform specialized logic, + data processing, or integration tasks by executing user-defined + scripts written in various programming languages. - properties: shell: type: object @@ -454,14 +526,22 @@ $defs: arguments: type: object additionalProperties: true - description: A list of the arguments of the shell command to run. + description: | + A list of the arguments of the shell command to run. environment: type: object additionalProperties: true - description: A key/value mapping of the environment variables, if any, to use when running the configured process. - required: [ command ] - required: [ shell ] - description: Enables the execution of shell commands within a workflow, enabling workflows to interact with the underlying operating system and perform system-level operations, such as file manipulation, environment configuration, or system administration tasks. + description: | + A key/value mapping of the environment variables, if any, + to use when running the configured process. + required: [command] + required: [shell] + description: | + Enables the execution of shell commands within a workflow, + enabling workflows to interact with the underlying + operating system and perform system-level operations, + such as file manipulation, environment configuration, + or system administration tasks. - properties: workflow: type: object @@ -475,16 +555,26 @@ $defs: version: type: string default: latest - description: The version of the workflow to run. Defaults to latest + description: | + The version of the workflow to run. Defaults to latest input: type: object additionalProperties: true - description: The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified. - required: [ namespace, name, version ] - required: [ workflow ] - description: Enables the invocation and execution of nested workflows within a parent workflow, facilitating modularization, reusability, and abstraction of complex logic or business processes by encapsulating them into standalone workflow units. - required: [ run ] - description: Provides the capability to execute external containers, shell commands, scripts, or workflows. + description: | + The data, if any, to pass as input to the workflow + to execute. The value should be validated against the + target workflow's input schema, if specified. + required: [namespace, name, version] + required: [workflow] + description: | + Enables the invocation and execution of nested workflows within + a parent workflow, facilitating modularization, reusability, + and abstraction of complex logic or business processes by + encapsulating them into standalone workflow units. + required: [run] + description: | + Provides the capability to execute external containers, shell commands, + scripts, or workflows. setTask: type: object properties: @@ -493,7 +583,7 @@ $defs: minProperties: 1 additionalProperties: true description: The data to set - required: [ set ] + required: [set] description: A task used to set data switchTask: type: object @@ -506,17 +596,22 @@ $defs: properties: when: type: string - description: A runtime expression used to determine whether or not the case matches. + description: | + A runtime expression used to determine whether or not the + case matches. then: - $ref: '#/$defs/flowDirective' + $ref: "#/$defs/flowDirective" description: The flow directive to execute when the case matches. - required: [ switch ] - description: Enables conditional branching within workflows, allowing them to dynamically select different paths based on specified conditions or criteria + required: [switch] + description: | + Enables conditional branching within workflows, allowing them to + dynamically select different paths based on specified conditions + or criteria tryTask: type: object properties: try: - $ref: '#/$defs/task' + $ref: "#/$defs/task" description: The task to perform. catch: type: object @@ -525,101 +620,120 @@ $defs: type: object as: type: string - description: The name of the runtime expression variable to save the error as. Defaults to 'error'. + default: error + description: | + The name of the runtime expression variable to save the error as. + Defaults to 'error'. when: type: string - description: A runtime expression used to determine whether or not to catch the filtered error + description: | + A runtime expression used to determine whether or not to catch + the filtered error exceptWhen: type: string - description: A runtime expression used to determine whether or not to catch the filtered error + description: | + A runtime expression used to determine whether or not to catch + the filtered error retry: - $ref: '#/$defs/retryPolicy' + $ref: "#/$defs/retryPolicy" description: The retry policy to use, if any, when catching errors. do: - $ref: '#/$defs/task' - description: The definition of the task to run when catching an error. - required: [ try, catch ] - description: Serves as a mechanism within workflows to handle errors gracefully, potentially retrying failed tasks before proceeding with alternate ones. + $ref: "#/$defs/task" + description: | + The definition of the task to run when catching an error. + required: [try, catch] + description: | + Serves as a mechanism within workflows to handle errors gracefully, + potentially retrying failed tasks before proceeding with alternate ones. waitTask: type: object properties: wait: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The amount of time to wait. - required: [ wait ] - description: Allows workflows to pause or delay their execution for a specified period of time. + required: [wait] + description: | + Allows workflows to pause or delay their execution for a specified period + of time. authenticationPolicy: type: object oneOf: - - properties: - basic: - type: object - properties: - username: - type: string - description: The username to use. - password: - type: string - description: The password to use. - required: [ username, password ] - required: [ basic ] - description: Use basic authentication. - - properties: - bearer: - type: object - properties: - token: - type: string - description: The bearer token to use. - required: [ token ] - required: [ bearer ] - description: Use bearer authentication. - - properties: - oauth2: - type: object - properties: - authority: - type: string - format: uri - description: The URI that references the OAuth2 authority to use. - grant: - type: string - description: The grant type to use. - client: - type: object - properties: - id: + - properties: + basic: + type: object + properties: + username: + type: string + description: The username to use. + password: + type: string + description: The password to use. + required: [username, password] + required: [basic] + description: Use basic authentication. + - properties: + bearer: + type: object + properties: + token: + type: string + description: The bearer token to use. + required: [token] + required: [bearer] + description: Use bearer authentication. + - properties: + oauth2: + type: object + properties: + authority: + type: string + format: uri + description: | + The URI that references the OAuth2 authority to use. + grant: + type: string + description: The grant type to use. + client: + type: object + properties: + id: + type: string + description: The client id to use. + secret: + type: string + description: The client secret to use, if any. + required: [id] + scopes: + type: array + items: type: string - description: The client id to use. - secret: + description: The scopes, if any, to request the token for. + audiences: + type: array + items: type: string - description: The client secret to use, if any. - required: [ id ] - scopes: - type: array - items: + description: The audiences, if any, to request the token for. + username: type: string - description: The scopes, if any, to request the token for. - audiences: - type: array - items: + description: | + The username to use. Used only if the grant type is Password. + password: type: string - description: The audiences, if any, to request the token for. - username: - type: string - description: The username to use. Used only if the grant type is Password. - password: - type: string - description: The password to use. Used only if the grant type is Password. - subject: - $ref: '#/$defs/oauth2Token' - description: The security token that represents the identity of the party on behalf of whom the request is being made. - actor: - $ref: '#/$defs/oauth2Token' - description: The security token that represents the identity of the acting party. - required: [ authority, grant, client ] - required: [ oauth2 ] - description: Use OAUTH2 authentication. + description: | + The password to use. Used only if the grant type is Password. + subject: + $ref: "#/$defs/oauth2Token" + description: | + The security token that represents the identity of the party + on behalf of whom the request is being made. + actor: + $ref: "#/$defs/oauth2Token" + description: | + The security token that represents the identity of the + acting party. + required: [authority, grant, client] + required: [oauth2] + description: Use OAUTH2 authentication. description: Defines an authentication policy. oauth2Token: type: object @@ -630,7 +744,7 @@ $defs: type: type: string description: The type of the security token to use to use. - required: [ token, type ] + required: [token, type] duration: type: object minProperties: 1 @@ -660,18 +774,23 @@ $defs: description: A URI reference that identifies the error type. status: type: integer - description: The status code generated by the origin for this occurrence of the error. + description: | + The status code generated by the origin for this occurrence + of the error. instance: type: string format: uri - description: A JSON Pointer used to reference the component the error originates from. + description: | + A JSON Pointer used to reference the component the error + originates from. title: type: string description: A short, human-readable summary of the error. detail: type: string - description: A human-readable explanation specific to this occurrence of the error. - required: [ type, status, instance ] + description: | + A human-readable explanation specific to this occurrence of the error. + required: [type, status, instance] endpoint: type: object properties: @@ -682,9 +801,9 @@ $defs: authentication: description: The authentication policy to use. oneOf: - - $ref: '#/$defs/authenticationPolicy' + - $ref: "#/$defs/authenticationPolicy" - type: string - required: [ uri ] + required: [uri] eventConsumptionStrategy: type: object oneOf: @@ -692,21 +811,21 @@ $defs: all: type: array items: - $ref: '#/$defs/eventFilter' + $ref: "#/$defs/eventFilter" description: A list containing all the events that must be consumed. - required: [ all ] + required: [all] - properties: any: type: array items: - $ref: '#/$defs/eventFilter' + $ref: "#/$defs/eventFilter" description: A list containing any of the events to consume. - required: [ any ] + required: [any] - properties: one: - $ref: '#/$defs/eventFilter' + $ref: "#/$defs/eventFilter" description: The single event to consume. - required: [ one ] + required: [one] eventFilter: type: object properties: @@ -719,21 +838,30 @@ $defs: description: The event's unique identifier source: type: string - description: Identifies the context in which an event happened + description: Identifies the context in which an event happened| + type: type: string - description: This attribute contains a value describing the type of event related to the originating occurrence. + description: | + This attribute contains a value describing the type of + event related to the originating occurrence. time: type: string subject: type: string datacontenttype: type: string - description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. + description: | + Content type of data value. This attribute enables data to + carry any type of content, whereby format and encoding might + differ from that of the chosen event format. dataschema: type: string additionalProperties: true - description: An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes. + description: | + An event filter is a mechanism used to selectively process or handle + events based on predefined criteria, such as event type, source, + or specific attributes. correlate: type: object additionalProperties: @@ -741,31 +869,58 @@ $defs: properties: from: type: string - description: A runtime expression used to extract the correlation value from the filtered event. + description: | + A runtime expression used to extract the correlation value from + the filtered event. expect: type: string - description: A constant or a runtime expression, if any, used to determine whether or not the extracted correlation value matches expectations. If not set, the first extracted value will be used as the correlation's expectation. - required: [ from ] - description: A correlation is a link between events and data, established by mapping event attributes to specific data attributes, allowing for coordinated processing or handling based on event characteristics. - required: [ with ] - description: An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes. + description: | + A constant or a runtime expression, if any, used to determine + whether or not the extracted correlation value + matches expectations. If not set, the first extracted value will + be used as the correlation's expectation. + required: [from] + description: | + A correlation is a link between events and data, established by + mapping event attributes to specific data attributes, + allowing for coordinated processing + or handling based on event characteristics. + required: [with] + description: | + An event filter is a mechanism used to selectively process or + handle events based on predefined criteria, such as event type, source, + or specific attributes. extension: type: object properties: extend: type: string - enum: [ call, composite, emit, for, listen, raise, run, set, switch, try, wait, all ] + enum: + - call + - composite + - emit + - for + - listen + - raise + - run + - set + - switch + - try + - wait + - all description: The type of task to extend. when: type: string - description: A runtime expression, if any, used to determine whether or not the extension should apply in the specified context. + description: | + A runtime expression, if any, used to determine whether or not the + extension should apply in the specified context. before: - $ref: '#/$defs/task' + $ref: "#/$defs/task" description: The task to execute before the extended task, if any. after: - $ref: '#/$defs/task' + $ref: "#/$defs/task" description: The task to execute after the extended task, if any. - required: [ extend ] + required: [extend] description: The definition of a an extension. externalResource: type: object @@ -777,65 +932,82 @@ $defs: authentication: description: The authentication policy to use. oneOf: - - $ref: '#/$defs/authenticationPolicy' + - $ref: "#/$defs/authenticationPolicy" - type: string name: type: string description: The external resource's name, if any. - required: [ uri ] + required: [uri] input: type: object properties: schema: - $ref: '#/$defs/schema' - description: The schema used to describe and validate the input of the workflow or task. + $ref: "#/$defs/schema" + description: | + The schema used to describe and validate the input of the workflow + or task. from: type: string - description: A runtime expression, if any, used to mutate and/or filter the input of the workflow or task. + description: | + A runtime expression, if any, used to mutate and/or filter the input + of the workflow or task. description: Configures the input of a workflow or task. output: type: object properties: schema: - $ref: '#/$defs/schema' - description: The schema used to describe and validate the output of the workflow or task. + $ref: "#/$defs/schema" + description: | + The schema used to describe and validate the output of the workflow + or task. from: type: string - description: A runtime expression, if any, used to mutate and/or filter the output of the workflow or task. + description: | + A runtime expression, if any, used to mutate and/or filter the output + of the workflow or task. to: type: string - description: A runtime expression, if any, used to output data to the current context. + description: | + A runtime expression, if any, used to output data to the + current context. description: Configures the output of a workflow or task. retryPolicy: type: object properties: when: type: string - description: A runtime expression, if any, used to determine whether or not to retry running the task, in a given context. + description: | + A runtime expression, if any, used to determine whether or not to + retry running the task, in a given context. exceptWhen: type: string - description: A runtime expression used to determine whether or not to retry running the task, in a given context. + description: | + A runtime expression used to determine whether or not to retry running + the task, in a given context. delay: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The duration to wait between retry attempts. backoff: type: object oneOf: - - properties: - constant: - type: object - description: The definition of the constant backoff to use, if any. - required: [ constant ] - - properties: - exponential: - type: object - description: The definition of the exponential backoff to use, if any. - required: [ exponential ] - - properties: - linear: - type: object - description: The definition of the linear backoff to use, if any. - required: [ linear ] + - properties: + constant: + type: object + description: | + The definition of the constant backoff to use, if any. + required: [constant] + - properties: + exponential: + type: object + description: | + The definition of the exponential backoff to use, if any. + required: [exponential] + - properties: + linear: + type: object + description: | + The definition of the linear backoff to use, if any. + required: [linear] description: The retry duration backoff. limit: type: object @@ -847,23 +1019,25 @@ $defs: type: integer description: The maximum amount of retry attempts, if any. duration: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The maximum duration for each retry attempt. duration: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The duration limit, if any, for all retry attempts. description: The retry limit, if any jitter: type: object properties: from: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The minimum duration of the jitter range to: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The maximum duration of the jitter range - required: [ from, to ] - description: The parameters, if any, that control the randomness or variability of the delay between retry attempts. + required: [from, to] + description: | + The parameters, if any, that control the randomness or variability of + the delay between retry attempts. description: Defines a retry policy. schema: type: object @@ -871,24 +1045,26 @@ $defs: format: type: string default: json - description: The schema's format. Defaults to 'json'. The (optional) version of the format can be set using `{format}:{version}`. + description: | + The schema's format. Defaults to 'json'. The (optional) version of the + format can be set using `{format}:{version}`. oneOf: - properties: document: description: The schema's inline definition. - required: [ document ] + required: [document] - properties: resource: - $ref: '#/$defs/externalResource' + $ref: "#/$defs/externalResource" description: The schema's external resource. - required: [ resource ] + required: [resource] description: Represents the definition of a schema. timeout: type: object properties: after: - $ref: '#/$defs/duration' + $ref: "#/$defs/duration" description: The duration after which to timeout. - required: [ after ] + required: [after] description: The definition of a timeout. -required: [ document, do ] \ No newline at end of file +required: [document, do]