From ab724f5fda5888b04f74917adbe42460d8e55663 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:27:46 -0400 Subject: [PATCH 01/11] Update dsl-reference.md Signed-off-by: Amin Nikanjam Signed-off-by: amin-nikanjam --- dsl-reference.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index c5f463f5..2bd9cedb 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -15,6 +15,7 @@ + [HTTP](#http-call) + [OpenAPI](#openapi-call) + [A2A](#a2a-call) + + [MCP](#mcp-call) - [Do](#do) - [Emit](#emit) - [For](#for) @@ -322,6 +323,7 @@ Serverless Workflow defines several default functions that **MUST** be supported - [HTTP](#http-call) - [OpenAPI](#openapi-call) - [A2A](#a2a-call) +- [MCP](#mcp-call) ##### AsyncAPI Call @@ -527,6 +529,71 @@ do: text: Generate the Q1 sales report. ``` +##### MCP Call + +The [MCP Call](#mcp-call) enables workflows to interact with MCP servers that are used by AI agents (https://modelcontextprotocol.io/). + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| method | `string` | `yes` | The MCP JSON-RPC method to send.
*Supported values are: `initialize`, `notifications/initialized`, `prompts/list`, `prompts/get`, `notifications/prompts/list_changed`, `resources/list`, `resources/read`, `resources/templates/list`, `notifications/resources/list_changed`, `tools/list`, `tools/call`, `notifications/tools/list_changed`, `logging/setLevel`, and `notifications/message`* | +| server | `string`\|[`endpoint`](#endpoint) | `yes` | An URI, an object (for HTTP) or a filename (for STDIO) that describes the MCP server to call.
| +| parameters | `map`
`string` | `no` | The parameters for the MCP RPC method. For the `initialize` method, runtimes must set the `protocolVersion` parameter to the used version. Runtimes must implement the MCP specification version of 2025-06-18.
*Can be an object or a runtime expression.* | + +> [!NOTE] +> On success the output is the JSON-RPC result. On failure runtimes must raise an error with type [https://serverlessworkflow.io/spec/1.0.0/errors/runtime](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#standard-error-types). +> +> This call supports MCP over both HTTP and STDIO (communication over standard in and standard out) transport mechanisms. + +###### Examples + +This example shows an initialization phase as the first interaction between MCP client and server. The client sends its supported version, capabilities, and implementation information in the initialize request. The server MUST respond with its own capabilities and information including the supported version. + +```yaml +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: initialize + server: + endpoint: https://example.com/mcp + parameters: + protocolVersion: '2025-03-26' + capabilities: + roots: + listChanged: true + clientInfo: + name: 'ExampleClient' + version: '1.0.0' +``` + +The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. + +```yaml +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: prompts/get + server: + endpoint: https://example.com/mcp + parameters: + name: "code_review" + arguments: + code: "def hello():\n print('world')" +``` + #### Do Serves as a fundamental building block within workflows, enabling the sequential execution of multiple subtasks. By defining a series of subtasks to perform in sequence, the Do task facilitates the efficient execution of complex operations, ensuring that each subtask is completed before the next one begins. @@ -2706,4 +2773,4 @@ References a workflow definition. name: greet namespace: samples version: '0.1.0-rc2' -``` \ No newline at end of file +``` From 61251e3a6ae55d99af65df884398a078531f22c3 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Wed, 1 Oct 2025 15:33:47 -0400 Subject: [PATCH 02/11] Update workflow.yaml Signed-off-by: Amin Nikanjam Signed-off-by: amin-nikanjam --- schema/workflow.yaml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 1d3933bb..a82a34c1 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -473,6 +473,41 @@ $defs: description: The parameters object to send with the A2A method. required: [ method ] unevaluatedProperties: false + - title: CallMCP + description: Defines the MCP call to perform. + type: object + unevaluatedProperties: false + required: [ call, with ] + allOf: + - $ref: '#/$defs/taskBase' + - properties: + call: + type: string + const: mcp + with: + type: object + title: MCPArguments + description: The MCP call arguments. + properties: + server: + title: MCPServer + description: The MCP server endpoint (HTTP or STDIO) to send the request to. + $ref: '#/$defs/endpoint' + method: + type: string + title: WithMCPMethod + description: The MCP method to send. + enum: [ 'initialize', 'notifications/initialized', 'prompts/list', 'prompts/get', 'notifications/prompts/list_changed', 'resources/list', 'resources/read', 'resources/templates/list', 'notifications/resources/list_changed', 'tools/list', 'tools/call', 'notifications/tools/list_changed', 'logging/setLevel', 'notifications/message' ] + parameters: + oneOf: + - type: object + minProperties: 1 + additionalProperties: true + - type: string + title: WithMCPParameters + description: The parameters object to send with the MCP method. + required: [ method, server ] + unevaluatedProperties: false - title: CallFunction description: Defines the function call to perform. type: object @@ -484,7 +519,7 @@ $defs: call: type: string not: - enum: ["asyncapi", "grpc", "http", "openapi", "a2a"] + enum: ["asyncapi", "grpc", "http", "openapi", "a2a", "mcp"] description: The name of the function to call. with: type: object @@ -1823,4 +1858,4 @@ $defs: export: $ref: '#/$defs/export' title: SubscriptionIteratorExport - description: An object, if any, used to customize the content of the workflow context. \ No newline at end of file + description: An object, if any, used to customize the content of the workflow context. From 55ef0bb5723064bd87f107fe7e06ff27d51b70b1 Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Sun, 5 Oct 2025 22:08:10 -0400 Subject: [PATCH 03/11] Update dsl-reference.md Signed-off-by: Amin Signed-off-by: amin-nikanjam --- dsl-reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 2bd9cedb..032d9cfc 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -564,13 +564,13 @@ do: server: endpoint: https://example.com/mcp parameters: - protocolVersion: '2025-03-26' + protocolVersion: '2025-06-18' capabilities: roots: listChanged: true clientInfo: name: 'ExampleClient' - version: '1.0.0' + version: '0.1.0' ``` The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. From 4422553e728db2c68736c32b91ef9c9de38391cb Mon Sep 17 00:00:00 2001 From: Amin Date: Sun, 5 Oct 2025 22:48:03 -0400 Subject: [PATCH 04/11] Add MCP examples Signed-off-by: Amin Signed-off-by: amin-nikanjam --- examples/call-mcp-1.yaml | 20 ++++++++++++++++++++ examples/call-mcp-2.yaml | 16 ++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 examples/call-mcp-1.yaml create mode 100644 examples/call-mcp-2.yaml diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml new file mode 100644 index 00000000..0f710bad --- /dev/null +++ b/examples/call-mcp-1.yaml @@ -0,0 +1,20 @@ +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: initialize + server: + endpoint: https://example.com/mcp + parameters: + protocolVersion: '2025-06-18' + capabilities: + roots: + listChanged: true + clientInfo: + name: 'ExampleClient' + version: '0.1.0' \ No newline at end of file diff --git a/examples/call-mcp-2.yaml b/examples/call-mcp-2.yaml new file mode 100644 index 00000000..4cddc899 --- /dev/null +++ b/examples/call-mcp-2.yaml @@ -0,0 +1,16 @@ +document: + dsl: '1.0.1' + namespace: test + name: mcp-example + version: '0.1.0' +do: + - GenerateReport: + call: mcp + with: + method: prompts/get + server: + endpoint: https://example.com/mcp + parameters: + name: "code_review" + arguments: + code: "def hello():\n print('world')" \ No newline at end of file From 768c2b908f6c2a1531d26fb30a8dce99d45022de Mon Sep 17 00:00:00 2001 From: amin-nikanjam <73068118+amin-nikanjam@users.noreply.github.com> Date: Mon, 6 Oct 2025 09:06:13 -0400 Subject: [PATCH 05/11] Create amin-test.yaml Signed-off-by: amin-nikanjam --- .github/workflows/amin-test.yaml | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/amin-test.yaml diff --git a/.github/workflows/amin-test.yaml b/.github/workflows/amin-test.yaml new file mode 100644 index 00000000..bf7c3556 --- /dev/null +++ b/.github/workflows/amin-test.yaml @@ -0,0 +1,45 @@ +# Copyright 2023 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 triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# 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: workflow_dispatch + +jobs: + build: + defaults: + run: + working-directory: .ci/validation/ + runs-on: ubuntu-latest + strategy: + matrix: + 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 From ad442f38c649f73e0e205be6fc1e5c53168e9922 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Mon, 6 Oct 2025 09:16:31 -0400 Subject: [PATCH 06/11] Revert "Create amin-test.yaml" This reverts commit 2d7f2a92483404d8837fb9c9f7b13b016f0dcf5d. Signed-off-by: amin-nikanjam --- .github/workflows/amin-test.yaml | 45 -------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/amin-test.yaml diff --git a/.github/workflows/amin-test.yaml b/.github/workflows/amin-test.yaml deleted file mode 100644 index bf7c3556..00000000 --- a/.github/workflows/amin-test.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2023 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 triage pull requests and apply a label based on the -# paths that are modified in the pull request. -# -# 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: workflow_dispatch - -jobs: - build: - defaults: - run: - working-directory: .ci/validation/ - runs-on: ubuntu-latest - strategy: - matrix: - 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 From 67955f4beca0b8b4c9c4fdb42f3580273b580f03 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Wed, 15 Oct 2025 14:19:14 -0400 Subject: [PATCH 07/11] Updating MCP examples to fix the bug in CI Signed-off-by: amin-nikanjam --- dsl-reference.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 032d9cfc..98567879 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -567,10 +567,7 @@ do: protocolVersion: '2025-06-18' capabilities: roots: - listChanged: true - clientInfo: - name: 'ExampleClient' - version: '0.1.0' + listChanged: true ``` The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. From c169fecede3be1d2e2885104749439793bb51fd0 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Wed, 15 Oct 2025 14:19:51 -0400 Subject: [PATCH 08/11] Update call-mcp-1.yaml Signed-off-by: amin-nikanjam --- examples/call-mcp-1.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml index 0f710bad..67b65d1f 100644 --- a/examples/call-mcp-1.yaml +++ b/examples/call-mcp-1.yaml @@ -14,7 +14,4 @@ do: protocolVersion: '2025-06-18' capabilities: roots: - listChanged: true - clientInfo: - name: 'ExampleClient' - version: '0.1.0' \ No newline at end of file + listChanged: true \ No newline at end of file From 5c913a5ba46ec85680b3df342c12c084c3eb3eb3 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Sat, 25 Oct 2025 11:42:15 -0400 Subject: [PATCH 09/11] Minor fixes Minor update fix the CI error Signed-off-by: amin-nikanjam --- dsl-reference.md | 7 ++----- examples/call-mcp-1.yaml | 7 ++----- examples/call-mcp-2.yaml | 2 +- schema/workflow.yaml | 4 ++-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 98567879..8558edc9 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -554,7 +554,7 @@ This example shows an initialization phase as the first interaction between MCP document: dsl: '1.0.1' namespace: test - name: mcp-example + name: mcp-example-1 version: '0.1.0' do: - GenerateReport: @@ -565,9 +565,6 @@ do: endpoint: https://example.com/mcp parameters: protocolVersion: '2025-06-18' - capabilities: - roots: - listChanged: true ``` The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server. @@ -576,7 +573,7 @@ The following example showcases a prompts/list request by the client to retrieve document: dsl: '1.0.1' namespace: test - name: mcp-example + name: mcp-example-2 version: '0.1.0' do: - GenerateReport: diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml index 67b65d1f..f5865b9d 100644 --- a/examples/call-mcp-1.yaml +++ b/examples/call-mcp-1.yaml @@ -1,7 +1,7 @@ document: dsl: '1.0.1' namespace: test - name: mcp-example + name: mcp-example-1 version: '0.1.0' do: - GenerateReport: @@ -11,7 +11,4 @@ do: server: endpoint: https://example.com/mcp parameters: - protocolVersion: '2025-06-18' - capabilities: - roots: - listChanged: true \ No newline at end of file + protocolVersion: '2025-06-18' \ No newline at end of file diff --git a/examples/call-mcp-2.yaml b/examples/call-mcp-2.yaml index 4cddc899..09c67957 100644 --- a/examples/call-mcp-2.yaml +++ b/examples/call-mcp-2.yaml @@ -1,7 +1,7 @@ document: dsl: '1.0.1' namespace: test - name: mcp-example + name: mcp-example-1 version: '0.1.0' do: - GenerateReport: diff --git a/schema/workflow.yaml b/schema/workflow.yaml index a82a34c1..ecbf1372 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -506,8 +506,8 @@ $defs: - type: string title: WithMCPParameters description: The parameters object to send with the MCP method. - required: [ method, server ] - unevaluatedProperties: false + required: [ server, method ] + unevaluatedProperties: false - title: CallFunction description: Defines the function call to perform. type: object From c83bf6743f9d196584bac3a2f66ddba6fa02098f Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Tue, 21 Oct 2025 21:13:59 +0200 Subject: [PATCH 10/11] [Fix #1119] Allowing runtime xpression for duration (#1120) Signed-off-by: fjtirado Signed-off-by: amin-nikanjam --- dsl-reference.md | 2 +- schema/workflow.yaml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 8558edc9..8a08bf53 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -2358,7 +2358,7 @@ timeout: ### Duration -Defines a duration. +Defines a duration. Durations can be defined through properties, with an ISO 8601 string or with a runtime expression that is evaluated to an ISO 8601 string #### Properties diff --git a/schema/workflow.yaml b/schema/workflow.yaml index ecbf1372..cfad4e00 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -1250,10 +1250,13 @@ $defs: description: Number of milliseconds, if any. title: DurationInline description: The inline definition of a duration. + - $ref: '#/$defs/runtimeExpression' + title: DurationExpression + description: Runtime expression that generates an ISO 8601 - type: string pattern: '^P(?!$)(\d+(?:\.\d+)?Y)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?W)?(\d+(?:\.\d+)?D)?(T(?=\d)(\d+(?:\.\d+)?H)?(\d+(?:\.\d+)?M)?(\d+(?:\.\d+)?S)?)?$' - title: DurationExpression - description: The ISO 8601 expression of a duration. + title: DurationLiteral + description: The Literal ISO 8601 representation of a duration. error: type: object title: Error From de34e152434dc1e49727de7bafe7ae8beb36dd98 Mon Sep 17 00:00:00 2001 From: amin-nikanjam Date: Tue, 28 Oct 2025 16:15:08 -0400 Subject: [PATCH 11/11] Fixes do in the workflow for MCP examples Signed-off-by: amin-nikanjam --- dsl-reference.md | 4 ++-- examples/call-mcp-1.yaml | 2 +- examples/call-mcp-2.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 8a08bf53..5c365163 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -557,7 +557,7 @@ document: name: mcp-example-1 version: '0.1.0' do: - - GenerateReport: + - initializeMCP: call: mcp with: method: initialize @@ -576,7 +576,7 @@ document: name: mcp-example-2 version: '0.1.0' do: - - GenerateReport: + - getPrompts: call: mcp with: method: prompts/get diff --git a/examples/call-mcp-1.yaml b/examples/call-mcp-1.yaml index f5865b9d..0640fc4e 100644 --- a/examples/call-mcp-1.yaml +++ b/examples/call-mcp-1.yaml @@ -4,7 +4,7 @@ document: name: mcp-example-1 version: '0.1.0' do: - - GenerateReport: + - initializeMCP: call: mcp with: method: initialize diff --git a/examples/call-mcp-2.yaml b/examples/call-mcp-2.yaml index 09c67957..9d7ef0ae 100644 --- a/examples/call-mcp-2.yaml +++ b/examples/call-mcp-2.yaml @@ -4,7 +4,7 @@ document: name: mcp-example-1 version: '0.1.0' do: - - GenerateReport: + - getPrompts: call: mcp with: method: prompts/get