https://github.com/serverlessworkflow/sdk-net
.NET SDK for Serverless Workflow
https://github.com/serverlessworkflow/sdk-net
cncf dotnet sdk serverless workflow
Last synced: 5 months ago
JSON representation
.NET SDK for Serverless Workflow
- Host: GitHub
- URL: https://github.com/serverlessworkflow/sdk-net
- Owner: serverlessworkflow
- License: apache-2.0
- Created: 2021-03-29T12:04:45.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T13:28:33.000Z (about 1 year ago)
- Last Synced: 2025-10-07T06:54:02.120Z (6 months ago)
- Topics: cncf, dotnet, sdk, serverless, workflow
- Language: C#
- Homepage: https://serverlessworkflow.io
- Size: 1.31 MB
- Stars: 59
- Watchers: 4
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Serverless Workflow .NET SDK
The official .NET SDK for the [Serverless Workflow DSL](https://github.com/serverlessworkflow/specification/blob/main/dsl.md).
The SDK is composed of three Nuget packages:
- [Core](#), which contains the models of the Serverless Workflow DSL
- [Builders](#), which contains service used to build workflow definitions programmatically
- [IO](#), which contains the services used to read and write workflow definitions
## Installation
Core:
```bash
dotnet add package ServerlessWorkflow.Sdk
```
Builders:
```
dotnet add package ServerlessWorkflow.Sdk.Builders
```
IO:
```
dotnet add package ServerlessWorkflow.Sdk.IO
```
## Example usage
Building a workflow definition programmatically:
```c#
var definition = new WorkflowDefinitionBuilder()
.WithName("fake-workflow")
.WithVersion("0.1.0:fake")
.Do("todo-1", task => task
.Call("http")
.With("method", "get")
.With("uri", "https://fake-api.com"))
.Build();
```
Reading and writing a workflow definition:
```c#
using var inputStream = File.OpenRead("workflow.yaml");
var reader = WorkflowDefinitionReader.Create();
var workflow = await reader.ReadAsync(inputStream);
using var outputStream = File.Create("workflow.yaml");
var writer = WorkflowDefinitionWriter.Create();
await writer.WriteAsync(workflow, stream, WorkflowDefinitionFormat.Yaml);
```