goflow

command module
v0.0.0-...-23becbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

GoFlow

Goflow is a microservice orchestration workflows inspired from Netflix Conductor & Erlang's FSM

STILL IN DEVELOPMENT!

Netflix Conductor

Overview

The Netflix Content Platform Engineering team runs a number of business processes which are driven by asynchronous orchestration of tasks executing on microservices.

Objectives
  • Blueprint based, json DSL
  • Workflow management including tracking
  • Able to delay the task & resume
  • Operate over HTTP or other transports ex: GRPC

FSM

Example Transitions

From Erlang's FSM Documentation:

A FSM can be described as a set of relations of the form:

State(S) x Event(E) -> Actions (A), State(S')

Flows:

State(current) -> Event (triggered) -> Action (worker) -> State(next)

If we are in state S and the event E occurs, we should perform the action of A and move the transition to next state S'.

References:


JSON DSL

Workflow Metadata

{
  "project": "goflow",
  "activity": "inquiry",
  "states": [
    "calculate_balance",
    "get_product",
	"calculate_voucher"
  ],
	"actions": [
		{
			"name": "calculate_balance",
			"type": "sync"
		},
		{
			"name": "get_product",
			"type": "sync"
		},
		{
			"name": "calculate_voucher",
			"type": "sync"
		}
	],
	"transitions": [
		{
			"current": "init",
			"event": "start",
			"action": "calculate_balance",
			"next": "calculate_balance"
		},
		{
			"current": "calculate_balance",
			"event": "success",
			"action": "continue",
			"next": "get_product"
		},
		{
			"current": "calculate_balance",
			"event": "error",
			"action": "continue",
			"next": "done"				
		},
		{
			"current": "get_product",
			"event": "start",
			"action": "get_product",
			"next": "get_product"		
		},
		{
			"current": "get_product",
			"event": "success",
			"action": "continue",
			"next": "calculate_voucher"		
		},
		{
			"current": "calculate_voucher",
			"event": "start",
			"action": "continue",
			"next": "calculate_voucher"		
		},
	]
}

Worker Metadata

{
	"project": "goflow",
	"activity": "inquiry",
	"workers": [
		{
			"name": "calculate_balance",
			"workerEndpoint": "worker_url",
			"retryCount": 3,
			"responseTimeout": 5,
			"priority": 1
		},
		{
			"name": "calculate_balance",
			"workerEndpoint": "worker_url_2",
			"retryCount": 3,
			"responseTimeout": 5,
			"priority": 2
		},
		{
			"name": "get_product",
			"workerEndpoint": "worker_url",
			"retryCount": 2,
			"responseTimeout": 5,
			"priority": 1
		},
		{
			"name": "calculate_voucher",
			"workerEndpoint": "worker_url",
			"retryCount": 5,
			"responseTimeout": 5,
			"priority": 1
		},
		{
			"name": "done",
			"workerEndpoint": "worker_url",
			"retryCount": 5,
			"responseTimeout": 5,
			"priority": 1		
		}
	]
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL