dave-statemachine

A state machine node that stores state persistently, and uses diagrams generated with StateSmith

Package Information

Released: 6/23/2024
Downloads: 7 weekly / 14 monthly
Latest Version: 1.0.2
Author: kianmusser

Documentation

@kianmusser/n8n-nodes-dave-statemachine

This is an n8n community node for implementing a durable state machine.

The State Machine node allows you to create a state machine that persists across n8n executions by storing states in a PostgreSQL database. It supports generating the state machine code from diagrams drawn using draw.io and stored in GitHub, utilizing a program called StateSmith for code generation.

n8n is a fair-code licensed workflow automation platform.

Installation
Operations
Credentials
Compatibility
Usage
Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Operations

  • Create and manage state machines
  • Persist state machine states in PostgreSQL
  • Generate state machine code from draw.io diagrams stored in GitHub

Credentials

This node requires PostgreSQL credentials to store and retrieve state machine states. Also, it requires a webhook it can call with the name of the state machine diagram, which should return a JSON object with the following property: code, that is the code that StateSmith generated.

Compatibility

This node has been tested on n8n version 1.45.1. Compatibility with older versions has not been verified.

Usage

To use this node, you need to:

  1. Draw your state machine diagram using draw.io and store it in GitHub.
  2. Setup the StateSmith server.
  3. Configure the node with the URL to fetch the state machine code, the diagram name, and the cache folder path.

Resources

Discussion