Provide a summary of the following github project readme file, including the purpose of the project, what problems it may be used to solve, and anything the author mentions that differentiates this project from others:Title: A Brand New “Workflow as Code” Execution Engine Site: iWF project - main & server repo iWF will make you a 10x developer! iWF is a platform providing all-in-one tooling for building long-running business application. It provides an abstraction for persistence(database, elasticSearch) and more, with clean, simple and easy to use interface. It's a simple and powerful WorkflowAsCode general purpose workflow engine. The server is back by Cadence/Temporal as an interpreter, preserved the same power of Cadence/Temporal(including scalability/reliability). Related projects: * OpenAPI definition between SDKs and server. * iWF Java SDK * iWF Java Samples * Product use case example: subscription * iWF Golang SDK * iWF Golang Samples * Product use case example: subscription Table of contents Community & Help What is iWF Architecture Basic Concepts Workflow and WorkflowState definition Workflow execution and WorkflowState execution Commands Persistence Communication Workflow Diagram Client APIs Why iWF If you are familiar with Cadence/Temporal If you are not How to run this server Using docker image & docker-compose How to build & run locally How to use in production Monitoring and Operations iWF server iWF application Debug & Troubleshooting Operation Development Plan How to migrate from Cadence/Temporal Some history Contribution Posts & Articles Community & Help Slack Channels Github Discussion StackOverflow Github Issues What is iWF Architecture An iWF application includes a set of iWF workflow workers which host two REST APIs of WorkflowState start and decide. The application calls an iWF server to operate on workflow executions -- start, stop, signal, get results, etc, using iWF SDKs. The iWF server hosts those APIs(also REST) as a iWF API service. Internally the API service will call Cadence/Temporal service as the backend. The iWF server also includes Cadence/Temporal workers which host an interpreter workflow. Internally, any iWF workflows are interpreted into this Cadence/Temporal workflow. The interpreter workflow will invoke the two application worker APIs(start and decide). The API invocations are implemented by Cadence/Temporal activities. Therefore, all the REST API request/response with the worker are stored in history events which are useful for debugging/troubleshooting, and no replay is needed for application workflow code. See Design doc for more details. Basic Concepts Workflow and WorkflowState definition A long-running process is called Workflow. iWF lets you build long-running applications by implementing the workflow interface, e.g. Java Workflow interface or Golang Workflow interface. An instance of the interface is a WorkflowDefinition. User applications use IwfWorkflowType to differentiate WorkflowDefinitions. A WorkflowDefinition contains several WorkflowState e.g. Java WorkflowState interface or Golang WorkflowState interface. A WorkflowState is implemented with two APIs: start and decide. * start API is invoked immediately when a WorkflowState is started. It will return some Commands to server. When the requested Commands are completed, decide API will be triggered. The number of commands can be zero, one or multiple. * decide API will decide next states to execute. Next states can be zero, one or multiple, and can be re-executed as different stateExecutions. Workflow execution and WorkflowState execution Application can start a workflow instance with a workflowId for any workflow definition. A workflow instance is called WorkflowExecution. iWF server returns runId of UUID as the identifier of the WorkflowExecution. The runId is globally unique. :warning: Note: Depends on the context, the only word workflow may mean WorkflowExecution(most commonly), WorkflowDefinition or both. For a running WorkflowExecution, there must be at least one WorkflowState being executed, otherwise the workflow execution will complete. An execution instance of WorkflowState is called StateExecution, which by identified StateExecutionId. A StateExecutionId is formatted as -. StateId is defined by workflow state definition, while Number is how many times this StateId has been executed. StateExecutionId is only unique within the workflow execution. WorkflowId uniqueness and reuse: For the same workflowId, there must be at most one WorkflowExecution running at anytime. However, after a previous WorkflowExecution finished running (in any closed status), application may start a new WorkflowExecution with the same workflowId using appropriate IdReusePolicy. Commands These are the three command types: * SignalCommand: will be waiting for a signal from external to the workflow signal channel. External application can use SignalWorkflow API to signal a workflow. * TimerCommand: will be waiting for a durable timer to fire. * InterStateChannelCommand: will be waiting for a value being published from another state in the same workflow execution Note that start API can return multiple commands, and choose different DeciderTriggerType for triggering decide API: * AllCommandCompleted: this will wait for all command completed * AnyCommandCompleted: this will wait for any command completed * AnyCommandCombinationCompleted: this will wait for a list of command combinations on any combination completed Persistence iWF provides super simple persistence abstraction. Developers don't need to touch any database system to register/maintain the schemas. The only schema is defined in the workflow code. * DataObject is * sharing some data values across the workflow * can be retrieved by external application using GetDataObjects API * can be viewed in Cadence/Temporal WebUI in QueryHandler tab * SearchAttribute is similarly: * sharing some data values across the workflow * can be retrieved by external application using GetSearchAttributes API * search for workflows by external application using SearchWorkflow API * search for workflows in Cadence/Temporal WebUI in Advanced tab * search attribute type must be registered in Cadence/Temporal server before using for searching because it is backed up ElasticSearch * the data types supported are limited as server has to understand the value for indexing * See Temporal doc and Cadence doc to understand more about SearchAttribute * StateLocal is for * passing some data values from state API to decide API in the same WorkflowState execution * RecordEvent is for * recording some events within the state execution. They are useful for debugging using Workflow history. Usually you may want to record the input/output of the dependency RPC calls. Logically, each workflow type will have a persistence schema like below: text +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ | workflowId | runId | dataObject key1 | dataObject key2 | searchAttribute key1 | searchAttribute key2 | ... | +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ | your-wf-id1 | uuid1 | valu1 | value2 | keyword-value1 | 123(integer) | ... | +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ | your-wf-id1 | uuid2 | value3 | value4 | keyword-value2 | 456(integer) | ... | +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ | your-wf-id2 | uuid3 | value5 | value5 | keyword-value3 | 789(integer) | ... | +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ | ... | ... | ... | ... | ... | ... | ... | +-------------+-------+-----------------+-----------------+----------------------+----------------------+-----+ Communication There are two major communication mechanism in iWF: * SignalChannel is for receiving input from external asynchronously. It's used with SignalCommand. * InterStateChannel: for interaction between state executions. It's used with InterStateChannelCommand. iWF workflow design diagram When designing an iWF workflow, it's useful to use iWF state diagrams like this template for visualization. For example, the subscription workflow diagram: * Java sample * Golang sample Client APIs Client APIs are hosted by iWF server for user workflow application to interact with their workflow executions. * Start workflow: start a new workflow execution * Stop workflow: stop a workflow execution * Signal workflow: send a signal to a workflow execution * Search workflow: search for workflows using a query language like SQL with search attributes * Get workflow: get basic information about a workflow like status and results(if completed or waiting for completed) * Get workflow data objects: get the dataObjects of a workflow execution * Get workflow search attributes: get the search attributes of a workflow execution * Reset workflow: reset a workflow to previous states * Skip timer: skip a timer of a workflow (usually for testing or operation) Why iWF If you are familiar with Cadence/Temporal Check iWF vs Cadence/Temporal for comparison with Cadence/Temporal. If you are not Check out this article to understand difference between iWF and other workflow engines. iWF is an application platform that provides you a comprehensive tooling: * WorkflowAsCode for highly flexible/customizable business logic * Parallel execution of multiple threads of business * Persistence storage for intermediate states stored as "dataObjects" * Persistence searchable attributes that can be used for flexible searching, even full text searching, backed by ElasticSearch * Receiving data from external system by Signal * Durable timer, and cron job scheduling * Reset workflow to let you recover the workflows from bad states easily * Highly testable and easy to maintain * ... How to run this server Using docker image & docker-compose Checkout this repo, go to the docker-compose folder and run it: shell cd docker-compose && docker-compose up This by default will run Temporal server with it. And it will also register a default namespace and required search attributes by iWF. Link to WebUI: http://localhost:8233/namespaces/default/workflows By default, iWF server is serving port 8801, server URL is http://localhost:8801/ ) NOTE: Use docker pull iworkflowio/iwf-server:latest to update the latest image.Or update the docker-compose file to specify the version tag. How to build & run locally Run make bins to build the binary iwf-server Make sure you have registered the system search attributes required by iWF server: Keyword: IwfWorkflowType Int: IwfGlobalWorkflowVersion Keyword: IwfExecutingStateIds See Contribution for more detailed commands. 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. How to use in production You can customize the docker image, or just use the api and interpreter that are exposed as the api service an