From 572cffcf99ea29201345e13c08a3e91b78bc8c24 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Fri, 29 May 2026 09:45:40 +0100 Subject: [PATCH 01/14] feat: add use cases section to storybook with workflow examples Signed-off-by: Cheryl Kong --- .../.storybook/preview.tsx | 6 ++ .../stories/use-cases/Overview.mdx | 29 ++++++++++ .../stories/use-cases/UseCases.stories.tsx | 57 +++++++++++++++++++ .../stories/use-cases/index.ts | 19 +++++++ .../workflows/accumulate-room-readings.yaml | 44 ++++++++++++++ .../workflows/authentication-oauth2.yaml | 22 +++++++ .../workflows/authentication-reusable.yaml | 19 +++++++ 7 files changed, 196 insertions(+) create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml diff --git a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx index 8d6107d8..22e1e905 100644 --- a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx +++ b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx @@ -36,6 +36,12 @@ const preview: Preview = { // 'off' - skip a11y checks entirely test: "todo", }, + + options: { + storySort: { + order: ["Introduction", "Features", "Use Cases"], + }, + }, }, globalTypes: { diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx b/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx new file mode 100644 index 00000000..d1bbf29e --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx @@ -0,0 +1,29 @@ +{/* + * Copyright 2021-Present 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. + */} + +import { Meta } from "@storybook/addon-docs/blocks"; + + + +# Use Cases + +This section showcases workflow examples from the [Serverless Workflow Specification](https://github.com/serverlessworkflow/specification/tree/main/examples). + +Each example demonstrates different workflow patterns and capabilities supported by the diagram editor. + +## Available Examples + +Browse through the examples in the sidebar to see how different workflow patterns are visualized. diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx new file mode 100644 index 00000000..27df7090 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -0,0 +1,57 @@ +/* + * Copyright 2021-Present 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. + */ + +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { DiagramEditor } from "../features/DiagramEditor"; +import * as workflows from "./index"; + +const meta = { + title: "Use Cases", + component: DiagramEditor, + parameters: { + layout: "fullscreen", + }, + render: (args, { globals }) => { + return ; + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const AccumulateRoomReadings: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.accumulateRoomReadings, + }, +}; + +export const AuthenticationOAuth2: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.authenticationOAuth2, + }, +}; + +export const AuthenticationReusable: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.authenticationReusable, + }, +}; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts new file mode 100644 index 00000000..17c58fb5 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright 2021-Present 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. + */ + +export { default as accumulateRoomReadings } from "./workflows/accumulate-room-readings.yaml?raw"; +export { default as authenticationOAuth2 } from "./workflows/authentication-oauth2.yaml?raw"; +export { default as authenticationReusable } from "./workflows/authentication-reusable.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml new file mode 100644 index 00000000..154da9f4 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml @@ -0,0 +1,44 @@ +document: + dsl: "1.0.3" + namespace: examples + name: accumulate-room-readings + version: "0.1.0" +do: + - consumeReading: + listen: + to: + all: + - with: + source: https://my.home.com/sensor + type: my.home.sensors.temperature + correlate: + roomId: + from: .roomid + - with: + source: https://my.home.com/sensor + type: my.home.sensors.humidity + correlate: + roomId: + from: .roomid + output: + as: .data.reading + - logReading: + for: + each: reading + in: .readings + do: + - callOrderService: + call: openapi + with: + document: + endpoint: http://myorg.io/ordersservices.json + operationId: logreading + - generateReport: + call: openapi + with: + document: + endpoint: http://myorg.io/ordersservices.json + operationId: produceReport +timeout: + after: + hours: 1 diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml new file mode 100644 index 00000000..96bedce1 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml @@ -0,0 +1,22 @@ +document: + dsl: "1.0.3" + namespace: examples + name: oauth2-authentication + version: "0.1.0" +do: + - getPet: + call: http + with: + method: get + endpoint: + uri: https://petstore.swagger.io/v2/pet/{petId} + authentication: + oauth2: + authority: http://keycloak/realms/fake-authority + endpoints: #optional + token: /auth/token #defaults to /oauth2/token + introspection: /auth/introspect #defaults to /oauth2/introspect + grant: client_credentials + client: + id: workflow-runtime-id + secret: workflow-runtime-secret diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml new file mode 100644 index 00000000..68b203c0 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml @@ -0,0 +1,19 @@ +document: + dsl: "1.0.3" + namespace: examples + name: bearer-auth + version: "0.1.0" +use: + authentications: + petStoreAuth: + bearer: + token: ${ .token } +do: + - getPet: + call: http + with: + method: get + endpoint: + uri: https://petstore.swagger.io/v2/pet/{petId} + authentication: + use: petStoreAuth From c54355b592dccb588c3f75812b2a68cb28c7506d Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Fri, 29 May 2026 11:03:17 +0100 Subject: [PATCH 02/14] feat: add more workflow examples Signed-off-by: Cheryl Kong --- .../stories/use-cases/UseCases.stories.tsx | 40 +++++++++++++++++++ .../stories/use-cases/index.ts | 5 +++ .../workflows/call-asyncapi-publish.yaml | 20 ++++++++++ ...api-subscribe-consume-forever-foreach.yaml | 27 +++++++++++++ .../call-custom-function-cataloged.yaml | 13 ++++++ .../call-custom-function-inline.yaml | 25 ++++++++++++ .../use-cases/workflows/call-grpc.yaml | 18 +++++++++ 7 files changed, 148 insertions(+) create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx index 27df7090..1b2d1e81 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -55,3 +55,43 @@ export const AuthenticationReusable: Story = { content: workflows.authenticationReusable, }, }; + +export const CallAsyncAPIPublish: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callAsyncAPIPublish, + }, +}; + +export const CallAsyncAPISubscribe: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callAsyncAPISubscribe, + }, +}; + +export const CallCustomFunctionCataloged: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callCustomFunctionCataloged, + }, +}; + +export const CallCustomFunctionInline: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callCustomFunctionInline, + }, +}; + +export const CallGrpc: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callGrpc, + }, +}; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts index 17c58fb5..768f866a 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts @@ -17,3 +17,8 @@ export { default as accumulateRoomReadings } from "./workflows/accumulate-room-readings.yaml?raw"; export { default as authenticationOAuth2 } from "./workflows/authentication-oauth2.yaml?raw"; export { default as authenticationReusable } from "./workflows/authentication-reusable.yaml?raw"; +export { default as callAsyncAPIPublish } from "./workflows/call-asyncapi-publish.yaml?raw"; +export { default as callAsyncAPISubscribe } from "./workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml?raw"; +export { default as callCustomFunctionCataloged } from "./workflows/call-custom-function-cataloged.yaml?raw"; +export { default as callCustomFunctionInline } from "./workflows/call-custom-function-inline.yaml?raw"; +export { default as callGrpc } from "./workflows/call-grpc.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml new file mode 100644 index 00000000..38344c01 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml @@ -0,0 +1,20 @@ +document: + dsl: "1.0.3" + namespace: examples + name: bearer-auth + version: "0.1.0" +do: + - findPet: + call: asyncapi + with: + document: + endpoint: https://fake.com/docs/asyncapi.json + operation: findPetsByStatus + server: + name: staging + message: + payload: + petId: ${ .pet.id } + authentication: + bearer: + token: ${ .token } diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml new file mode 100644 index 00000000..71663aaf --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml @@ -0,0 +1,27 @@ +document: + dsl: "1.0.3" + namespace: examples + name: bearer-auth + version: "0.1.0" +do: + - getNotifications: + call: asyncapi + with: + document: + endpoint: https://fake.com/docs/asyncapi.json + operation: getNotifications + subscription: + filter: "${ .correlationId == $context.userId and .payload.from.firstName == $context.contact.firstName and .payload.from.lastName == $context.contact.lastName }" + consume: + while: "${ true }" + foreach: + item: message + do: + - publishCloudEvent: + emit: + event: + with: + source: https://serverlessworkflow.io/samples + type: io.serverlessworkflow.samples.asyncapi.message.consumed.v1 + data: + message: "${ $message }" diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml new file mode 100644 index 00000000..ea5d21b0 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml @@ -0,0 +1,13 @@ +document: + dsl: "1.0.3" + namespace: samples + name: call-custom-function-cataloged + version: "0.1.0" +do: + - log: + call: https://raw.githubusercontent.com/serverlessworkflow/catalog/main/functions/log/1.0.0/function.yaml + with: + message: Hello, world! + level: information + timestamp: true + format: "{TIMESTAMP} [{LEVEL}] ({CONTEXT}): {MESSAGE}" diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml new file mode 100644 index 00000000..0b7334cb --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml @@ -0,0 +1,25 @@ +document: + dsl: "1.0.3" + namespace: samples + name: call-custom-function-inline + version: "0.1.0" +use: + functions: + getPetById: + input: + schema: + document: + type: object + properties: + petId: + type: integer + required: [petId] + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} +do: + - getPet: + call: getPetById + with: + petId: 69 diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml new file mode 100644 index 00000000..b2565bbb --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml @@ -0,0 +1,18 @@ +document: + dsl: "1.0.3" + namespace: test + name: grpc-example + version: "0.1.0" +do: + - greet: + call: grpc + with: + proto: + endpoint: file://app/greet.proto + service: + name: GreeterApi.Greeter + host: localhost + port: 5011 + method: SayHello + arguments: + name: ${ .user.preferredDisplayName } From 1a84e3eec195dfb30443b9800d8a8013e64ac79d Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Fri, 29 May 2026 14:01:27 +0100 Subject: [PATCH 03/14] feat: add more workflow examples Signed-off-by: Cheryl Kong --- .../stories/use-cases/UseCases.stories.tsx | 48 +++++++++++++++++++ .../stories/use-cases/index.ts | 6 +++ .../call-http-query-headers-expressions.yaml | 30 ++++++++++++ .../stories/use-cases/workflows/call-mcp.yaml | 23 +++++++++ .../use-cases/workflows/call-openapi.yaml | 14 ++++++ .../use-cases/workflows/conditional-task.yaml | 22 +++++++++ .../use-cases/workflows/do-multiple.yaml | 17 +++++++ .../use-cases/workflows/do-single.yaml | 11 +++++ 8 files changed, 171 insertions(+) create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx index 1b2d1e81..b8fb497f 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -95,3 +95,51 @@ export const CallGrpc: Story = { content: workflows.callGrpc, }, }; + +export const CallHttpQueryHeadersExpression: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callHttpQueryHeadersExpressions, + }, +}; + +export const CallMCP: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callMCP, + }, +}; + +export const CallOpenAPI: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.callOpenApi, + }, +}; + +export const ConditionalTask: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.conditionalTask, + }, +}; + +export const DoMultiple: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.doMultiple, + }, +}; + +export const DoSingle: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.doSingle, + }, +}; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts index 768f866a..93184632 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts @@ -22,3 +22,9 @@ export { default as callAsyncAPISubscribe } from "./workflows/call-asyncapi-subs export { default as callCustomFunctionCataloged } from "./workflows/call-custom-function-cataloged.yaml?raw"; export { default as callCustomFunctionInline } from "./workflows/call-custom-function-inline.yaml?raw"; export { default as callGrpc } from "./workflows/call-grpc.yaml?raw"; +export { default as callHttpQueryHeadersExpressions } from "./workflows/call-http-query-headers-expressions.yaml?raw"; +export { default as callMCP } from "./workflows/call-mcp.yaml?raw"; +export { default as callOpenApi } from "./workflows/call-openapi.yaml?raw"; +export { default as conditionalTask } from "./workflows/conditional-task.yaml?raw"; +export { default as doMultiple } from "./workflows/do-multiple.yaml?raw"; +export { default as doSingle } from "./workflows/do-single.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml new file mode 100644 index 00000000..fee0d860 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=../schema/workflow.yaml +document: + dsl: "1.0.3" + namespace: examples + name: http-query-headers-expressions + version: "1.0.0" +input: + schema: + format: json + document: + type: object + required: + - searchQuery + properties: + searchQuery: + type: string +do: + - setQueryAndHeaders: + set: + query: + search: ${.searchQuery} + headers: + Accept: application/json + - searchStarWarsCharacters: + call: http + with: + method: get + endpoint: https://swapi.dev/api/people/ + headers: ${.headers} + query: ${.query} diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml new file mode 100644 index 00000000..56fd4fae --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml @@ -0,0 +1,23 @@ +document: + dsl: "1.0.3" + namespace: test + name: mcp-example + version: "0.1.0" +do: + - publishMessageToSlack: + call: mcp + with: + method: tools/call + parameters: + name: conversations_add_message + arguments: + channel_id: "C1234567890" + thread_ts: "1623456789.123456" + payload: "Hello, world! :wave:" + content_type: text/markdown + transport: + stdio: + command: npx + arguments: [slack-mcp-serverr@latest, --transport, stdio] + environment: + SLACK_MCP_XOXP_TOKEN: xoxp-xv6Cv3jKqNW8esm5YnsftKwIzoQHUzAP diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml new file mode 100644 index 00000000..4812592c --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml @@ -0,0 +1,14 @@ +document: + dsl: "1.0.3" + namespace: test + name: openapi-example + version: "0.1.0" +do: + - findPet: + call: openapi + with: + document: + endpoint: https://petstore.swagger.io/v2/swagger.json + operationId: findPetsByStatus + parameters: + status: available diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml new file mode 100644 index 00000000..746edaab --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml @@ -0,0 +1,22 @@ +document: + dsl: "1.0.3" + namespace: default + name: conditional-task + version: "0.1.0" +do: + - raiseErrorIfUnderage: + if: .customer.age < 18 + raise: + error: + type: https://superbet-casinos.com/customer/access-forbidden + status: 400 + title: Access Forbidden + then: end + - placeBet: + call: http + with: + method: post + endpoint: https://superbet-casinos.com/api/bet/on/football + body: + customer: .customer + bet: .bet diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml new file mode 100644 index 00000000..a6bc4bf2 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml @@ -0,0 +1,17 @@ +document: + dsl: "1.0.3" + namespace: examples + name: call-http-shorthand-endpoint + version: "0.1.0" +do: + - getPet: + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} + - buyPet: + call: http + with: + method: put + endpoint: https://petstore.swagger.io/v2/pet/{petId} + body: '${ . + { status: "sold" } }' diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml new file mode 100644 index 00000000..7b10fae9 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml @@ -0,0 +1,11 @@ +document: + dsl: "1.0.3" + namespace: examples + name: call-http-shorthand-endpoint + version: "0.1.0" +do: + - getPet: + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} From 742e16c6f33f0a704fb80c8e152506fe513bdb99 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Tue, 2 Jun 2026 11:00:00 +0100 Subject: [PATCH 04/14] refactor: rename use-cases to examples and add workflow stories Signed-off-by: Cheryl Kong --- .../stories/README.md | 2 +- .../Examples.stories.tsx} | 50 ++++++++++++++++++- .../{use-cases => examples}/Overview.mdx | 4 +- .../stories/{use-cases => examples}/index.ts | 6 +++ .../workflows/accumulate-room-readings.yaml | 0 .../workflows/authentication-oauth2.yaml | 0 .../workflows/authentication-reusable.yaml | 0 .../workflows/call-asyncapi-publish.yaml | 0 ...api-subscribe-consume-forever-foreach.yaml | 0 .../call-custom-function-cataloged.yaml | 0 .../call-custom-function-inline.yaml | 0 .../workflows/call-grpc.yaml | 0 .../call-http-query-headers-expressions.yaml | 0 .../workflows/call-mcp.yaml | 0 .../workflows/call-openapi.yaml | 0 .../workflows/conditional-task.yaml | 0 .../workflows/do-multiple.yaml | 0 .../workflows/do-single.yaml | 0 .../stories/examples/workflows/emit.yaml | 19 +++++++ .../stories/examples/workflows/for.yaml | 21 ++++++++ .../stories/examples/workflows/fork.yaml | 26 ++++++++++ .../examples/workflows/listen-to-all.yaml | 16 ++++++ .../listen-to-any-forever-foreach.yaml | 22 ++++++++ .../examples/workflows/listen-to-one.yaml | 18 +++++++ 24 files changed, 180 insertions(+), 4 deletions(-) rename packages/serverless-workflow-diagram-editor/stories/{use-cases/UseCases.stories.tsx => examples/Examples.stories.tsx} (79%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/Overview.mdx (95%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/index.ts (81%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/accumulate-room-readings.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/authentication-oauth2.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/authentication-reusable.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-asyncapi-publish.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-custom-function-cataloged.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-custom-function-inline.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-grpc.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-http-query-headers-expressions.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-mcp.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/call-openapi.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/conditional-task.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/do-multiple.yaml (100%) rename packages/serverless-workflow-diagram-editor/stories/{use-cases => examples}/workflows/do-single.yaml (100%) create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/README.md b/packages/serverless-workflow-diagram-editor/stories/README.md index dc1bd9f9..ce691255 100644 --- a/packages/serverless-workflow-diagram-editor/stories/README.md +++ b/packages/serverless-workflow-diagram-editor/stories/README.md @@ -22,7 +22,7 @@ This directory contains Storybook stories and documentation. - **`introduction/`** - Introductory documentation and welcome pages - **`features/`** - Component features and interactive stories -- **`use-cases/`** - Real-world use case examples +- **`examples/`** - Real-world workflow examples - **`assets/`** - Images and media files used in stories ## Running Storybook diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx similarity index 79% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx rename to packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index b8fb497f..336ee314 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -19,7 +19,7 @@ import { DiagramEditor } from "../features/DiagramEditor"; import * as workflows from "./index"; const meta = { - title: "Use Cases", + title: "Examples", component: DiagramEditor, parameters: { layout: "fullscreen", @@ -143,3 +143,51 @@ export const DoSingle: Story = { content: workflows.doSingle, }, }; + +export const Emit: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.emit, + }, +}; + +export const For: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.for, + }, +}; + +export const Fork: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.fork, + }, +}; + +export const ListenToAll: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.listenToAll, + }, +}; + +export const ListenToOne: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.listenToOne, + }, +}; + +export const ListenToAnyForeverForeach: Story = { + args: { + isReadOnly: true, + locale: "en", + content: workflows.listenToAnyForeverForeach, + }, +}; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx b/packages/serverless-workflow-diagram-editor/stories/examples/Overview.mdx similarity index 95% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx rename to packages/serverless-workflow-diagram-editor/stories/examples/Overview.mdx index d1bbf29e..bb2bf29b 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Overview.mdx @@ -16,9 +16,9 @@ import { Meta } from "@storybook/addon-docs/blocks"; - + -# Use Cases +# Examples This section showcases workflow examples from the [Serverless Workflow Specification](https://github.com/serverlessworkflow/specification/tree/main/examples). diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts similarity index 81% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts rename to packages/serverless-workflow-diagram-editor/stories/examples/index.ts index 93184632..2d6b037d 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts +++ b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts @@ -28,3 +28,9 @@ export { default as callOpenApi } from "./workflows/call-openapi.yaml?raw"; export { default as conditionalTask } from "./workflows/conditional-task.yaml?raw"; export { default as doMultiple } from "./workflows/do-multiple.yaml?raw"; export { default as doSingle } from "./workflows/do-single.yaml?raw"; +export { default as emit } from "./workflows/emit.yaml?raw"; +export { default as for } from "./workflows/for.yaml?raw"; +export { default as fork } from "./workflows/fork.yaml?raw"; +export { default as listenToAll } from "./workflows/listen-to-all.yaml?raw"; +export { default as listenToOne } from "./workflows/listen-to-one.yaml?raw"; +export { default as listenToAnyForeverForeach } from "./workflows/listen-to-any-forever-foreach.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/accumulate-room-readings.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-oauth2.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/authentication-reusable.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-publish.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-cataloged.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-custom-function-inline.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-grpc.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-http-query-headers-expressions.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-mcp.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/call-openapi.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/conditional-task.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-multiple.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml similarity index 100% rename from packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/do-single.yaml rename to packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml new file mode 100644 index 00000000..7b04c10b --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml @@ -0,0 +1,19 @@ +document: + dsl: "1.0.3" + namespace: test + name: emit + version: "0.1.0" +do: + - emitEvent: + emit: + event: + with: + source: https://petstore.com + type: com.petstore.order.placed.v1 + data: + client: + firstName: Cruella + lastName: de Vil + items: + - breed: dalmatian + quantity: 101 diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml new file mode 100644 index 00000000..047a4a9d --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml @@ -0,0 +1,21 @@ +document: + dsl: "1.0.3" + namespace: test + name: for-example + version: "0.1.0" +do: + - checkup: + for: + each: pet + in: .pets + at: index + while: .vet != null + do: + - waitForCheckup: + listen: + to: + one: + with: + type: com.fake.petclinic.pets.checkup.completed.v2 + output: + as: '.pets + [{ "id": $pet.id }]' diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml new file mode 100644 index 00000000..38bb8a93 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml @@ -0,0 +1,26 @@ +document: + dsl: "1.0.3" + namespace: test + name: fork-example + version: "0.1.0" +do: + - raiseAlarm: + fork: + compete: true + branches: + - callNurse: + call: http + with: + method: put + endpoint: https://fake-hospital.com/api/v3/alert/nurses + body: + patientId: ${ .patient.fullName } + room: ${ .room.number } + - callDoctor: + call: http + with: + method: put + endpoint: https://fake-hospital.com/api/v3/alert/doctor + body: + patientId: ${ .patient.fullName } + room: ${ .room.number } diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml new file mode 100644 index 00000000..4c41269e --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml @@ -0,0 +1,16 @@ +document: + dsl: "1.0.3" + namespace: test + name: listen-to-all + version: "0.1.0" +do: + - callDoctor: + listen: + to: + all: + - with: + type: com.fake-hospital.vitals.measurements.temperature + data: ${ .temperature > 38 } + - with: + type: com.fake-hospital.vitals.measurements.bpm + data: ${ .bpm < 60 or .bpm > 100 } diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml new file mode 100644 index 00000000..7a98010c --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml @@ -0,0 +1,22 @@ +document: + dsl: "1.0.3" + namespace: test + name: listen-to-any-while-foreach + version: "0.1.0" +do: + - listenToGossips: + listen: + to: + any: [] + until: "${ false }" + foreach: + item: event + at: i + do: + - postToChatApi: + call: http + with: + method: post + endpoint: https://fake-chat-api.com/room/{roomId} + body: + event: ${ $event } diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml new file mode 100644 index 00000000..5ed2fe67 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml @@ -0,0 +1,18 @@ +document: + dsl: "1.0.3" + namespace: test + name: listen-to-one + version: "0.1.0" +do: + - waitForStartup: + listen: + to: + one: + with: + type: com.virtual-wf-powered-race.events.race.started.v1 + - startup: + call: http + with: + method: post + endpoint: + uri: https://virtual-wf-powered-race.com/api/v4/cars/{carId}/start From 257608db8c0055d8e2731483b0df32986f3246ee Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Wed, 3 Jun 2026 11:02:41 +0100 Subject: [PATCH 05/14] feat: add workflow factory and additional example stories Signed-off-by: Cheryl Kong --- .../stories/examples/Examples.stories.tsx | 233 ++++++------------ .../stories/examples/index.ts | 15 ++ .../workflows/mock-service-extension.yaml | 27 ++ .../examples/workflows/raise-reusable.yaml | 16 ++ .../run-container-stdin-and-arguments.yaml | 23 ++ .../examples/workflows/run-return-all.yaml | 11 + .../run-script-with-stdin-and-arguments.yaml | 28 +++ .../run-shell-stdin-and-arguments.yaml | 22 ++ .../examples/workflows/run-subflow.yaml | 14 ++ .../examples/workflows/schedule-cron.yaml | 13 + .../workflows/schedule-event-driven.yaml | 24 ++ .../stories/examples/workflows/set.yaml | 14 ++ .../workflows/star-wars-homeworld.yaml | 33 +++ .../workflows/switch-then-string.yaml | 31 +++ .../workflows/try-catch-retry-reusable.yaml | 29 +++ .../examples/workflows/try-catch-then.yaml | 39 +++ .../workflows/wait-duration-inline.yaml | 9 + 17 files changed, 422 insertions(+), 159 deletions(-) create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index 336ee314..e6483104 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -32,162 +32,77 @@ const meta = { export default meta; type Story = StoryObj; -export const AccumulateRoomReadings: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.accumulateRoomReadings, - }, -}; - -export const AuthenticationOAuth2: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.authenticationOAuth2, - }, -}; - -export const AuthenticationReusable: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.authenticationReusable, - }, -}; - -export const CallAsyncAPIPublish: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callAsyncAPIPublish, - }, -}; - -export const CallAsyncAPISubscribe: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callAsyncAPISubscribe, - }, -}; - -export const CallCustomFunctionCataloged: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callCustomFunctionCataloged, - }, -}; - -export const CallCustomFunctionInline: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callCustomFunctionInline, - }, -}; - -export const CallGrpc: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callGrpc, - }, -}; - -export const CallHttpQueryHeadersExpression: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callHttpQueryHeadersExpressions, - }, -}; - -export const CallMCP: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callMCP, - }, -}; - -export const CallOpenAPI: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.callOpenApi, - }, -}; - -export const ConditionalTask: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.conditionalTask, - }, -}; - -export const DoMultiple: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.doMultiple, - }, -}; - -export const DoSingle: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.doSingle, - }, -}; - -export const Emit: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.emit, - }, -}; - -export const For: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.for, - }, -}; - -export const Fork: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.fork, - }, -}; - -export const ListenToAll: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.listenToAll, - }, -}; - -export const ListenToOne: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.listenToOne, - }, -}; - -export const ListenToAnyForeverForeach: Story = { - args: { - isReadOnly: true, - locale: "en", - content: workflows.listenToAnyForeverForeach, - }, -}; +// Constants for shared configuration +const DEFAULT_STORY_ARGS = { + isReadOnly: true, + locale: "en" as const, +} as const; + +/** + * Factory function to create workflow story configurations + * @param workflowContent - The YAML workflow content to display + * @returns Story configuration object + */ +const createWorkflowStory = (workflowContent: string): Story => { + if (!workflowContent || workflowContent.trim().length === 0) { + console.warn("Empty workflow content provided to story"); + } + + return { + args: { + ...DEFAULT_STORY_ARGS, + content: workflowContent, + }, + }; +}; + +// Story definitions using the factory function +export const AccumulateRoomReadings: Story = createWorkflowStory(workflows.accumulateRoomReadings); +export const AuthenticationOAuth2: Story = createWorkflowStory(workflows.authenticationOAuth2); +export const AuthenticationReusable: Story = createWorkflowStory(workflows.authenticationReusable); +export const CallAsyncAPIPublish: Story = createWorkflowStory(workflows.callAsyncAPIPublish); +export const CallAsyncAPISubscribe: Story = createWorkflowStory(workflows.callAsyncAPISubscribe); +export const CallCustomFunctionCataloged: Story = createWorkflowStory( + workflows.callCustomFunctionCataloged, +); +export const CallCustomFunctionInline: Story = createWorkflowStory( + workflows.callCustomFunctionInline, +); +export const CallGrpc: Story = createWorkflowStory(workflows.callGrpc); +export const CallHttpQueryHeadersExpression: Story = createWorkflowStory( + workflows.callHttpQueryHeadersExpressions, +); +export const CallMCP: Story = createWorkflowStory(workflows.callMCP); +export const CallOpenAPI: Story = createWorkflowStory(workflows.callOpenApi); +export const ConditionalTask: Story = createWorkflowStory(workflows.conditionalTask); +export const DoMultiple: Story = createWorkflowStory(workflows.doMultiple); +export const DoSingle: Story = createWorkflowStory(workflows.doSingle); +export const Emit: Story = createWorkflowStory(workflows.emit); +export const For: Story = createWorkflowStory(workflows.for); +export const Fork: Story = createWorkflowStory(workflows.fork); +export const ListenToAll: Story = createWorkflowStory(workflows.listenToAll); +export const ListenToOne: Story = createWorkflowStory(workflows.listenToOne); +export const ListenToAnyForeverForeach: Story = createWorkflowStory( + workflows.listenToAnyForeverForeach, +); +export const MockServiceExtension: Story = createWorkflowStory(workflows.mockServiceExtension); +export const RaiseReusable: Story = createWorkflowStory(workflows.raiseReusable); +export const RunContainerStdinAndArguments: Story = createWorkflowStory( + workflows.runContainerStdinAndArguments, +); +export const RunReturnAll: Story = createWorkflowStory(workflows.runReturnAll); +export const RunScriptWithStdinAndArguments: Story = createWorkflowStory( + workflows.runScriptWithStdinAndArguments, +); +export const RunShellStdinAndArguments: Story = createWorkflowStory( + workflows.runShellStdinAndArguments, +); +export const RunSubflow: Story = createWorkflowStory(workflows.runSubflow); +export const ScheduleCron: Story = createWorkflowStory(workflows.scheduleCron); +export const ScheduleEventDriven: Story = createWorkflowStory(workflows.scheduleEventDriven); +export const SetExample: Story = createWorkflowStory(workflows.set); +export const StarWarsHomeworld: Story = createWorkflowStory(workflows.starWarsHomeworld); +export const SwitchThenString: Story = createWorkflowStory(workflows.switchThenString); +export const TryCatchRetryReusable: Story = createWorkflowStory(workflows.tryCatchRetryReusable); +export const TryCatchThen: Story = createWorkflowStory(workflows.tryCatchThen); +export const WaitDurationInline: Story = createWorkflowStory(workflows.waitDurationInline); diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/index.ts b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts index 2d6b037d..f66d88ca 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/index.ts +++ b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts @@ -34,3 +34,18 @@ export { default as fork } from "./workflows/fork.yaml?raw"; export { default as listenToAll } from "./workflows/listen-to-all.yaml?raw"; export { default as listenToOne } from "./workflows/listen-to-one.yaml?raw"; export { default as listenToAnyForeverForeach } from "./workflows/listen-to-any-forever-foreach.yaml?raw"; +export { default as mockServiceExtension } from "./workflows/mock-service-extension.yaml?raw"; +export { default as raiseReusable } from "./workflows/raise-reusable.yaml?raw"; +export { default as runContainerStdinAndArguments } from "./workflows/run-container-stdin-and-arguments.yaml?raw"; +export { default as runReturnAll } from "./workflows/run-return-all.yaml?raw"; +export { default as runScriptWithStdinAndArguments } from "./workflows/run-script-with-stdin-and-arguments.yaml?raw"; +export { default as runShellStdinAndArguments } from "./workflows/run-shell-stdin-and-arguments.yaml?raw"; +export { default as runSubflow } from "./workflows/run-subflow.yaml?raw"; +export { default as scheduleCron } from "./workflows/schedule-cron.yaml?raw"; +export { default as scheduleEventDriven } from "./workflows/schedule-event-driven.yaml?raw"; +export { default as set } from "./workflows/set.yaml?raw"; +export { default as starWarsHomeworld } from "./workflows/star-wars-homeworld.yaml?raw"; +export { default as switchThenString } from "./workflows/switch-then-string.yaml?raw"; +export { default as tryCatchRetryReusable } from "./workflows/try-catch-retry-reusable.yaml?raw"; +export { default as tryCatchThen } from "./workflows/try-catch-then.yaml?raw"; +export { default as waitDurationInline } from "./workflows/wait-duration-inline.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml new file mode 100644 index 00000000..8d96f764 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml @@ -0,0 +1,27 @@ +document: + dsl: "1.0.3" + namespace: test + name: sample-workflow + version: 0.1.0 +use: + extensions: + - mockService: + extend: call + when: ($task.with.endpoint != null and ($task.with.endpoint | startswith("https://mocked.service.com"))) or ($task.with.endpoint.uri != null and ($task.with.endpoint.uri | startswith("https://mocked.service.com"))) + before: + - mockResponse: + set: + statusCode: 200 + headers: + Content-Type: application/json + content: + foo: + bar: baz + then: exit #using this, we indicate to the workflow we want to exit the extended task, thus just returning what we injected +do: + - callHttp: + call: http + with: + method: get + endpoint: + uri: https://fake.com/sample diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml new file mode 100644 index 00000000..3ebb08dd --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml @@ -0,0 +1,16 @@ +document: + dsl: "1.0.3" + namespace: test + name: raise-not-implemented + version: "0.1.0" +use: + errors: + notImplemented: + type: https://serverlessworkflow.io/errors/not-implemented + status: 500 + title: Not Implemented + detail: ${ "The workflow '\( $workflow.definition.document.name ):\( $workflow.definition.document.version )' is a work in progress and cannot be run yet" } +do: + - notImplemented: + raise: + error: notImplemented diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml new file mode 100644 index 00000000..f11bbfc7 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml @@ -0,0 +1,23 @@ +document: + dsl: "1.0.3" + namespace: test + name: run-container-stdin-and-arguments + version: "0.1.0" +do: + - setInput: + set: + message: Hello World + - runContainer: + input: + from: ${ .message } + run: + container: + image: alpine + command: | + input=$(cat) + echo "STDIN was: $input" + echo "ARGS are $1 $2" + stdin: ${ . } + arguments: + - Foo + - Bar diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml new file mode 100644 index 00000000..6a886b97 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml @@ -0,0 +1,11 @@ +document: + dsl: "1.0.3" + namespace: test + name: run-container + version: "0.1.0" +do: + - runContainer: + run: + container: + image: hello-world + return: all diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml new file mode 100644 index 00000000..90bd479f --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml @@ -0,0 +1,28 @@ +document: + dsl: 1.0.3 + namespace: examples + name: run-script-with-stdin-and-arguments + version: 1.0.0 +do: + - runScript: + run: + script: + language: javascript + stdin: "Hello Workflow" + environment: + foo: bar + arguments: + - hello + code: | + // Reading Input from STDIN + import { readFileSync } from 'node:fs'; + const stdin = readFileSync(process.stdin.fd, 'utf8'); + console.log('stdin > ', stdin) // Output: stdin > Hello Workflow + + // Reading from argv + const [_, __, arg] = process.argv; + console.log('arg > ', arg) // Output: arg > hello + + // Reading from env + const foo = process.env.foo; + console.log('env > ', foo) // Output: env > bar diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml new file mode 100644 index 00000000..f79da0bc --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml @@ -0,0 +1,22 @@ +document: + dsl: 1.0.3 + namespace: examples + name: run-shell-with-stdin-and-arguments + version: 1.0.0 +do: + - setInput: + set: + message: Hello World + - runShell: + input: + from: ${ .message } + run: + shell: + stdin: ${ . } + command: | + input=$(cat) + echo "STDIN was: $input" + echo "ARGS are $1 $2" + arguments: + - Foo + - Bar diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml new file mode 100644 index 00000000..384329d3 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml @@ -0,0 +1,14 @@ +document: + dsl: "1.0.3" + namespace: test + name: run-subflow + version: "0.1.0" +do: + - registerCustomer: + run: + workflow: + namespace: test + name: register-customer + version: "0.1.0" + input: + customer: .user diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml new file mode 100644 index 00000000..45f2d280 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml @@ -0,0 +1,13 @@ +document: + dsl: "1.0.3" + namespace: examples + name: cron-schedule + version: "0.1.0" +schedule: + cron: 0 0 * * * +do: + - backup: + call: http + with: + method: post + endpoint: https://example.com/api/v1/backup/start diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml new file mode 100644 index 00000000..b8f91ba7 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml @@ -0,0 +1,24 @@ +document: + dsl: "1.0.3" + namespace: examples + name: event-driven-schedule + version: "0.1.0" +schedule: + on: + one: + with: + type: com.example.hospital.events.patients.heartbeat.low +do: + - callNurse: + call: http + with: + method: post + endpoint: https://hospital.example.com/api/v1/notify + body: + patientId: ${ $workflow.input[0].data.patient.id } + patientName: ${ $workflow.input[0].data.patient.name } + roomNumber: ${ $workflow.input[0].data.patient.room.number } + vitals: + heartRate: ${ $workflow.input[0].data.patient.vitals.bpm } + timestamp: ${ $workflow.input[0].data.timestamp } + message: "Alert: Patient's heartbeat is critically low. Immediate attention required." diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml new file mode 100644 index 00000000..5d06a981 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml @@ -0,0 +1,14 @@ +document: + dsl: "1.0.3" + namespace: test + name: set + version: "0.1.0" +schedule: + on: + one: + with: + type: io.serverlessworkflow.samples.events.trigger.v1 +do: + - initialize: + set: + startEvent: ${ $workflow.input[0] } diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml new file mode 100644 index 00000000..e1e5fbb9 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml @@ -0,0 +1,33 @@ +# yaml-language-server: $schema=../schema/workflow.yaml +document: + dsl: "1.0.3" + namespace: examples + name: star-wars-homeplanet + version: "1.0.0" +input: + schema: + format: json + document: + type: object + required: + - id + properties: + id: + type: integer + description: The id of the star wars character to get + minimum: 1 +do: + - getStarWarsCharacter: + call: http + with: + method: get + endpoint: https://swapi.dev/api/people/{id} + output: response + export: + as: + homeworld: ${ .content.homeworld } + - getStarWarsHomeworld: + call: http + with: + method: get + endpoint: ${ $context.homeworld } diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml new file mode 100644 index 00000000..7f38d14f --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml @@ -0,0 +1,31 @@ +document: + dsl: "1.0.3" + namespace: test + name: sample-workflow + version: 0.1.0 +do: + - processOrder: + switch: + - case1: + when: .orderType == "electronic" + then: processElectronicOrder + - case2: + when: .orderType == "physical" + then: processPhysicalOrder + - default: + then: handleUnknownOrderType + - processElectronicOrder: + set: + validate: true + status: fulfilled + then: exit + - processPhysicalOrder: + set: + inventory: clear + items: 1 + address: Elmer St + then: exit + - handleUnknownOrderType: + set: + log: warn + message: something's wrong diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml new file mode 100644 index 00000000..f9e554f6 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml @@ -0,0 +1,29 @@ +document: + dsl: "1.0.3" + namespace: default + name: try-catch-retry + version: "0.1.0" +use: + retries: + default: + delay: + seconds: 3 + backoff: + exponential: {} + limit: + attempt: + count: 5 +do: + - tryGetPet: + try: + - getPet: + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} + catch: + errors: + with: + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication + status: 503 + retry: default diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml new file mode 100644 index 00000000..93da3500 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml @@ -0,0 +1,39 @@ +document: + dsl: "1.0.3" + namespace: default + name: try-catch + version: "0.1.0" +do: + - tryGetPet: + try: + - getPet: + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} + catch: + errors: + with: + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication + status: 404 + as: error + do: + - notifySupport: + emit: + event: + with: + source: https://petstore.swagger.io + type: io.swagger.petstore.events.pets.not-found.v1 + data: ${ $error } + - setError: + set: + error: $error + export: + as: "$context + { error: $error }" + - buyPet: + if: $context.error == null + call: http + with: + method: put + endpoint: https://petstore.swagger.io/v2/pet/{petId} + body: '${ . + { status: "sold" } }' diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml new file mode 100644 index 00000000..877ba1ed --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml @@ -0,0 +1,9 @@ +document: + dsl: "1.0.3" + namespace: test + name: wait-duration-inline + version: "0.1.0" +do: + - wait30Seconds: + wait: + seconds: 30 From 5ec57c84e26df35ab2342fdff29e9483aa51b5b4 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Wed, 3 Jun 2026 13:45:27 +0100 Subject: [PATCH 06/14] feat: add use cases section to storybook with workflow examples Signed-off-by: Cheryl Kong --- .../stories/use-cases/Overview.mdx | 29 +++ .../stories/use-cases/UseCases.stories.tsx | 58 ++++++ .../stories/use-cases/index.ts | 20 ++ .../workflows/automated-data-backup.yaml | 43 ++++ .../managing-ev-charging-stations.yaml | 184 +++++++++++++++++ .../workflows/managing-github-issues.yaml | 191 ++++++++++++++++++ .../multi-agent-ai-content-generation.yaml | 102 ++++++++++ 7 files changed, 627 insertions(+) create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml create mode 100644 packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx b/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx new file mode 100644 index 00000000..29c47b38 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/Overview.mdx @@ -0,0 +1,29 @@ +{/* + * Copyright 2021-Present 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. + */} + +import { Meta } from "@storybook/addon-docs/blocks"; + + + +# Use Cases + +This directory contains a collection of high-level use cases that demonstrate the capabilities and potential applications of the Serverless Workflow DSL. + +Each use case provides insights into how to effectively implement workflows in various scenarios, helping newcomers understand the framework's power and flexibility. + +## Available Use Cases + +Browse through the use cases in the sidebar to explore workflow implementations for different scenarios. \ No newline at end of file diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx new file mode 100644 index 00000000..1475da3c --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -0,0 +1,58 @@ +/* + * Copyright 2021-Present 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. + */ + +import type { Meta, StoryObj } from "@storybook/react-vite"; +import { DiagramEditor } from "../features/DiagramEditor"; +import * as workflows from "./index"; + +const meta = { + title: "Use Cases", + component: DiagramEditor, + parameters: { + layout: "fullscreen", + }, + render: (args, { globals }) => { + return ; + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +const DEFAULT_STORY_ARGS = { + isReadOnly: true, + locale: "en" as const, +} as const; + +const createWorkflowStory = (workflowContent: string): Story => { + if (!workflowContent || workflowContent.trim().length === 0) { + console.warn("Empty workflow content provided to story"); + } + + return { + args: { + ...DEFAULT_STORY_ARGS, + content: workflowContent, + }, + }; +}; + +export const AutomatedDataBackup = createWorkflowStory(workflows.automatedDataBackup); +export const ManagingEVChargingStations = createWorkflowStory(workflows.managingEVChargingStations); +export const ManagingGithubIssues = createWorkflowStory(workflows.managingGithubIssues); +export const MultiAgentAIContentGeneration = createWorkflowStory( + workflows.multiAgentAIContentGeneration, +); diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts new file mode 100644 index 00000000..9405f793 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright 2021-Present 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. + */ + +export { default as automatedDataBackup } from "./workflows/automated-data-backup.yaml?raw"; +export { default as managingEVChargingStations } from "./workflows/managing-ev-charging-stations.yaml?raw"; +export { default as managingGithubIssues } from "./workflows/managing-github-issues.yaml?raw"; +export { default as multiAgentAIContentGeneration } from "./workflows/multi-agent-ai-content-generation.yaml?raw"; diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml new file mode 100644 index 00000000..a6ff6553 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml @@ -0,0 +1,43 @@ +document: + dsl: "1.0.3" + namespace: default + name: sql-export-to-minio + version: 0.1.2 +do: + - exportDatabase: + run: + container: + image: mcr.microsoft.com/mssql-tools + command: > + /bin/bash -c "sqlcmd -S $SQLSERVER_HOST -U $SQLSERVER_USER -P '$SQLSERVER_PASSWORD' -Q 'BACKUP DATABASE [$DATABASE_NAME] TO DISK = N\'/var/backup/db.bak\'' && echo 'Database backup completed'" + volumes: + /var/backup: /backup + environment: + SQLSERVERHOST: sqlserver + SQLSERVERUSER: SA + SQLSERVERPASSWORD: P@ssw0rd + DATABASENAME: YourDatabase + - readBackupFile: + run: + container: + image: alpine + command: > + /bin/sh -c "cat /backup/YourDatabase.bak | base64" + volumes: + /var/backup: /backup + export: + as: "$context + { base64Backup: . }" + - uploadToMinio: + call: http + with: + method: put + endpoint: + uri: https://minio.example.com/backups/db.bak + authentication: + bearer: + token: 2548qsd5a8qsd43a + headers: + contentType: application/octet-stream + body: ${ $context.base64Backup } +schedule: + cron: 0 0 * * * diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml new file mode 100644 index 00000000..6a23cd5f --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml @@ -0,0 +1,184 @@ +document: + dsl: "1.0.3" + namespace: default + name: manage-ev-charging-stations + version: "0.1.0" +schedule: + on: + any: + - with: + type: com.ev-power-supplier.charging-station.card-scanned.v1 + - with: + type: com.ev-power-supplier.charging-station.faulted.v1 +do: + - initialize: + set: + event: ${ $workflow.input[0].data } + export: + as: .event + + - handleStationEvents: + switch: + - sessionStarted: + when: .event.type == "com.ev-power-supplier.charging-station.card-scanned.v1" + then: tryGetActiveSession + - stationError: + when: .event.type == "com.ev-power-supplier.charging.station-faulted.v1" + then: handleError + then: raiseUnsupportedEventError + + - tryGetActiveSession: + try: + - getSessionForCard: + call: http + with: + method: get + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/session/{cardId} + - setSessionInfo: + set: + session: ${ .session } + catch: + errors: + with: + status: 404 + + - handleActiveSession: + switch: + - sessionInProgress: + when: .session != null + then: endSession + - noActiveSession: + then: tryAquireSlot + + - tryAquireSlot: + try: + - acquireSlot: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId} + body: + card: ${ $context.card } + export: + as: "$context + { slot: .slot }" + catch: + errors: + with: + status: 400 + when: .detail == "No charging slots available" + do: + - noSlotsAvailable: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/leds/main + body: + action: flicker + color: red + duration: 3000 + then: end + + - startSession: + do: + - initialize: + set: + session: + card: ${ $context.card } + slotNumber: ${ $context.slot.number } + export: + as: "$context + { session: . }" + - feedBack: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/leds/{slotNumber} + body: + action: "on" + color: blue + - lockSlot: + call: http + with: + method: put + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/slot/{slotNumber}/lock + - start: + call: http + with: + method: put + endpoint: https://ev-power-supplier.com/api/v2/sessions/{sessionId}/start + - notify: + emit: + event: + with: + source: https://ev-power-supplier.com + type: com.ev-power-supplier.charging-station.session-started.v1 + data: ${ $context.session } + + - endSession: + do: + - end: + call: http + with: + method: put + endpoint: https://ev-power-supplier.com/api/v2/sessions/{sessionId}/end + - processPayment: + call: http + with: + method: put + endpoint: https://ev-power-supplier.com/api/v2/sessions/{sessionId}/pay + - unlockSlot: + call: http + with: + method: put + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/slot/{slotNumber}/unlock + - feedBack: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/leds/{slotNumber} + body: + action: flicker + color: white + duration: 3000 + - notify: + emit: + event: + with: + source: https://ev-power-supplier.com + type: com.ev-power-supplier.charging-station.session-ended.v1 + data: ${ $context.session } + then: end + + - handleError: + do: + - contactSupport: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/support + body: + error: ${ $context.event.data.error } + - feedBack: + call: http + with: + method: post + endpoint: https://ev-power-supplier.com/api/v2/stations/{stationId}/leds/main + body: + action: "on" + color: red + - notify: + emit: + event: + with: + source: https://ev-power-supplier.com + type: com.ev-power-supplier.charging-station.out-of-order.v1 + data: ${ $context.event.data.error } + then: end + + - raiseUnsupportedEventError: + raise: + error: + type: https://serverlessworkflow.io/spec/1.0.0/errors/runtime + status: 400 + title: Unsupported Event + detail: ${ "The specified station event '\($context.event.type)' is not supported in this context" } + then: end diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml new file mode 100644 index 00000000..5a66dcbf --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml @@ -0,0 +1,191 @@ +document: + dsl: "1.0.3" + namespace: default + name: manage-github-issues + version: "0.1.0" +schedule: + on: + one: + with: + type: com.github.events.issues.opened.v1 + data: ${ .data.author.team == "QA" } +do: + - initialize: + set: + issue: ${ $workflow.input[0].data } + export: + as: .issue + + - awaitForDevWork: + do: + - assign: + set: + issue: + assignedTo: DevTeam + status: inProgress + - notify: + emit: + event: + with: + source: https://serverlessworkflow.io + type: com.github.events.issues.assignedToDevTeam.v1 + data: + issue: ${ .issue } + - await: + listen: + to: + one: + with: + type: com.github.events.issues.devWorkCompleted.v1 + export: + as: "$context + { issue: ($context.issue + { action: .data.nextAction, dev: .data.dev }) }" + then: evaluateDevWorkOutcome + + - evaluateDevWorkOutcome: + switch: + - review: + when: $context.issue.action == "review" + then: reviewIssue + - requestDetails: + when: $context.issue.action == "requestDetails" + then: awaitDetailsFromQA + - default: + then: raiseUnsupportedActionError + + - awaitDetailsFromQA: + do: + - assign: + set: + issue: + assignedTo: QA + status: awaitingDetails + assignTo: ${ $context.issue.author } + - notify: + emit: + event: + with: + source: https://serverlessworkflow.io + type: com.github.events.issues.assignedToQATeam.v1 + data: + issue: ${ $context.issue } + - await: + listen: + to: + one: + with: + type: com.github.events.issues.detailsProvided.v1 + export: + as: "$context + { issue: ($context.issue + { action: .data.nextAction }) }" + then: awaitForDevWork + + - reviewIssue: + do: + - assign: + set: + issue: + assignedTo: DevTeam + status: reviewing + - notify: + emit: + event: + with: + source: https://serverlessworkflow.io + type: com.github.events.issues.pendingReview.v1 + data: + issue: ${ $context.issue } + review: + exclude: ${ $context.issue.dev } + - await: + listen: + to: + one: + with: + type: com.github.events.issues.reviewed.v1 + export: + as: "$context + { issue: ($context.issue + { reviewer: .data.reviewer }) }" + + - validateReview: + switch: + - reviewerIsNotAssignedDev: + when: $context.issue.reviewer != $context.issue.dev + then: evaluateReview + - reviewerIsAssignedDev: + then: raiseAssignedDevCannotBeReviewer + + - evaluateReview: + do: + - assign: + set: + issue: + assignedTo: QA + status: evaluating + - notify: + emit: + event: + with: + source: https://serverlessworkflow.io + type: com.github.events.issues.evaluateReview.v1 + data: + issue: ${ $context.issue } + assignTo: ${ $context.issue.author } + - await: + listen: + to: + one: + with: + type: com.github.events.issues.evaluated.v1 + export: + as: "$context + { issue: ($context.issue + { action: .data.nextAction }) }" + - evaluate: + switch: + - closeIssue: + when: $context.issue.action == "close" + then: closeIssue + - default: + then: exit + - closeIssue: + do: + - initialize: + set: + organization: ${ $context.issue.repository.organization } + repository: ${ $context.issue.repository.name } + issueNumber: ${ $context.issue.number } + - closeIssueOnGithub: + call: http + with: + endpoint: https://api.github.com/repos/{organization}/{repository}/issues/{issueNumber} + method: patch + body: + state: closed + - setIssueInfo: + set: + issue: + status: closed + - notify: + emit: + event: + with: + source: https://serverlessworkflow.io + type: com.github.events.issues.closed.v1 + data: + issue: ${ $context.issue } + then: end + then: awaitForDevWork + + - raiseUnsupportedActionError: + raise: + error: + type: https://serverlessworkflow.io/spec/1.0.0/errors/runtime + status: 400 + title: Unsupported Action + detail: The specified action is not supported in this context + then: end + + - raiseAssignedDevCannotBeReviewer: + raise: + error: + type: https://serverlessworkflow.io/spec/1.0.0/errors/runtime + status: 400 + title: Invalid Reviewer + detail: The developer that has performed the work associated with the issue cannot be the reviewer of its own work + then: end diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml new file mode 100644 index 00000000..3435f0f4 --- /dev/null +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml @@ -0,0 +1,102 @@ +document: + dsl: "1.0.3" + namespace: default + name: multi-agent-collaboration-for-ai-content + version: "0.1.0" +input: + schema: + document: + type: object + properties: + prompt: + type: string + required: [prompt] +do: + - initialize: + set: + prompt: ${ $workflow.input.prompt } + export: + as: .prompt + + - generateText: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/generate-text + body: + prompt: ${ .prompt } + export: + as: "$context + { text: .text }" + + - generateImage: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/generate-image + body: + text: ${ .text } + export: + as: "$context + { image: .image }" + + - evaluateQuality: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/evaluate + body: + text: ${ .text } + image: ${ .image } + export: + as: "$context + { evaluation: .evaluation }" + + - refineContent: + switch: + - needsRefinement: + when: .evaluation.needsRefinement == true + then: refine + - noRefinementNeeded: + when: .evaluation.needsRefinement == false + then: deliverContent + + - refine: + do: + - refineText: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/refine-text + body: + text: ${ .text } + feedback: ${ .evaluation.text_feedback } + - refineImage: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/refine-image + body: + image: ${ .image } + feedback: ${ .evaluation.image_feedback } + - reevaluate: + call: http + with: + method: post + endpoint: https://ai-content-generator.com/api/v1/evaluate + body: + text: ${ .refined_text } + image: ${ .refined_image } + export: + as: .evaluation + then: evaluateQuality + + - deliverContent: + do: + - notify: + emit: + event: + with: + source: https://ai-content-generator.com + type: com.ai-content-generator.content.ready.v1 + data: + text: ${ .text } + image: ${ .image } + then: end From ca94448b365dcb4b456b4036ea3cbd259e6ab0cc Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Wed, 3 Jun 2026 15:05:38 +0100 Subject: [PATCH 07/14] feat: disable storybook backgrounds toggle Signed-off-by: Cheryl Kong --- .../serverless-workflow-diagram-editor/.storybook/preview.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx index 22e1e905..6b92686f 100644 --- a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx +++ b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx @@ -30,6 +30,10 @@ const preview: Preview = { }, }, + backgrounds: { + disable: true, + }, + a11y: { // 'todo' - show a11y violations in the test UI only // 'error' - fail CI on a11y violations From e7fcf97c67f38154b64568157c6df125a843a839 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Wed, 3 Jun 2026 16:57:52 +0100 Subject: [PATCH 08/14] add changeset Signed-off-by: Cheryl Kong --- .changeset/ready-ties-burn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/ready-ties-burn.md diff --git a/.changeset/ready-ties-burn.md b/.changeset/ready-ties-burn.md new file mode 100644 index 00000000..db2d54fb --- /dev/null +++ b/.changeset/ready-ties-burn.md @@ -0,0 +1,5 @@ +--- +"@serverlessworkflow/diagram-editor": minor +--- + +Add workflow examples to Storybook From e7823ab9a908a4693e248fafba1d84809abd6d1e Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Thu, 4 Jun 2026 10:02:53 +0100 Subject: [PATCH 09/14] fix: add license headers and fix copilot complaints Signed-off-by: Cheryl Kong --- .../.storybook/preview.tsx | 2 +- .../stories/README.md | 3 ++- .../workflows/accumulate-room-readings.yaml | 15 +++++++++++++++ .../examples/workflows/authentication-oauth2.yaml | 15 +++++++++++++++ .../workflows/authentication-reusable.yaml | 15 +++++++++++++++ .../examples/workflows/call-asyncapi-publish.yaml | 15 +++++++++++++++ ...syncapi-subscribe-consume-forever-foreach.yaml | 15 +++++++++++++++ .../workflows/call-custom-function-cataloged.yaml | 15 +++++++++++++++ .../workflows/call-custom-function-inline.yaml | 15 +++++++++++++++ .../stories/examples/workflows/call-grpc.yaml | 15 +++++++++++++++ .../call-http-query-headers-expressions.yaml | 15 +++++++++++++++ .../stories/examples/workflows/call-mcp.yaml | 15 +++++++++++++++ .../stories/examples/workflows/call-openapi.yaml | 15 +++++++++++++++ .../examples/workflows/conditional-task.yaml | 15 +++++++++++++++ .../stories/examples/workflows/do-multiple.yaml | 15 +++++++++++++++ .../stories/examples/workflows/do-single.yaml | 15 +++++++++++++++ .../stories/examples/workflows/emit.yaml | 15 +++++++++++++++ .../stories/examples/workflows/for.yaml | 15 +++++++++++++++ .../stories/examples/workflows/fork.yaml | 15 +++++++++++++++ .../stories/examples/workflows/listen-to-all.yaml | 15 +++++++++++++++ .../workflows/listen-to-any-forever-foreach.yaml | 15 +++++++++++++++ .../stories/examples/workflows/listen-to-one.yaml | 15 +++++++++++++++ .../workflows/mock-service-extension.yaml | 15 +++++++++++++++ .../examples/workflows/raise-reusable.yaml | 15 +++++++++++++++ .../run-container-stdin-and-arguments.yaml | 15 +++++++++++++++ .../examples/workflows/run-return-all.yaml | 15 +++++++++++++++ .../run-script-with-stdin-and-arguments.yaml | 15 +++++++++++++++ .../workflows/run-shell-stdin-and-arguments.yaml | 15 +++++++++++++++ .../stories/examples/workflows/run-subflow.yaml | 15 +++++++++++++++ .../stories/examples/workflows/schedule-cron.yaml | 15 +++++++++++++++ .../examples/workflows/schedule-event-driven.yaml | 15 +++++++++++++++ .../stories/examples/workflows/set.yaml | 15 +++++++++++++++ .../examples/workflows/star-wars-homeworld.yaml | 15 +++++++++++++++ .../examples/workflows/switch-then-string.yaml | 15 +++++++++++++++ .../workflows/try-catch-retry-reusable.yaml | 15 +++++++++++++++ .../examples/workflows/try-catch-then.yaml | 15 +++++++++++++++ .../examples/workflows/wait-duration-inline.yaml | 15 +++++++++++++++ .../workflows/automated-data-backup.yaml | 15 +++++++++++++++ .../workflows/managing-ev-charging-stations.yaml | 15 +++++++++++++++ .../workflows/managing-github-issues.yaml | 15 +++++++++++++++ .../multi-agent-ai-content-generation.yaml | 15 +++++++++++++++ 41 files changed, 588 insertions(+), 2 deletions(-) diff --git a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx index 6b92686f..c43d6a91 100644 --- a/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx +++ b/packages/serverless-workflow-diagram-editor/.storybook/preview.tsx @@ -43,7 +43,7 @@ const preview: Preview = { options: { storySort: { - order: ["Introduction", "Features", "Use Cases"], + order: ["Introduction", "Features", "Examples", "Use Cases"], }, }, }, diff --git a/packages/serverless-workflow-diagram-editor/stories/README.md b/packages/serverless-workflow-diagram-editor/stories/README.md index ce691255..6fd24cf6 100644 --- a/packages/serverless-workflow-diagram-editor/stories/README.md +++ b/packages/serverless-workflow-diagram-editor/stories/README.md @@ -22,7 +22,8 @@ This directory contains Storybook stories and documentation. - **`introduction/`** - Introductory documentation and welcome pages - **`features/`** - Component features and interactive stories -- **`examples/`** - Real-world workflow examples +- **`examples/`** - Serverless workflow specification example workflows +- **`use-cases/`** - Real-world use case examples - **`assets/`** - Images and media files used in stories ## Running Storybook diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml index 154da9f4..7ff4f67a 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/accumulate-room-readings.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml index 96bedce1..4042bb7c 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-oauth2.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml index 68b203c0..dfc47056 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/authentication-reusable.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml index 38344c01..5d8046af 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-publish.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml index 71663aaf..1df07d5d 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-asyncapi-subscribe-consume-forever-foreach.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml index ea5d21b0..b286d803 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-cataloged.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: samples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml index 0b7334cb..cf47dc3b 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-custom-function-inline.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: samples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml index b2565bbb..3d8e0721 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-grpc.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml index fee0d860..4310e03f 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-http-query-headers-expressions.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# # yaml-language-server: $schema=../schema/workflow.yaml document: dsl: "1.0.3" diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml index 56fd4fae..8bf44493 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-mcp.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml index 4812592c..7566be96 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/call-openapi.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml index 746edaab..ee6c81c3 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/conditional-task.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml index a6bc4bf2..18686063 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-multiple.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml index 7b10fae9..f58374c3 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/do-single.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml index 7b04c10b..6b77fe71 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/emit.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml index 047a4a9d..0b9a7259 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/for.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml index 38bb8a93..4e03835b 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/fork.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml index 4c41269e..3f01e2ef 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-all.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml index 7a98010c..69a4ac8a 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-any-forever-foreach.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml index 5ed2fe67..5c5acc00 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/listen-to-one.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml index 8d96f764..27834258 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/mock-service-extension.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml index 3ebb08dd..00bcaaa3 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/raise-reusable.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml index f11bbfc7..9a734013 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-container-stdin-and-arguments.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml index 6a886b97..ba68f7e8 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-return-all.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml index 90bd479f..2c4cea89 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-script-with-stdin-and-arguments.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: 1.0.3 namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml index f79da0bc..1fe04ded 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-shell-stdin-and-arguments.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: 1.0.3 namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml index 384329d3..c53a90c9 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/run-subflow.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml index 45f2d280..166ec6e7 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-cron.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml index b8f91ba7..0db682c0 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/schedule-event-driven.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: examples diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml index 5d06a981..716079e6 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/set.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml index e1e5fbb9..42bd702c 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/star-wars-homeworld.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# # yaml-language-server: $schema=../schema/workflow.yaml document: dsl: "1.0.3" diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml index 7f38d14f..4b681917 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/switch-then-string.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml index f9e554f6..15b24aea 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-retry-reusable.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml index 93da3500..99fbc645 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/try-catch-then.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml index 877ba1ed..d1e21ff1 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/examples/workflows/wait-duration-inline.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: test diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml index a6ff6553..6b1a76be 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/automated-data-backup.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml index 6a23cd5f..7cca3495 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-ev-charging-stations.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml index 5a66dcbf..dd10f755 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/managing-github-issues.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml index 3435f0f4..1f6828e9 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/workflows/multi-agent-ai-content-generation.yaml @@ -1,3 +1,18 @@ +# +# Copyright 2021-Present 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. +# document: dsl: "1.0.3" namespace: default From 156fa167be3898e17630d1e73e8894e047877362 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Thu, 4 Jun 2026 12:42:14 +0100 Subject: [PATCH 10/14] fix according to suggestions Signed-off-by: Cheryl Kong --- ...rumpy-buttons-cheat.md => storybook-styling.md} | 0 .../{ready-ties-burn.md => workflow-examples.md} | 0 .../stories/README.md | 2 +- .../stories/examples/Examples.stories.tsx | 4 ---- .../stories/use-cases/UseCases.stories.tsx | 14 ++++++-------- 5 files changed, 7 insertions(+), 13 deletions(-) rename .changeset/{grumpy-buttons-cheat.md => storybook-styling.md} (100%) rename .changeset/{ready-ties-burn.md => workflow-examples.md} (100%) diff --git a/.changeset/grumpy-buttons-cheat.md b/.changeset/storybook-styling.md similarity index 100% rename from .changeset/grumpy-buttons-cheat.md rename to .changeset/storybook-styling.md diff --git a/.changeset/ready-ties-burn.md b/.changeset/workflow-examples.md similarity index 100% rename from .changeset/ready-ties-burn.md rename to .changeset/workflow-examples.md diff --git a/packages/serverless-workflow-diagram-editor/stories/README.md b/packages/serverless-workflow-diagram-editor/stories/README.md index 6fd24cf6..68f44e6a 100644 --- a/packages/serverless-workflow-diagram-editor/stories/README.md +++ b/packages/serverless-workflow-diagram-editor/stories/README.md @@ -22,7 +22,7 @@ This directory contains Storybook stories and documentation. - **`introduction/`** - Introductory documentation and welcome pages - **`features/`** - Component features and interactive stories -- **`examples/`** - Serverless workflow specification example workflows +- **`examples/`** - Serverless workflow specification examples - **`use-cases/`** - Real-world use case examples - **`assets/`** - Images and media files used in stories diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index e6483104..0df81199 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -44,10 +44,6 @@ const DEFAULT_STORY_ARGS = { * @returns Story configuration object */ const createWorkflowStory = (workflowContent: string): Story => { - if (!workflowContent || workflowContent.trim().length === 0) { - console.warn("Empty workflow content provided to story"); - } - return { args: { ...DEFAULT_STORY_ARGS, diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx index 1475da3c..5382c9c7 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -38,10 +38,6 @@ const DEFAULT_STORY_ARGS = { } as const; const createWorkflowStory = (workflowContent: string): Story => { - if (!workflowContent || workflowContent.trim().length === 0) { - console.warn("Empty workflow content provided to story"); - } - return { args: { ...DEFAULT_STORY_ARGS, @@ -50,9 +46,11 @@ const createWorkflowStory = (workflowContent: string): Story => { }; }; -export const AutomatedDataBackup = createWorkflowStory(workflows.automatedDataBackup); -export const ManagingEVChargingStations = createWorkflowStory(workflows.managingEVChargingStations); -export const ManagingGithubIssues = createWorkflowStory(workflows.managingGithubIssues); -export const MultiAgentAIContentGeneration = createWorkflowStory( +export const AutomatedDataBackup: Story = createWorkflowStory(workflows.automatedDataBackup); +export const ManagingEVChargingStations: Story = createWorkflowStory( + workflows.managingEVChargingStations, +); +export const ManagingGithubIssues: Story = createWorkflowStory(workflows.managingGithubIssues); +export const MultiAgentAIContentGeneration: Story = createWorkflowStory( workflows.multiAgentAIContentGeneration, ); From 5df443f788e1fd0f927e1ce79593069d89a2a764 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Thu, 4 Jun 2026 12:56:11 +0100 Subject: [PATCH 11/14] fix: make Examples and Use-cases collapsed by default Signed-off-by: Cheryl Kong --- .../stories/examples/Examples.stories.tsx | 2 +- .../stories/use-cases/UseCases.stories.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index 0df81199..0469d728 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -19,7 +19,7 @@ import { DiagramEditor } from "../features/DiagramEditor"; import * as workflows from "./index"; const meta = { - title: "Examples", + title: "Examples/Examples", component: DiagramEditor, parameters: { layout: "fullscreen", diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx index 5382c9c7..b5aa500c 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -19,7 +19,7 @@ import { DiagramEditor } from "../features/DiagramEditor"; import * as workflows from "./index"; const meta = { - title: "Use Cases", + title: "Use Cases/Use Cases", component: DiagramEditor, parameters: { layout: "fullscreen", From ad1c476117fc3c9150b0a4aa7b1428c63fbf7765 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Thu, 4 Jun 2026 12:59:39 +0100 Subject: [PATCH 12/14] fix copilot complaints Signed-off-by: Cheryl Kong --- .../stories/examples/Examples.stories.tsx | 2 +- .../stories/examples/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index 0469d728..7a2926e3 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -74,7 +74,7 @@ export const ConditionalTask: Story = createWorkflowStory(workflows.conditionalT export const DoMultiple: Story = createWorkflowStory(workflows.doMultiple); export const DoSingle: Story = createWorkflowStory(workflows.doSingle); export const Emit: Story = createWorkflowStory(workflows.emit); -export const For: Story = createWorkflowStory(workflows.for); +export const For: Story = createWorkflowStory(workflows.forExample); export const Fork: Story = createWorkflowStory(workflows.fork); export const ListenToAll: Story = createWorkflowStory(workflows.listenToAll); export const ListenToOne: Story = createWorkflowStory(workflows.listenToOne); diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/index.ts b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts index f66d88ca..037f6ebf 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/index.ts +++ b/packages/serverless-workflow-diagram-editor/stories/examples/index.ts @@ -29,7 +29,7 @@ export { default as conditionalTask } from "./workflows/conditional-task.yaml?ra export { default as doMultiple } from "./workflows/do-multiple.yaml?raw"; export { default as doSingle } from "./workflows/do-single.yaml?raw"; export { default as emit } from "./workflows/emit.yaml?raw"; -export { default as for } from "./workflows/for.yaml?raw"; +export { default as forExample } from "./workflows/for.yaml?raw"; export { default as fork } from "./workflows/fork.yaml?raw"; export { default as listenToAll } from "./workflows/listen-to-all.yaml?raw"; export { default as listenToOne } from "./workflows/listen-to-one.yaml?raw"; From 099503e9944a813f82cf546bbf9a545dddb00341 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Thu, 4 Jun 2026 13:04:13 +0100 Subject: [PATCH 13/14] fix copilot complaints Signed-off-by: Cheryl Kong --- .../stories/examples/Examples.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index 7a2926e3..b20960ec 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -65,7 +65,7 @@ export const CallCustomFunctionInline: Story = createWorkflowStory( workflows.callCustomFunctionInline, ); export const CallGrpc: Story = createWorkflowStory(workflows.callGrpc); -export const CallHttpQueryHeadersExpression: Story = createWorkflowStory( +export const CallHttpQueryHeadersExpressions: Story = createWorkflowStory( workflows.callHttpQueryHeadersExpressions, ); export const CallMCP: Story = createWorkflowStory(workflows.callMCP); From 8a03a2c8faa018edc5433537d6e6e44dbdbf7485 Mon Sep 17 00:00:00 2001 From: Cheryl Kong Date: Fri, 5 Jun 2026 14:47:10 +0100 Subject: [PATCH 14/14] fix: rename storybook sections Signed-off-by: Cheryl Kong --- .../stories/examples/Examples.stories.tsx | 2 +- .../stories/use-cases/UseCases.stories.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx index b20960ec..fd721e89 100644 --- a/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/examples/Examples.stories.tsx @@ -19,7 +19,7 @@ import { DiagramEditor } from "../features/DiagramEditor"; import * as workflows from "./index"; const meta = { - title: "Examples/Examples", + title: "Examples/Workflows", component: DiagramEditor, parameters: { layout: "fullscreen", diff --git a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx index b5aa500c..ec24d731 100644 --- a/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx +++ b/packages/serverless-workflow-diagram-editor/stories/use-cases/UseCases.stories.tsx @@ -19,7 +19,7 @@ import { DiagramEditor } from "../features/DiagramEditor"; import * as workflows from "./index"; const meta = { - title: "Use Cases/Use Cases", + title: "Use Cases/Workflows", component: DiagramEditor, parameters: { layout: "fullscreen",