diff --git a/dsl-reference.md b/dsl-reference.md index d36fded5..6533d1ec 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -788,7 +788,8 @@ Enables the execution of custom scripts or code within a workflow, empowering wo | 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 | +| arguments | `map` | `no` | A list of the arguments, if any, of the script to run | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process | ###### Examples @@ -803,8 +804,10 @@ do: run: script: language: js + arguments: + greetings: Hello, world! code: > - Some cool multiline script + console.log(greetings) ``` ##### Shell Process diff --git a/examples/run-script-with-arguments.yaml b/examples/run-script-with-arguments.yaml new file mode 100644 index 00000000..b8ce89fe --- /dev/null +++ b/examples/run-script-with-arguments.yaml @@ -0,0 +1,14 @@ +document: + dsl: 1.0.0-alpha1 + namespace: samples + name: run-script-with-arguments + version: 0.1.0 +do: + - log: + run: + script: + language: javascript + arguments: + message: ${ .message } + code: > + console.log(message) \ No newline at end of file diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 9783dc2b..3126165c 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -481,11 +481,16 @@ $defs: language: type: string description: The language of the script to run. + arguments: + title: ScriptArguments + type: object + additionalProperties: true + description: A key/value mapping of the arguments, if any, to use when running the configured script. environment: title: ScriptEnvironment 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 script process. oneOf: - title: ScriptInline properties: