Skip to content

Commit fbd77b0

Browse files
authored
Merge pull request #960 from neuroglia-io/feat-script-arguments
Add a new `arguments` property to the `script` process
2 parents 4e03cdb + a9ce22d commit fbd77b0

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

dsl-reference.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
788788
| language | `string` | `yes` | The language of the script to run |
789789
| code | `string` | `no` | The script's code.<br>*Required if `source` has not been set.* |
790790
| source | [externalResource](#external-resource) | `no` | The script's resource.<br>*Required if `code` has not been set.* |
791-
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process |
791+
| arguments | `map` | `no` | A list of the arguments, if any, of the script to run |
792+
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process |
792793

793794
###### Examples
794795

@@ -803,8 +804,10 @@ do:
803804
run:
804805
script:
805806
language: js
807+
arguments:
808+
greetings: Hello, world!
806809
code: >
807-
Some cool multiline script
810+
console.log(greetings)
808811
```
809812

810813
##### Shell Process
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
document:
2+
dsl: 1.0.0-alpha1
3+
namespace: samples
4+
name: run-script-with-arguments
5+
version: 0.1.0
6+
do:
7+
- log:
8+
run:
9+
script:
10+
language: javascript
11+
arguments:
12+
message: ${ .message }
13+
code: >
14+
console.log(message)

schema/workflow.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,16 @@ $defs:
481481
language:
482482
type: string
483483
description: The language of the script to run.
484+
arguments:
485+
title: ScriptArguments
486+
type: object
487+
additionalProperties: true
488+
description: A key/value mapping of the arguments, if any, to use when running the configured script.
484489
environment:
485490
title: ScriptEnvironment
486491
type: object
487492
additionalProperties: true
488-
description: A key/value mapping of the environment variables, if any, to use when running the configured process.
493+
description: A key/value mapping of the environment variables, if any, to use when running the configured script process.
489494
oneOf:
490495
- title: ScriptInline
491496
properties:

0 commit comments

Comments
 (0)