I developed the open source .NET library - Guflow for programming Amazon SWF. Here's how you can write a workflow to transcode a video:
[WorkflowDescription("1.0")] public class TranscodeWorkflow : Workflow { public TranscodeWorkflow() {
In the example above, for clarity, I did not route the task. Here's how you can create activity:
[ActivityDescription("1.0")] public class DownloadActivity : Activity { //It supports both sync/async method. [ActivityMethod] public async Task<Response> Execute(string input) { //simulate downloading of file await Task.Delay(10); return new Response() { DownloadedFile = "downloaded path", PollingQueue = PollingQueue.Download}; } public class Response { public string DownloadedFile; } }
For clarity, I leave examples of other actions. Guflow supported documentation , tutorial and samples .
source share