indeedeng / iwf

iWF is a WorkflowAsCode microservice orchestration platform offering an orchestration coding framework and service for building resilient, fault-tolerant, scalable long-running processes
MIT License
543 stars 55 forks source link

NodeJS/TypeScript SDK #181

Open longquanzheng opened 1 year ago

longquanzheng commented 1 year ago

As discussed in the slack channel

https://iwfglobal.slack.com/archives/C048NCNLZB9/p1675787722020629

24601 commented 1 year ago

@longquanzheng - We are evaluating options for workflow engines/solutions (I am the CTO @ agileonboarding.com), we are a heavy nodejs/ts shop, your comments on HN and other outlets lead me to believe that a TS SDK would not be difficult and iWF seems like a very good option for us so far in looking at it.

If there is a bit more specificity in what such an SDK would require to implement, we would consider doing so.

longquanzheng commented 1 year ago

@24601 great to hear that. I also think that iWF will be a great tool for nodejs/ts developer. I would suggest to "translate" the implementation of either Java or Go SDK. Use either of them based on your preference/familiarity of the language. Or at least understand how it works -- it should be simple enough. Here I assume you use Java(based on your Github profile)

When you are ready to start, I would suggest to implement it from simple as the below steps:

Step 1: Basic workflow execution with IO/parallel

The minimum of the SDK just be able to start and execute a basic IO workflow without any additional features like more deciderTriggerType/signalComand/timerComand/dataObject/searchAttributes/workflowOptions/workflowStateOptions/complicated error handling etc.

The acceptance criteria is to be able to implement and execute a workflow like this: https://github.com/indeedeng/iwf-java-sdk/blob/main/src/test/java/io/iworkflow/integ/basic/BasicWorkflow.java

And execute it (ignore the error handling assertion for now): https://github.com/indeedeng/iwf-java-sdk/blob/main/src/test/java/io/iworkflow/integ/BasicTest.java#L31

To implement this, you need the below components:

The first step may take longer time than the rest as per step, as it set up all the foundation of the work.

===================== You can start with the step 1 and let me know how it works. I will add more details to the below steps later when you are finishing the first step.

Step 2: Add Timer command

Step 3: Add Signal command

Step 4: Add interStateChannel command

Step 5: Add more decider trigger type

Step 6: Add DataObject persistence

Step 7: Add Search attribute persistence

Step 8: Add the other client API and error handling, and workflow Options and stateOptions

24601 commented 1 year ago

@longquanzheng - thank you so very much, this is very helpful. I will evaluate this and get started as soon as I can based on our product plan/roadmap.

longquanzheng commented 1 year ago

https://github.com/indeedeng/iwf-ts-sdk is being implemented