Add flowSync on flows:started, designOnly runtemplates by default, identity stamp nodes, and rewrite Payment Confirmation as an eventor-executed graph. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| debian | ||
| examples | ||
| multiflexi | ||
| test | ||
| .gitignore | ||
| node-red-contrib-multiflexi.svg | ||
| package.json | ||
| README.md | ||
node-red-contrib-multiflexi
Node-RED nodes for designing MultiFlexi automation
graphs. On Deploy, executable Multiflexi nodes are synced to MultiFlexi
(POST /flow/). multiflexi-eventor executes the stored graph (map, branch,
schedule jobs) — Node-RED does not need to stay in the runtime path.
Nodes
| Node | Role | Direction |
|---|---|---|
| multiflexi-config | Optional remote connection; registers Deploy → flow sync. Hosted installs use MULTIFLEXI_URL + MULTIFLEXI_API_TOKEN |
— |
| multiflexi-event | Flow trigger (evidence/operation); also receives debug pushes | design → MultiFlexi |
| multiflexi-runtemplate | RunTemplate identity (default Design only; no POST /job/) |
design → MultiFlexi |
| multiflexi-company | Stamps a company onto the message (pick id/name in settings) | filter |
| multiflexi-application | Stamps an application onto the message (pick uuid/name in settings) | filter |
| multiflexi-credential | Stamps a credential onto the message (pick id/name in settings) | filter |
| multiflexi-artifact | Artifact refs for @file: mapping |
filter |
| multiflexi-catalog | Receives the MultiFlexi config catalog; caches it for editor autosuggest | MultiFlexi → Node-RED |
| multiflexi-map | Field mapping synced into flow_node.config for eventor |
design → MultiFlexi |
Also executable after sync: Node-RED switch, delay, link in/out, catch.
The palette stays short: only these generic nodes. After you place a node on the canvas, choose its identity (RunTemplate, company, application, credential) in the edit dialog via autosuggest from the MultiFlexi catalog.
Node icons (identity)
When you pick an identity in the editor, the node icon updates for quick visual recognition on the canvas:
| Node | Icon source |
|---|---|
| multiflexi-company | Company logo (companylogo.php?id=) |
| multiflexi-application | Application image (appimage.php?uuid=) |
| multiflexi-credential | Credential-type / prototype logo (credentialimage.php?id=) |
| multiflexi-runtemplate | Diagonal composite: company logo underneath, application icon on top (ImageMagick) |
Icons are fetched from the MultiFlexi web UI, cached under the package
multiflexi/icons/ directory, and stored on the node as iconFile. Hosted
installs should set:
MULTIFLEXI_APP_URL=http://127.0.0.1/multiflexi/
# When Apache has multiple vhosts, force the Host header for loopback fetches:
MULTIFLEXI_APP_HOST=vyvojar.example.com
RunTemplate composites need imagemagick (convert) on the Node-RED host.
Hosted MultiFlexi (session-bound)
When Node-RED is installed next to MultiFlexi:
- Set
MULTIFLEXI_URLandMULTIFLEXI_API_TOKENon the Node-RED process (service account bearer token). Flow nodes call the API with that identity — no per-node URL/password. - Point
adminAuthatmultiflexi/multiflexi-auth.jsso editor login is validated against MultiFlexi. Autosuggest then loadsGET /nodered/catalog.jsonfiltered by the user'scompany_user/ RBAC. - Tick Record me as launcher on a run-template node for explicit ad-hoc
runs (
launched_by= your user). Leave it off for automated event→job flows (service account remains the launcher).
Data flow
abraflexi-webhook-acceptor → changes_cache
│ (poll)
multiflexi-eventor daemon ──HTTP POST──▶ [multiflexi-event] ──▶ [multiflexi-runtemplate] ──HTTP──▶ MultiFlexi API
│ (poll finished jobs)
└─────────────────HTTP POST──▶ [multiflexi-event:job.completed] ─▶ [multiflexi-artifact] ─▶ [multiflexi-runtemplate]
Setup
Install one of two ways:
Debian package (recommended) — installs to /usr/share/nodejs/node-red-contrib-multiflexi:
sudo apt install node-red-contrib-multiflexi
sudo systemctl restart node-red
From source into your Node-RED user directory (~/.node-red):
cd ~/.node-red
npm install /path/to/node-red-contrib-multiflexi
node-red-restart # or restart Node-RED
Then configure the multiflexi-eventor daemon to forward events
(/etc/multiflexi/multiflexi.env):
NODERED_WEBHOOK_URL=http://YOUR-NODE-RED:1880/multiflexi-event
NODERED_FORWARD_CHANGES=true
NODERED_TOKEN=shared-secret-required
NODERED_CATALOG_URL=http://YOUR-NODE-RED:1880/multiflexi-catalog
On the Node-RED host:
MULTIFLEXI_URL=http://127.0.0.1/multiflexi/api
MULTIFLEXI_API_TOKEN=<token from multiflexi-cli token:generate --login svc-nodered>
MULTIFLEXI_APP_URL=http://127.0.0.1/multiflexi/
And in settings.js:
adminAuth: require('node-red-contrib-multiflexi/multiflexi/multiflexi-auth'),
For standalone Node-RED talking to a remote MultiFlexi, add a multiflexi-config node instead of the env vars above.
Catalog feed (autosuggest data)
Drop a multiflexi-catalog node into a flow and set NODERED_CATALOG_URL
on the multiflexi-eventor daemon to that node's path (default
/multiflexi-catalog). The daemon pushes companies, enabled run-templates and
credentials; the catalog node caches them for the editor autosuggest on
generic nodes. It does not create one palette entry per entity.
Identity icons are resolved on demand when you select an entity in the editor
(GET /multiflexi/icon/:kind) from the public MultiFlexi image endpoints
(companylogo.php, appimage.php, credentialimage.php).
Example
examples/payment-confirmation.flow.json wires:
- Payment received (
webhook.change, evidencebanka/create) → Payment Receipt Confirmation RunTemplate. - Job completed → JSON output artifact filter → Data consumer RunTemplate (output chaining).
License
MIT