1.5.0 • Published 10 months ago

@letsflow/core v1.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

letsflow CI

Letsflow is a human-centric workflow automation engine that blends automation with human decision-making, enabling dynamic interactions between people and automated steps.

actors:
  user:
    title: The user
    properties:
      feeling: !default sad

actions:
  complete:
    title: Complete the process
    update:
      set: actors.user.feeling
      value: happy

states:
  initial:
    on: complete
    goto: (done)

The scenario models a process as a fine-state machine. The actors are persons, organizations, or systems that can participate in the process by performing actions. Which actions can be performed depends on the current state of the process. By executing an action, the process can transition to a different state.

Read the documentation

Installation

yarn add @letsflow/core

Example usage

import { normalize } from '@letsflow/core/scenario';
import { chain, instantiate, step } from '@letsflow/core/process';

const scenario = normalize({
  title: 'My first scenario',
  actors: {
    user: {
      title: 'The user',
      properties: {
        feeling: {
          type: 'string',
          default: 'sad'
        }
      }
    }
  },
  actions: {
    complete: {
      title: 'Complete the process',
      update: {
        set: 'actors.user.feeling',
        value: 'happy'
      }
    }
  },
  states: {
    initial: {
      on: 'complete',
      goto: '(done)'
    }
  }
});

const process = chain(
  instantiate(scenario),
  (process) => step(process, 'complete', 'user')
);

console.log(process.current.key); // (done)
console.log(process.actors.user.feeling); // happy
1.5.0

10 months ago

1.4.4

10 months ago

1.4.3

10 months ago

1.4.2

10 months ago

1.4.1

10 months ago

1.4.0

10 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago