Versions in this module Expand all Collapse all v0 v0.0.1 Nov 22, 2025 Changes in this version + const EVENT_ERROR + const EVENT_FLOW_DELETE + const EVENT_FLOW_SET + const EVENT_FLOW_STATUS + const EVENT_WORKFLOW_DELETE + const EVENT_WORKFLOW_SET + const EVENT_WORKFLOW_STATUS + const MSG_ARG_REQUIRED + const MSG_FLOW_CREATED + const MSG_FLOW_NOT_FOUND + const MSG_FLOW_NOT_INSTANCE + const MSG_ID_REQUIRED + const MSG_INSTANCE_ALREADY_DONE + const MSG_INSTANCE_ALREADY_RUNNING + const MSG_INSTANCE_CONSISTENCY + const MSG_INSTANCE_DEBUG + const MSG_INSTANCE_DEFINITION_EMPTY + const MSG_INSTANCE_EVALUATE + const MSG_INSTANCE_EXISTS + const MSG_INSTANCE_EXPRESSION_FALSE + const MSG_INSTANCE_EXPRESSION_TRUE + const MSG_INSTANCE_FAILED + const MSG_INSTANCE_GOTO + const MSG_INSTANCE_GOTO_USER_DECISION + const MSG_INSTANCE_ID_REQUIRED + const MSG_INSTANCE_IFELSE + const MSG_INSTANCE_INSTANCE_DEC + const MSG_INSTANCE_INSTANCE_INC + const MSG_INSTANCE_LOAD + const MSG_INSTANCE_NOT_FOUND + const MSG_INSTANCE_PENDING + const MSG_INSTANCE_RESILIENCE + const MSG_INSTANCE_RETENTION + const MSG_INSTANCE_ROLLBACK + const MSG_INSTANCE_ROLLBACK_CREATED + const MSG_INSTANCE_ROLLBACK_FAILED + const MSG_INSTANCE_ROLLBACK_STEP + const MSG_INSTANCE_RUN + const MSG_INSTANCE_STATUS + const MSG_INSTANCE_STEP_CREATED + const MSG_INSTANCE_WORKFLOWS_IS_NIL + const MSG_START_WORKFLOW + const MSG_WORKFLOW_DELETE + const MSG_WORKFLOW_DONE_INSTANCE + const MSG_WORKFLOW_LIMIT_REQUESTS + func Continue(instanceId string, tags et.Json, ctx et.Json, createdBy string) (et.Json, error) + func DeleteFlow(tag string) error + func DeleteInstance(instanceId string) error + func HealthCheck() bool + func Load() error + func OnDeleteFlow(f DeleteFlowFn) + func OnDeleteInstance(f DeleteInstanceFn) + func OnLoadFlow(f LoadFlowFn) + func OnLoadInstance(f LoadInstanceFn) + func OnSaveFlow(f SaveFlowFn) + func OnSaveInstance(f SaveInstanceFn) + func Reset(instanceId, createdBy string) error + func Rollback(instanceId string) (et.Json, error) + func Run(instanceId, tag string, startId int, tags et.Json, ctx et.Json, ...) (et.Json, error) + func Stop(instanceId string) error + type DeleteFlowFn func(tag string) error + type DeleteInstanceFn func(id string) error + type Flow struct + CreatedBy string + Description string + Level string + Name string + RetentionTime time.Duration + Steps []*Step + Tag string + Team string + TimeAttempts time.Duration + TotalAttempts int + TpConsistency TpConsistency + Version string + func New(tag, version, name, description string, definition string, stop bool, ...) *Flow + func NewByFile(tag, version, name, description string, filePath string, stop bool, ...) *Flow + func NewFn(tag, version, name, description string, fn FnContext, stop bool, ...) *Flow + func (s *Flow) Consistency(consistency TpConsistency) *Flow + func (s *Flow) Debug() *Flow + func (s *Flow) IfElse(expression string, yesGoTo int, noGoTo int) *Flow + func (s *Flow) Resilence(totalAttempts int, timeAttempts time.Duration, team string, level string) *Flow + func (s *Flow) Retention(retentionTime time.Duration) *Flow + func (s *Flow) Rollback(fn FnContext) *Flow + func (s *Flow) Save() error + func (s *Flow) Step(name, description string, definition string, stop bool) *Flow + func (s *Flow) StepByFile(name, description string, filePath string, stop bool) *Flow + func (s *Flow) StepFn(name, description string, fn FnContext, stop bool) *Flow + func (s *Flow) ToJson() et.Json + type FlowStatus string + const FlowStatusDone + const FlowStatusFailed + const FlowStatusPending + const FlowStatusRunning + type FnContext func(flow *Instance, ctx et.Json) (et.Json, error) + type Instance struct + CreatedAt time.Time + CreatedBy string + Ctx et.Json + Ctxs map[int]et.Json + Current int + DoneAt time.Time + Id string + PinnedData et.Json + Results map[int]*Result + Rollbacks map[int]*Result + Status FlowStatus + Tag string + Tags et.Json + UpdatedAt time.Time + UpdatedBy string + WorkerHost string + func GetInstance(instanceId string) (*Instance, error) + func (s *Instance) Done() error + func (s *Instance) Goto(step int) error + func (s *Instance) Save() error + func (s *Instance) SetCtx(ctx et.Json) et.Json + func (s *Instance) SetPinnedData(key string, value interface{}) + func (s *Instance) SetResult(result et.Json, err error) (et.Json, error) + func (s *Instance) SetStatus(status FlowStatus) error + func (s *Instance) SetStep(val int) + func (s *Instance) SetTags(tags et.Json) + func (s *Instance) Stop() error + func (s *Instance) ToJson() et.Json + type LoadFlowFn func(tag string) (*Flow, error) + type LoadInstanceFn func(id string) (*Instance, error) + type Result struct + Attempt int + Ctx et.Json + Error string + Result et.Json + Step int + func (s *Result) Serialize() (string, error) + func (s *Result) ToJson() et.Json + type SaveFlowFn func(flow *Flow) error + type SaveInstanceFn func(instance *Instance) error + type Step struct + Definition string + Description string + Expression string + Name string + NoGoTo int + Stop bool + Type TpStep + YesGoTo int + func (s *Step) ToJson() et.Json + type TpConsistency string + const TpConsistencyEventual + const TpConsistencyStrong + type TpStep string + const TpDefinition + const TpFn + type WorkFlows struct + Flows map[string]*Flow + Instances map[string]*Instance + func (s *WorkFlows) Add(instance *Instance) + func (s *WorkFlows) Count() int + func (s *WorkFlows) Remove(instanceId string)