iWF project - main & server repo
For most long running applications, iWF is a All-In-One solution to replace Database, MessageQueue and ElasticSearch.
It will not make you a 10x developer...but you may feel like one!
It's a simple and powerful WorkflowAsCode general purpose workflow engine.
Back by Cadence/Temporal as an interpreter.
Related projects:
What & Why
If you are not
- Check out this doc to understand some history
iWF is a application platform that provides you a comprehensive tooling:
- WorkflowAsCode for highly flexibile/customizable business logic
- Parallel execution of multiple threads of business
- Intermidiate states stored as "QueryAttributes" and can be retrived by APIs
- Receiving data from external system by Signal
- Searchable attributes that can be used for flexible searching, even full text searching, backed by ElasticSearch
- Durable timer, and cron job scheduling
- Reset workflow to let you recover the workflows from bad states easily
- ...
- Basically with iWF, you mostly don't need any database, messageQueue or even ElasticSearch to build your applications
How to build & run
- Run
make bins to build the binary iwf-server
- Then run
./iwf-server start to run the service . This defaults to serve workflows APIs with Temporal interpreter implementation. It requires to have local Temporal setup. See Run with local Temporal.
- Alternatively, run
./iwf-server --config config/development_cadence.yaml start to run with local Cadence. See below instructions for setting up local Cadence.
- Run
make integTests to run all integration tests. This by default requires to have both local Cadence and Temporal to be set up.
Development
Update IDL and generated code
- Install openapi-generator using Homebrew if you haven't. See more documentation
- Check out the idl submodule by running the command:
git submodule update --init --recursive
- Run the command
git submodule update --remote --merge to update IDL to the latest commit
- Run
make idl-code-gen to refresh the generated code
Run with local Temporalite
- Run a local Temporalite following the instruction. If you see error
error setting up schema, try use command temporalite start --namespace default -f my_test.db instead to start.
- Go to http://localhost:8233/ for Temporal WebUI
NOTE: alternatively, go to Temporal-dockercompose to run with docker
- For
attribute_test.go integTests, you need to register search attributes:
tctl adm cl asa -n CustomKeywordField -t Keyword
tctl adm cl asa -n CustomIntField -t Int
Run with local Cadence
- Run a local Cadence server following the instructions
- Register a new domain if not haven
cadence --do default domain register
- Go to Cadence http://localhost:8088/domains/default/workflows?range=last-30-days
Development Plan
1.0
- Start workflow API
- Executing
start/decide APIs and completing workflow
- Parallel execution of multiple states
- Timer command
- Signal command
- SearchAttributeRW
- QueryAttributeRW
- StateLocalAttribute
- Signal workflow API
- Query workflow API
- Get workflow API
- Search workflow API
1.1
- Reset workflow API (Cadence only, TODO for Temporal)
- Command type(s) for inter-state communications (e.g. internal channel)
- More workflow start options: IdReusePolicy, initial earch attributes, cron schedule, retry, etc
- StateOption: Start/Decide API timeout and retry
- Reset workflow by stateId
1.2
- AnyCommandCompleted Decider trigger type and WaitForMoreResults in StateDecision
- Decider trigger types: AnyCommandClosed
- Skip timer API for testing/operation
- LongRunningActivityCommand
- Failing workflow details
- Auto ContinueAsNew
- StateOption: more AttributeLoadingPolicy
- StateOption: more CommandCarryOverPolicy