Skip to content

Commit 45395cd

Browse files
committed
Update README file
#42
1 parent 35afd65 commit 45395cd

File tree

1 file changed

+68
-2
lines changed

1 file changed

+68
-2
lines changed

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,68 @@
1-
# C# SDK
2-
C# SDK for FlowSynx
1+
# FlowSynx.Client SDK for C#
2+
3+
**FlowSynx.Client** is a modern, extensible C# SDK designed to integrate seamlessly with
4+
the [FlowSynx Workflow Automation Engine](https://flowsynx.io), providing a streamlined way to interact with its powerful REST API.
5+
This SDK enables developers to manage workflows, plugins, executions, configurations, and more through a simple, fluent .NET API.
6+
7+
## 🚀 Features
8+
- Connect securely to FlowSynx via REST
9+
- Manage workflows and plugin configurations
10+
- Trigger and monitor workflow executions
11+
- Upload and retrieve logs and metadata
12+
- Authentication support (Basic, Bearer, and custom token handlers)
13+
- Lightweight, dependency-free architecture
14+
- Built for .NET 6.0+ with extensibility and clean architecture in mind
15+
16+
## 📦 Installation
17+
You can install the SDK via [NuGet](https://www.nuget.org/packages/FlowSynx.Client):
18+
19+
```
20+
dotnet add package FlowSynx.Client
21+
```
22+
23+
## 🧩 Usage
24+
1. Configure the Client
25+
26+
Make sure the blow package are added to you project:
27+
```
28+
dotnet add package Microsoft.Extensions.DependencyInjection
29+
dotnet add package Microsoft.Extensions.Hosting
30+
```
31+
32+
Then use the FlowSynx Client like following:
33+
```
34+
IAuthenticationStrategy authStrategy = new BasicAuthenticationStrategy("admin", "admin");
35+
36+
using IHost host = Host.CreateDefaultBuilder(args)
37+
.ConfigureServices((_, services) =>
38+
{
39+
services.AddHttpClient();
40+
services.AddSingleton<IFlowSynxServiceFactory, FlowSynxServiceFactory>();
41+
services.AddSingleton(authStrategy);
42+
services.AddSingleton<IFlowSynxClient, FlowSynxClient>();
43+
})
44+
.Build();
45+
46+
var client = host.Services.GetRequiredService<IFlowSynxClient>();
47+
```
48+
49+
2. List Available Workflows
50+
```
51+
var result = await _flowSynxClient.Workflows.ListAsync(cancellationToken);
52+
var workflows = result.Payload;
53+
foreach (var workflow in workflows)
54+
{
55+
Console.WriteLine($"{workflow.Id}: {workflow.Name}");
56+
}
57+
```
58+
59+
3. Execute a Workflow
60+
```
61+
Guid workflowId = Guid.Parse("YOUR-WORKFLOW-ID");
62+
var workflowRequest = new ExecuteWorkflowRequest { WorkflowId = workflowId };
63+
var result = await _flowSynxClient.Workflows.ExecuteAsync(workflowRequest, cancellationToken);
64+
```
65+
66+
## ✅ Requirements
67+
.NET 9.0 or later
68+
Compatible with Windows, Linux, macOS

0 commit comments

Comments
 (0)