Workflows and REST sources
Workflows
Workflows are logic on the server – with the same flow engine and editor as IllusionCMS and IllusionForms: nodes connected by wires, a message msg runs through from the start. A workflow belongs to the app (tab Workflows) and runs when a query of the kind Run workflow is called:
- The parameters of the query arrive as
msg.payload, the account asmsg.user(id,email,role). - The HTTP response node is the answer to the app (
msg.payload); without it the query answers{"ok": true}. - A run may take at most 20 seconds.
Nodes: Start, Function (JavaScript with msg), Switch, HTTP request, Delay, Join, HTTP response, Debug and the IllusionDB nodes:
| Node | Effect |
|---|---|
| List records | table, filter (JSON with {{ msg.… }}), sort, maximum → msg.payload is the list |
| Get record | table, record (primary key) → msg.payload |
| Create record | table, values (JSON) – empty = msg.payload is the record |
| Update record | table, record, values |
The IllusionDB nodes reach exactly the tables they name, with the rights as for queries. HTTP requests have the same target protection as webhooks (cloud metadata addresses always blocked, local addresses per Settings → Security). Schedules, HTTP inputs and e-mails do not exist in app workflows.
In the draft a node may still be incomplete (autosave keeps working); Publish checks every node.
REST sources
For external APIs create a source under Apps → REST sources: name, base address (e.g. https://api.example.com/v1) and headers such as Authorization: Bearer … or X-Api-Key. The headers are stored encrypted (with ENCRYPTION_KEY, like the passwords of data sources), never shown again and never reach the browser.
A query of the kind REST source names the source, method, path (e.g. /items?q={{params.q}}, placeholders are encoded) and for POST/PUT/PATCH a body (JSON with placeholders). A JSON list as answer becomes records like List records – tables and lists show it directly. Answers with status 400 or higher become an error of the query.