Awesome
iwf-golang-samples
Samples for iWF Golang SDK that runs against iWF server
Setup
- Start a iWF server following the instructions
- Run this project
- To build the binary, run
make bins
- To run the sample service: run
./iwf-samples start
Note that by default this project will listen on 8803 port(default worker port for iWF Golang SDK)
Product Use case samples
Money Transfer Workflow/SAGA Patten
This example shows how to transfer money from one account to another account. The transfer involves multiple steps. When any step fails, the whole transfer is canceled with some compensation steps.
Microservice orchestration
This is the code that is shown in iWF server as an example of microservice orchestration.
JobSeeker Engagement workflow
<img width="709" alt="Screenshot 2023-04-21 at 8 53 25 AM" src="https://user-images.githubusercontent.com/4523955/233680837-6a6267a0-4b31-419e-87f0-667bb48582d1.png"> This engagement workflow is for:- An engagement is initiated by an employer to reach out to a jobSeeker(via email/SMS/etc)
- The jobSeeker could respond with decline or accept
- If jobSeeker doesn't respond, it will get reminder
- An engagement can change from declined to accepted, but cannot change from accepted to declined
Subscription workflow
This Subscription workflow (with unit tests) is to match the use case described in
Task orchestration with polling & signal
Orchestrating three services:
- Task A: receive a signal when completing
- Task B: receive a signal when completing
- Task C: polling until completion