You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dsl-reference.md
+46-14Lines changed: 46 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -896,7 +896,7 @@ do:
896
896
- runScript:
897
897
run:
898
898
script:
899
-
language: js
899
+
language: javascript
900
900
code: >
901
901
Some cool multiline script
902
902
@@ -928,6 +928,8 @@ Enables the execution of external processes encapsulated within a containerized
928
928
| ports | `map` | `no` | The container's port mappings, if any |
929
929
| volumes | `map` | `no` | The container's volume mappings, if any |
930
930
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process |
931
+
| stdin | `string` | `no` | A runtime expression, if any, passed as standard input to the command or default container CMD|
932
+
| arguments | `string[]` | `no` | A list of the arguments, if any, passed as argv to the command or default container CMD |
931
933
| lifetime | [`containerLifetime`](#container-lifetime) | `no` | An object used to configure the container's lifetime. |
932
934
933
935
###### Examples
@@ -939,10 +941,23 @@ document:
939
941
name: run-container-example
940
942
version: '0.1.0'
941
943
do:
944
+
- setInput:
945
+
set:
946
+
message: Hello World
942
947
- runContainer:
948
+
input:
949
+
from: ${ .message }
943
950
run:
944
951
container:
945
-
image: fake-image
952
+
image: alpine
953
+
stdin: ${ . }
954
+
command: |
955
+
input=$(cat)
956
+
echo "STDIN was: $input"
957
+
echo "ARGS are $1 $2"
958
+
arguments:
959
+
- Foo
960
+
- Bar
946
961
```
947
962
948
963
> [!NOTE]
@@ -961,9 +976,11 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
961
976
| language | `string` | `yes` | The language of the script to run.<br>*Supported values are: [`js`](https://tc39.es/ecma262/2024/) and [`python`](https://www.python.org/downloads/release/python-3131/).* |
962
977
| code | `string` | `no` | The script's code.<br>*Required if `source` has not been set.* |
963
978
| source | [externalResource](#external-resource) | `no` | The script's resource.<br>*Required if `code` has not been set.* |
964
-
| arguments | `map` | `no` | A list of the arguments, if any, of the script to run |
979
+
| stdin | `string` | `no` | A runtime expression, if any, to the script as standard input (stdin).|
980
+
| arguments | `string[]` | `no` | A list of the arguments, if any, to the script as argv |
965
981
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process |
966
982
983
+
967
984
> [!WARNING]
968
985
> To ensure cross-compatibility, Serverless Workflow strictly limits the versions of supported scripting languages. These versions may evolve with future releases. If you wish to use a different version of a language, you may do so by utilizing the [`container process`](#container-process).
969
986
@@ -977,19 +994,21 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
977
994
978
995
```yaml
979
996
document:
980
-
dsl: '1.0.2'
981
-
namespace: test
997
+
dsl: 1.0.2
998
+
namespace: examples
982
999
name: run-script-example
983
-
version: '0.1.0'
1000
+
version: 1.0.0
984
1001
do:
985
1002
- runScript:
986
1003
run:
987
1004
script:
988
-
language: js
1005
+
language: javascript
989
1006
arguments:
990
-
greetings: Hello, world!
991
-
code: >
992
-
console.log(greetings)
1007
+
- hello
1008
+
- world
1009
+
code: |
1010
+
const [_, __, arg0, arg1] = process.argv;
1011
+
console.log('arg > ', arg0, arg1)
993
1012
```
994
1013
995
1014
##### Shell Process
@@ -1001,7 +1020,8 @@ Enables the execution of shell commands within a workflow, enabling workflows to
1001
1020
| Name | Type | Required | Description |
1002
1021
|:--|:---:|:---:|:---|
1003
1022
| command | `string` | `yes` | The shell command to run |
1004
-
| arguments | `map` | `no` | A list of the arguments of the shell command to run |
1023
+
| stdin | `string` | `no` | A runtime expression, if any, to the shell command as standard input (stdin).|
1024
+
| arguments | `string[]` | `no` | A list of the arguments, if any, to the shell command as argv |
1005
1025
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process |
1006
1026
1007
1027
###### Examples
@@ -1013,10 +1033,22 @@ document:
1013
1033
name: run-shell-example
1014
1034
version: '0.1.0'
1015
1035
do:
1036
+
- setInput:
1037
+
set:
1038
+
message: Hello World
1016
1039
- runShell:
1040
+
input:
1041
+
from: ${ .message }
1017
1042
run:
1018
1043
shell:
1019
-
command: 'echo "Hello, ${ .user.name }"'
1044
+
stdin: ${ . }
1045
+
command: |
1046
+
input=$(cat)
1047
+
echo "STDIN was: $input"
1048
+
echo "ARGS are $1 $2"
1049
+
arguments:
1050
+
- Foo
1051
+
- Bar
1020
1052
```
1021
1053
1022
1054
##### Workflow Process
@@ -2493,7 +2525,7 @@ do:
2493
2525
- runScript:
2494
2526
run:
2495
2527
script:
2496
-
language: js
2528
+
language: javascript
2497
2529
code: >
2498
2530
Some cool multiline script
2499
2531
return: code
@@ -2829,4 +2861,4 @@ Describes the client of a [Model Context Protocol (MCP)](https://modelcontextpro
0 commit comments