Skip to content

Create first workflow

Gurmit Teotia edited this page Sep 21, 2019 · 9 revisions

To create a workflow in Guflow you need to:

  • Create a class and derive it form Guflow.Workflow class
  • Decorate the newly created class with WorkflowDescriptionAttribute
  • Provide the required "Version" property

Following example creates an empty workflow which will be completed as soon as it is started:

[WorkflowDescription("Version 1.0")]
public class TranscodeWorkflow : Workflow
{
}

By convention Guflow uses the class's name as the workflow name while interacting with Amazon SWF. In above example Guflow will name above workflow as "TranscodeWorkflow". However you can give different name to the workflow as shown in the following example:

[WorkflowDescription("Version 1.0", Name= "VideoTranscodeWorkflow")]
public class TranscodeWorkflow : Workflow
{
}

WorkflowDescriptionAttribute has many other properties which are required when starting a workflow. However Guflow (and also Amazon SWF) provides you the flexibility to supply them at different stage- either during registration or when you are about to start the workflow.

Clone this wiki locally