--- title: What is Total.js Flow project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/introduction/ updated: 2026-11-19T04:29:29.073Z --- # What is Total.js Flow > What Total.js Flow is, the words it uses and where to go next. Total.js Flow is a visual tool for building data processes in your browser. You drag components onto a canvas, connect them with lines, and Flow runs the result on your own server. This documentation covers release 11.1. ![The designer with a Trigger, a Code and a Print node connected in a line](/files/Janwmv2KM61f.webp) ## The words Flow uses | Word | What it means | |---|---| | **FlowStream** | One process that you design. Each FlowStream runs on its own, so you can pause or restart it without touching the others. | | **Designer** | The screen where you build a FlowStream. | | **Component** | A building block, such as **Trigger**, **Code** or **Print**. You download components into each FlowStream. | | **Node** | A component placed on the canvas. | | **Connection** | The line that carries data from the output of one node to the input of another. | | **Group** | A named area on the canvas that keeps related nodes together. | ## What to read next 1. Install Flow: [Install from source](../install-source/). 2. Sign in for the first time: [First sign-in](../first-sign-in/). 3. Build something that runs: [Your first FlowStream](../first-flowstream/). --- title: Install from source project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/install-source/ updated: 2026-11-19T04:29:29.073Z --- # Install from source > Install Total.js Flow with Node.js and start it on your server. You need [Node.js](https://nodejs.org) and a copy of the Flow source code. ## Install and start **1.** Get the code and open its folder: ```bash git clone https://github.com/totaljs/flow.git cd flow ``` **2.** Install the dependencies: ```bash npm install ``` **3.** Start Flow: ```bash npm run start ``` **4.** Open `http://localhost:8000` in your browser. ## Use another port Pass the port when you start Flow: ```bash node index.js 8080 ``` You can also set the port in the [configuration file](../../reference/config-file/) with the `$port` key. ## Keep your server safe - Sign in as soon as Flow is running. Until you do, the sign-in page shows the generated account. See [First sign-in](../first-sign-in/). - Use HTTPS and restrict who can reach the server when Flow is available over a network. --- title: First sign-in project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/first-sign-in/ updated: 2026-11-19T04:29:29.073Z --- # First sign-in > Sign in with the account that Flow generates on its first start. The first time Flow starts, it creates one account with a random user name and password. ## Sign in **1.** Open Flow in your browser. The sign-in page shows a **Default account** box with the generated values. ![The sign-in page with the Default account box, the values hidden in this picture](/files/JanwnF2aM61f.webp) **2.** Select **Fill in the form**. **3.** Select **Sign in**. Flow opens the list of FlowStreams, and the sign-in page stops showing the **Default account** box. ## Choose your own password Change the generated values straight away. See [Change your credentials](../change-credentials/). ## Sign in later Enter your user name and password, and select **Sign in**. ![The sign-in form with the User name and Password fields](/files/JanwnG2bM60f.webp) To leave, select **Sign out** at the bottom of the left menu. --- title: Your first FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/first-flowstream/ updated: 2026-11-19T04:29:29.073Z --- # Your first FlowStream > Create a FlowStream, add two components, connect them and run it. In this guide you build a small FlowStream: a **Trigger** sends a message and a **Print** node shows it. ## Create the FlowStream 1. In the list of FlowStreams, select **Create FlowStream**. If the list already has items, select **Create new** in the left menu. 2. Enter a **Name**, for example `Demo project`. 3. Select **SUBMIT**. 4. Select the new FlowStream in the list. The designer opens. ## Download the components A new FlowStream has no components. The designer welcomes you with three short steps. 1. Select **NEXT** twice, then **DONE**. The **Download components** window opens. 2. Select **Trigger**, then **IMPORT**. 3. Select **Print**, then **IMPORT**. 4. Select **Close**. Both components now appear in the list on the left. ## Build the design 1. Drag **Trigger** from the left list onto the canvas. 2. Drag **Print** onto the canvas, to the right of the Trigger. 3. Drag from the dot next to **Output** on the Trigger to the dot next to **Input** on Print. 4. Select **APPLY** in the toolbar, then **Continue**. ## Run it Select **Run** on the Trigger node. The message appears inside the Print node, and **Messages** in the status bar goes up by one. ![A Trigger node connected to a Print node that shows the received message](/files/JanwnB2XM60f.webp) Next, learn your way around [the designer](../designer-overview/). --- title: The FlowStreams list project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/flowstreams-list/ updated: 2026-11-19T04:29:29.073Z --- # The FlowStreams list > Read the list of FlowStreams and what each card tells you. The list is the first screen you see after signing in. To return to it from anywhere, select **Flow** in the left menu. ![The list with three FlowStreams in two groups, one of them paused](/files/JanwnK2eM61f.webp) ## What each row shows | Part | What it tells you | |---|---| | Icon and name | The icon, color and name you chose. | | **Running** or **Paused** | Whether the FlowStream processes messages. | | Path | The [proxy endpoint](../proxy-endpoint/), if the FlowStream has one. | | Memory | The memory the FlowStream uses right now. | | Three dots | The menu with all the actions for this FlowStream. | FlowStreams with the same **Group** appear together under the group name. ## Open a FlowStream Select a row to open its designer in a new tab at the top of the screen. ## The FlowStream menu Select the three dots at the end of a row. ![The menu of a FlowStream](/files/JanwnM2fM60f.webp) | Item | Where to read more | |---|---| | **Variables** | [Variables](../variables/) | | **Pause**, **Play**, **Restart** | [Pause and restart a FlowStream](../pause-restart/) | | **Open in new tab** | Opens the designer in its own browser tab. | | **Edit** | [Create a FlowStream](../create-flowstream/) | | **Clone**, **Remove** | [Clone or remove a FlowStream](../clone-remove/) | | **Copy as JSON**, **Download** | [Export a FlowStream](../export-flowstream/) | ## The main menu Select the blue button in the top left corner of the list. ![The main menu with Create new, Import FlowStream, Templates, Variables and Settings](/files/JanwnO2gM61f.webp) **Import FlowStream**, **Templates** and **Variables** are only available here. ## Find a FlowStream Select the magnifier at the top right, then type part of the name. ## The status bar The bar at the bottom shows **Memory**, **Messages**, **Pending**, **Per minute** and **Online clients**, followed by the Flow and Total.js versions. --- title: Create a FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/create-flowstream/ updated: 2026-11-19T04:29:24.073Z --- # Create a FlowStream > Create a FlowStream and change its name, look and limits. Every FlowStream starts with a short form. You can reopen it at any time. ## Create one 1. Select **Create new** in the left menu. 2. Fill in the form. Only **Name**, **Icon** and **Proxy timeout** are required. 3. Select **SUBMIT**. ![The Create FlowStream form](/files/Janwmr2HM60f.webp) Every field is described in [FlowStream fields](../../reference/flowstream-fields/). ## Change one 1. Select the three dots at the end of the row. 2. Select **Edit**. The **Update FlowStream** form opens. 3. Change what you need and select **SUBMIT**. --- title: Pause and restart a FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/pause-restart/ updated: 2026-11-19T04:29:29.073Z --- # Pause and restart a FlowStream > Stop a FlowStream from processing messages, resume it, or restart it. You control each FlowStream separately. The others keep working. ## Pause 1. Select the three dots at the end of the row. 2. Select **Pause**. The row turns yellow and shows **Paused**. ## Resume 1. Select the three dots at the end of the row. 2. Select **Play**. The row shows **Running** again after the list refreshes. ## Restart 1. Select the three dots at the end of the row. 2. Select **Restart**. 3. Confirm with **Restart**. --- title: Clone or remove a FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/clone-remove/ updated: 2026-11-19T04:29:24.073Z --- # Clone or remove a FlowStream > Make a copy of a FlowStream or delete one you do not need. ## Clone 1. Select the three dots at the end of the row. 2. Select **Clone**. Flow creates the copy and opens its form. 3. Change the **Name** and select **SUBMIT**. The copy exists as soon as the form opens. If you select **Cancel**, it stays in the list with the original name. ## Remove Removing a FlowStream deletes it for good. [Export it](../export-flowstream/) first if you may need it again. 1. Select the three dots at the end of the row. 2. Select **Remove**. 3. Confirm with **Remove**. --- title: Export a FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/export-flowstream/ updated: 2026-11-19T04:29:29.073Z --- # Export a FlowStream > Save a FlowStream as a JSON file or copy it to the clipboard. An export holds the whole FlowStream as JSON. Use it as a copy, or to move the FlowStream to another Flow installation. ## Download a file 1. Select the three dots at the end of the row. 2. Select **Download**. Your browser saves a file named after the FlowStream, for example `Demo reports.json`. ## Copy to the clipboard 1. Select the three dots at the end of the row. 2. Select **Copy as JSON**. To bring an export back, see [Import a FlowStream](../import-flowstream/). --- title: Import a FlowStream project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/import-flowstream/ updated: 2026-11-19T04:29:29.073Z --- # Import a FlowStream > Add a FlowStream to Flow from exported JSON. 1. Open the main menu with the blue button in the top left corner. 2. Select **Import FlowStream**. 3. Paste the JSON into **FlowStream JSON**. 4. Select **SUBMIT**. ![The Import window with the FlowStream JSON field](/files/JanwnV2mM61f.webp) Flow adds the FlowStream and opens its form, so you can adjust the name and other fields. Select **SUBMIT** to save them. If the text is not a complete FlowStream export, Flow shows **Invalid data**. --- title: Start from a template project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/templates/ updated: 2026-11-19T04:29:29.073Z --- # Start from a template > Add a ready-made FlowStream from the template catalog. Templates are ready-made FlowStreams that you can add with a few clicks. The catalog is on the internet, so you need internet access to use it. 1. Open the main menu with the blue button in the top left corner. 2. Select **Templates**. 3. Select **Read me** on a template to see what it does. 4. Select the template. 5. Confirm with **IMPORT**. ![The Templates window with one template](/files/Janwns3BM60f.webp) Flow adds the FlowStream and opens its form. Select **SUBMIT** to save it. --- title: Expose a FlowStream on a path project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/proxy-endpoint/ updated: 2026-11-19T04:29:29.073Z --- # Expose a FlowStream on a path > Send requests for a public path to a FlowStream. A proxy endpoint gives a FlowStream its own path on your Flow server. Requests to that path go to the FlowStream. ## Set the path 1. Select the three dots at the end of the row, then **Edit**. 2. Enter the path in **Proxy endpoint**, for example `/demo-orders/`. 3. Select **SUBMIT**. The path appears in the row of the FlowStream. ## Answer the requests The FlowStream needs nodes that handle the request. For example: 1. [Download](../download-components/) the **Route** and **Response** components. 2. Add both to the canvas and connect the output of **Route** to the input of **Response**. 3. Select **APPLY**, then **Continue**. Requests to `/demo-orders/` now reach the FlowStream and get an answer. ## Paths you cannot use Each path can belong to one FlowStream only. These paths are reserved: `/`, `/cdn/`, `/fapi/`, `/private/`, `/flows/`, `/designer/`, `/parts/`, `/forms/`, `/css/`, `/js/`, `/fonts/`, `/panels/` --- title: The designer project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/designer-overview/ updated: 2026-11-19T04:29:24.073Z --- # The designer > Find your way around the screen where you build a FlowStream. Select a FlowStream in the list to open the designer. ![The designer with the toolbar on top, components on the left and the canvas in the middle](/files/Janwmv2KM61f.webp) ## Parts of the screen | Part | What it does | |---|---| | Toolbar | The buttons along the top. | | Components | The list on the left. Drag a component from here onto the canvas. Use **Search components** to filter it. | | Canvas | The area where you place and connect nodes. | | Status bar | Shows **Messages**, **Pending**, **Per minute**, **Errors**, **Memory** and the data traffic. | ## The toolbar ![The toolbar buttons](/files/Janwmw2LM60f.webp) From left to right: | Button | What it does | |---|---| | **APPLY** | Saves and starts your changes. See [Apply changes](../apply-changes/). | | **Add** (plus) | Opens the menu below. | | **Variables** | Edits the variables of this FlowStream. See [Variables](../variables/). | | **Console** | Opens a panel at the bottom with the messages of this FlowStream. | | **Activities** | Lists the tasks that are running at the moment. | | **Search in nodes** | See [Search in nodes](../search-nodes/). | | **Zoom** | Zooms the canvas out and back in. | | **Pause** | Pauses the FlowStream after you confirm. | ## The Add menu ![The Add menu](/files/Janwmy2MM61f.webp) | Item | What it does | |---|---| | **Download components** | [Download components](../download-components/) | | **Link component** | [Install a component from a URL](../link-component/) | | **Link endpoint** | [Call an HTTP API](../link-endpoint/) | | **Paste nodes** | [Copy and paste nodes](../copy-paste-nodes/) | | **Download design** | Saves this FlowStream as a JSON file. | | **Restart worker** | Restarts the process of this FlowStream. | | **Clear** | Empties the canvas. | --- title: Download components project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/download-components/ updated: 2026-11-19T04:29:24.073Z --- # Download components > Add components from the official catalog to a FlowStream. Components belong to one FlowStream. If you need **Print** in two FlowStreams, download it in both. 1. In the designer, select **Add** (plus), then **Download components**. 2. Find a component by scrolling, or type in **Search components**. 3. Select **Read me** on a component to see what it does. 4. Select the component. 5. Confirm with **IMPORT**. 6. Select **Close** when you are done. ![The Download components window, with installed components in green](/files/Janwn32PM60f.webp) Components you already installed are green. Components with a **Community** badge come from the community. The catalog is on the internet, so you need internet access to use it. --- title: Install a component from a URL project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/link-component/ updated: 2026-11-19T04:29:29.073Z --- # Install a component from a URL > Add a component that is published at a web address. Use this when a component is not in the catalog, but you have the address of its `.html` file. **1.** In the designer, select **Add** (plus), then **Link component**. **2.** Enter the address in **URL address**, for example: ```text https://cdn.totaljs.com/flowstream/webcomponents/delay.html ``` **3.** Select **SUBMIT**. The window closes and the component appears in the list on the left. If the window stays open, the address does not point to a valid component. Check the address, or select **Cancel**. --- title: Call an HTTP API project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/link-endpoint/ updated: 2026-11-19T04:29:29.073Z --- # Call an HTTP API > Create a component that sends requests to an HTTP address. **Link endpoint** creates a component for one HTTP address. You can use it many times in the same FlowStream. 1. In the designer, select **Add** (plus), then **Link endpoint**. 2. Fill in the form. 3. Select **CREATE**. The new component appears in the list on the left, ready to drag onto the canvas. ![The Link endpoint form](/files/Janwnd2vM60f.webp) | Field | What to enter | |---|---| | **Name** | The name of the component. Required. | | **Group name** | The heading it appears under in the component list. | | **Icon** | The icon of the component. | | **HTTP method** | `POST`, `GET`, `PUT`, `PATCH` or `DELETE`. | | **Data serialization** | **JSON** or **URL encode**. | | **URL address** | The address to call. Required. | | **Custom headers** | Header name and value. Press Enter to confirm each one. | | **Compress data via GZIP** | Compresses the data you send. | | **Read me** | A description in Markdown. | --- title: Add and connect nodes project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/connect-nodes/ updated: 2026-11-19T04:29:24.073Z --- # Add and connect nodes > Place nodes on the canvas, connect them and remove them. ## Add a node Drag a component from the list on the left onto the canvas. Drag the node by its title to move it. ## Connect two nodes Drag from the dot of an output to the dot of an input. A line appears between them. Select **APPLY** to start using the new connection. See [Apply changes](../apply-changes/). ## Change a connection Right-click the line: - **Color** gives the line a color. - **Remove** deletes the connection. ## Remove a node 1. Right-click the node. 2. Select **Remove**. ## The node menu Right-click a node to see everything you can do with it. ![The menu of a node](/files/Janwml2CM61f.webp) | Item | What it does | |---|---| | **Read information** | Shows the description of the component. | | **Set a note** | [Add notes to nodes](../notes/) | | **Configure** | [Configure a node](../configure-nodes/) | | **Copy node**, **Clone** | [Copy and paste nodes](../copy-paste-nodes/) | | **Remove** | Deletes the node. | --- title: Configure a node project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/configure-nodes/ updated: 2026-11-19T04:29:24.073Z --- # Configure a node > Open the settings of a node and change them. 1. Double-click the node, or right-click it and select **Configure**. 2. Change the settings. They depend on the component. 3. Select **APPLY**. ![The settings window of a Code node](/files/Janwmi29M60f.webp) ## Buttons in the window | Button | What it does | |---|---| | **Read me** | Shows the description of the component. | | **Copy** | Copies these settings. | | **Paste** | Pastes settings you copied. | | **Close after applying** | Closes the window when you select **APPLY**. | | **Cancel** | Closes the window without saving. | --- title: Apply changes project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/apply-changes/ updated: 2026-11-19T04:29:24.073Z --- # Apply changes > Save your design and start using it. Nodes and connections you add stay in the designer until you apply them. ## Apply 1. Select **APPLY** in the toolbar, or press `Cmd+S` on a Mac or `Ctrl+S` on Windows and Linux. 2. Confirm with **Continue**. ## What needs APPLY | Change | Needs APPLY | |---|---| | Adding a node | Yes | | Adding a connection | Yes | | Adding or changing a [note](../notes/) | No | | Adding or changing a [group](../groups/) | No | --- title: Organize with groups project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/groups/ updated: 2026-11-19T04:29:29.073Z --- # Organize with groups > Mark an area of the canvas with a name and colors. A group is a named area on the canvas. It helps you see which nodes belong together. ## Add a group Drag **Group** from the top of the component list onto the canvas. ## Change a group 1. Right-click an empty part of the group. 2. Select **Configure**. 3. Enter the **Group name**, and choose a **Background** and **Font color** if you like. 4. Select **SUBMIT**. ![The Edit group form](/files/JanwnR2jM60f.webp) ## Remove a group 1. Right-click an empty part of the group. 2. Select **Remove**. --- title: Add notes to nodes project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/notes/ updated: 2026-11-19T04:29:29.073Z --- # Add notes to nodes > Write a short note on a node to explain what it does. A note appears on the node itself, so anyone who opens the design can read it. 1. Right-click the node. 2. Select **Set a note**. 3. Type your note. 4. Select **SUBMIT**. The note is saved at once. You do not need to select **APPLY**. To change the note, repeat the same steps. --- title: Copy and paste nodes project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/copy-paste-nodes/ updated: 2026-11-19T04:29:24.073Z --- # Copy and paste nodes > Duplicate a node, or move nodes to another FlowStream. ## Duplicate a node 1. Right-click the node. 2. Select **Clone**. 3. Select **APPLY** to start using the copy. ## Copy a node to another FlowStream The other FlowStream needs the same component. [Download it](../download-components/) there first. 1. Right-click the node and select **Copy node**. 2. Open the other FlowStream. 3. Select **Add** (plus), then **Paste nodes**. 4. Paste into the field and select **SUBMIT**. 5. Select **APPLY**. --- title: Search in nodes project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/search-nodes/ updated: 2026-11-19T04:29:29.073Z --- # Search in nodes > Find a node in a large design. 1. In the designer, select **Search in nodes** in the toolbar. 2. Type what you are looking for. The results show each matching node and where the text was found, such as its **name** or **configuration**. ![The Search in nodes window with two results](/files/Janwnn36M61f.webp) Select the red cross in the corner to close the window. --- title: Variables project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/variables/ updated: 2026-11-19T04:29:29.073Z --- # Variables > Store values for all FlowStreams or for just one. Variables are named values that you keep outside your design. Flow has two kinds. | Kind | Who can use it | Where you edit it | |---|---|---| | Global variables | Every FlowStream | Main menu, **Variables** | | FlowStream variables | One FlowStream | The FlowStream menu, or **Variables** in the designer toolbar | ## Add a global variable 1. Open the main menu with the blue button in the top left corner. 2. Select **Variables**. 3. Type a key, then type a value. 4. Press Enter to confirm the variable. 5. Select **SUBMIT**. ![The Variables window with one variable](/files/Janwnv3EM61f.webp) A variable that you do not confirm with Enter is not saved. ## Add a variable to one FlowStream 1. Select the three dots at the end of the row. 2. Select **Variables**. 3. Type a key and a value, and press Enter. 4. Select **SUBMIT**. ## Remove a variable Select the red cross next to the variable, then select **SUBMIT**. --- title: Environments project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/environments/ updated: 2026-11-19T04:29:29.073Z --- # Environments > Mark your installation as development, test or production. The environment tells you and your FlowStreams what kind of installation this is. The current one appears at the top right of the screen. ## Change the environment 1. Select **Settings** in the left menu. 2. Select **Dev**, **Test** or **Prod**. 3. Select **SUBMIT**. ![The environment choices at the top of the Settings window](/files/Janwn62SM61f.webp) Flow restarts all FlowStreams when you change the environment, so plan the change for a quiet moment. --- title: Change your credentials project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/change-credentials/ updated: 2026-11-19T04:29:24.073Z --- # Change your credentials > Set your own user name and password. 1. Select **Change credentials** in the left menu. The icon is a key. 2. Enter your **User name**. 3. Enter the new password in **Password** and again in **Password reply**. 4. Select **SUBMIT**. ![The Change credentials form](/files/Janwmb24M61f.webp) You stay signed in. Every other open session is closed, and those browsers must sign in again with the new values. Choose a long password that mixes lowercase and uppercase letters, numbers and special characters. --- title: Back up your data project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/backups/ updated: 2026-11-19T04:29:24.073Z --- # Back up your data > Keep copies of your FlowStreams and know which folders to save. ## Keep a copy after each change 1. Select **Settings** in the left menu. 2. Turn on **Backup Flow database file after each change**. 3. Select **SUBMIT**. Each time a FlowStream changes, Flow keeps the previous database in the `flowstream` folder, in a file named like `database_202611182053.bk`. The number is the date and time. Flow does not delete these files. Check the folder from time to time and remove the ones you do not need. ## Save your whole installation Copy these folders from the Flow folder to a safe place: | Folder | What it holds | |---|---| | `databases` | Your account and settings | | `flowstream` | Your FlowStreams and global variables | | `private` | Your [private files](../private-files/) | To keep a single FlowStream, [export it](../export-flowstream/). --- title: Share private files project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/private-files/ updated: 2026-11-19T04:29:29.073Z --- # Share private files > Download files from the private folder with an access token. Files in the `private` folder of Flow are available over HTTP to anyone who has the access token. ## Set the access token Flow creates a token for you. To use your own: 1. Select **Settings** in the left menu. 2. Enter it in **Access token**. 3. Select **SUBMIT**. Treat the token like a password. Anyone who has it can read the files in the folder. ## List the files Open this address, with your own server and token: ```text https://your-server/private/?token=YOUR_TOKEN ``` Flow answers with a JSON list that holds the `name`, `size` and `modified` date of each file. ## Download a file Add the file name to the address: ```text https://your-server/private/?token=YOUR_TOKEN&filename=demo-report.txt ``` --- title: Read the server log project: Flow version: 11.1 section: guides language: en license: MIT url: https://totaljs.es/docs/flow/11-1/guides/server-log/ updated: 2026-11-19T04:29:29.073Z --- # Read the server log > Turn on the server log and read it in the browser. The server log shows what the Flow server writes to its console, such as errors. ## Turn it on When you install from source, the log stays empty until you enable it. **1.** Stop Flow. **2.** Add this line to the `config` file in the Flow folder: ```text $logger : true ``` **3.** Start Flow again. Flow now writes the log to `logs/debug.log`. ## Read it Select the bug icon at the top right of the screen. The **Real-time server console** window opens and keeps itself up to date. --- title: Configuration file project: Flow version: 11.1 section: reference language: en license: MIT url: https://totaljs.es/docs/flow/11-1/reference/config-file/ updated: 2026-11-19T04:29:29.073Z --- # Configuration file > The keys you can set in the config file. The `config` file is in the Flow folder. Each line holds a key and a value: ```text name : My Flow $logger : true ``` Restart Flow after you change this file. ## Keys that apply on the first start only Flow reads these keys the first time it starts and stores the values. After that, the stored values win, and changing the file has no effect. | Key | What it sets | |---|---| | `name` | The name of the application. Change it later in [Settings](../settings-screen/). | | `env` | The environment: `dev`, `test` or `prod`. Change it later in [Settings](../settings-screen/). | | `components` | The address of the component catalog. Change it later in [Settings](../settings-screen/). | | `templates` | The address of the template catalog. | ## Keys that apply on every start | Key | Example | What it does | |---|---|---| | `$port` | `8000` | The port Flow listens on. | | `$ip` | `127.0.0.1` | The address Flow listens on. | | `$logger` | `true` | Writes the [server log](../../guides/server-log/) to `logs/debug.log`. | | `directory` | `/data/flow/` | An absolute path to the folder for your FlowStreams, used instead of the `flowstream` folder. | | `flowstream_memory` | `512` | The memory limit in megabytes for FlowStreams whose **Max. memory** is `0`. | ## Generated keys Flow creates the `cookie` and `cookie_secret` values on the first start and stores them in `databases/config.json`. Keep that file: your password depends on the secret. --- title: Settings screen project: Flow version: 11.1 section: reference language: en license: MIT url: https://totaljs.es/docs/flow/11-1/reference/settings-screen/ updated: 2026-11-19T04:29:29.073Z --- # Settings screen > Every option in the Settings window. Open **Settings** in the left menu. Select **SUBMIT** to save your changes. | Option | What it does | |---|---| | **Dev**, **Test**, **Prod** | The [environment](../../guides/environments/). All FlowStreams restart when you change it. | | **Name** | The name of the application, shown in the browser title. | | **Main components** | The address of the component catalog. Leave it unchanged unless you run your own catalog. | | **Access token** | The token for [private files](../../guides/private-files/). | | **Backup Flow database file after each change** | Keeps [backup files](../../guides/backups/) in the `flowstream` folder. | | **Enable dark mode** | Switches the application to dark colors. | --- title: FlowStream fields project: Flow version: 11.1 section: reference language: en license: MIT url: https://totaljs.es/docs/flow/11-1/reference/flowstream-fields/ updated: 2026-11-19T04:29:29.073Z --- # FlowStream fields > Every field in the FlowStream form. These fields appear when you [create or edit a FlowStream](../../guides/create-flowstream/). | Field | Default | What it does | |---|---|---| | **Name** | Empty | The name in the list. Required. | | **Icon** | Chip | The icon in the list. Required. | | **Color** | None | The color of the icon. | | **Group** | Empty | Shows FlowStreams together under a heading. Pick a group or type a new one. | | **Proxy endpoint** | Empty | The public path of this FlowStream. See [Expose a FlowStream on a path](../../guides/proxy-endpoint/). | | **Proxy timeout** | `120` | The time limit for proxied requests, in seconds. Required. | | **Enable cloning of message data** | On | Clones the data for each message. Turning it off can improve performance, but nodes may then share the same object. | | **Max. memory** | `0` | The memory limit in megabytes. `0` means an automatic limit. | | **Description** | Empty | A description in Markdown. | --- title: Keyboard shortcuts project: Flow version: 11.1 section: reference language: en license: MIT url: https://totaljs.es/docs/flow/11-1/reference/keyboard-shortcuts/ updated: 2026-11-19T04:29:29.073Z --- # Keyboard shortcuts > Keys you can use in the designer. Use these keys in the [designer](../../guides/designer-overview/). | Mac | Windows and Linux | What it does | |---|---|---| | `Cmd+S` | `Ctrl+S` | [Applies](../../guides/apply-changes/) your changes, after you confirm. | | `Cmd+A` | `Ctrl+A` | Selects all nodes on the canvas. | --- title: Where Flow stores data project: Flow version: 11.1 section: reference language: en license: MIT url: https://totaljs.es/docs/flow/11-1/reference/data-locations/ updated: 2026-11-19T04:29:29.073Z --- # Where Flow stores data > The files and folders that hold your data. All paths are relative to the Flow folder of an installation from source. | Path | What it holds | |---|---| | `databases/memorize_preferences.json` | Your account and settings | | `databases/config.json` | Generated cookie name and secret | | `flowstream/database.json` | Your FlowStreams and global variables | | `flowstream/database_*.bk` | [Backup files](../../guides/backups/), if you turned them on | | `private/` | [Private files](../../guides/private-files/) | | `logs/debug.log` | The [server log](../../guides/server-log/), if you turned it on | To keep your FlowStreams in another folder, set `directory` in the [configuration file](../config-file/). --- title: Signing in project: Flow version: 11.1 section: faq language: en license: MIT url: https://totaljs.es/docs/flow/11-1/faq/sign-in/ updated: 2026-11-19T04:29:24.073Z --- # Signing in > Answers for when you cannot sign in. ## I forgot my password Flow has no reset screen, but you can make it generate a new account. Your FlowStreams and settings stay in place. 1. Stop Flow. 2. Open `databases/memorize_preferences.json` in a text editor. 3. Delete the `user` entry and save the file. 4. Start Flow. 5. Open the sign-in page and follow [First sign-in](../../guides/first-sign-in/). Until you sign in, the sign-in page shows the new account to anyone who can reach it. Do this while access to the server is restricted. ## Flow says Invalid credentials, but my password is right Flow counts every sign-in attempt from an address, and after about ten attempts it refuses them all, even correct ones. Wait 15 minutes and try again, or restart Flow to clear the block straight away. --- title: Using the designer project: Flow version: 11.1 section: faq language: en license: MIT url: https://totaljs.es/docs/flow/11-1/faq/designer/ updated: 2026-11-19T04:29:24.073Z --- # Using the designer > Answers to common questions about the designer. ## Why is the component list empty? A new FlowStream has no components. Select **Add** (plus), then **Download components**. See [Download components](../../guides/download-components/). ## How do I delete a node? Right-click the node and select **Remove**. ## Why does my new node not process messages? New nodes and connections start working after you apply them. See [Apply changes](../../guides/apply-changes/). --- title: Server log project: Flow version: 11.1 section: faq language: en license: MIT url: https://totaljs.es/docs/flow/11-1/faq/server-log/ updated: 2026-11-19T04:29:24.073Z --- # Server log > Why the server log can be empty. ## Why is the server log empty? On an installation from source, the log needs `$logger : true` in the `config` file. See [Read the server log](../../guides/server-log/). With the setting on, the window stays empty until the server has something to write. --- title: Official components project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/introduction/ updated: 2026-11-19T10:58:28.322Z --- # Official components > Where the official components come from, how they are versioned and how to read this catalogue. The official components are the building blocks that Total.js publishes for Flow. This section lists every component of the official catalogue, grouped as the **Download components** window groups them. ## Where the components come from Each component is one HTML file in the GitHub repository [totaljs/flowstreamcomponents](https://github.com/totaljs/flowstreamcomponents), in the `components` folder. The file holds the code that runs on the server, the settings form, the look of the node and the readme. The repository also holds `db.json`, the catalogue: one entry for each component with its name, group, version, author, icon, readme and the address of its file. The files and the catalogue are published at: ```text https://cdn.totaljs.com/flowstream/webcomponents/db.json ``` Flow reads this address from **Main components** in the [Settings screen](/flow/11-1/reference/settings-screen/). Your browser downloads the catalogue when you open the **Download components** window, so you need internet access to use it. ## Add a component to a FlowStream Components belong to one FlowStream. To add one, open the designer, select **Add** (plus), then **Download components**, and select the component. The steps are in [Download components](/flow/11-1/guides/download-components/). In that window: - Green components are already installed in this FlowStream. - A component with an **update** badge has a newer version in the catalogue than the one you installed. Select it to install the new version. - A component with a **Community** badge has an author other than Total.js. - **Read me** shows the readme of the component, the same text as in this section. ## Versions Every component has its own version number. It belongs to the component, not to Flow, and it goes up when the component changes. Each entry in this section shows the file name and the version of the component in the repository. The catalogue and the repository are published separately, so at times the **Download components** window shows an older version number, or a component that the repository does not hold yet. ## How to read an entry | Part | What it tells you | |---|---| | Name and file | The name in the designer, the file in the repository and its version. | | Inputs and outputs | The connection points of the node: the id in code and the name on the node. | | Notes | npm packages that Flow installs for the component, and whether a FlowStream can hold only one node of it. | | Readme | The description from the author. | | Parameters | The main settings of the node: the key in the configuration, its default value and the label in the settings form. | Some components work with an external service, such as a database server, an MQTT broker, Total.js API or an AI model. You need your own server or account for them, and their settings ask for its address or token. ## Write your own To build components of your own, or to offer a catalogue to your team, see [Develop components](../../development/introduction/). --- title: Common project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/common/ updated: 2026-11-20T06:50:52.962Z --- # Common > General components that send, change, split, merge, delay and print messages. General components that send, change, split, merge, delay and print messages. This page holds the catalogue group **Common**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### code.html · version 4 Type: `component` Runs your own JavaScript code for each message. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `outputs` | `Number` | no | `1` | Number of outputs. | | `name` | `String` | no | `Code` | Name. | | `code` | `String` | no | | The JavaScript code that runs for each message. | **Inputs:** `input` (Input). **Outputs:** `output` (Output); more come from the settings of the node. This component executes a custom JavaScript code as it is. To send data to the default output use `send(somedata);` To send data to specific output when number of outputs > 1 use `$.send('outputX', somedata)` where `X` is output index, see example bellow: - first output--> `send(somedata)` or `$.send('output', somedata)` - second output --> `$.send('output2', somedata)` - ... - 5th output --> `$.send('output5', somedata)` - etc. ### comment.html · version 1 Type: `component` Shows a short Markdown comment on the canvas. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `text` | `String` | no | `Add a custom comment...` | The comment, in Markdown. | **Inputs:** none. **Outputs:** none. This component renders a small markdown comment inside the body. ### counter.html · version 1 Type: `component` Counts incoming messages. **Inputs:** `input` (Input). **Outputs:** none. The component counts incoming messages. ### datamapper.html · version 1 Type: `component` Renames the properties of the incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `extend` | `Boolean` | no | `false` | Only extend the incoming payload. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component remaps payload properties. ### datasorter.html · version 3 Type: `component` Sends each message to the output whose condition it meets. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `conditions` | `Array` | no | `[]` | The conditions. Each condition has its own output. | | `if` | `String` | no | | Condition. | **Inputs:** `input` (Input). **Outputs:** they come from the settings of the node. The component sorts data according to the custom defined conditions. You can define unlimited count of outputs with various conditions. ### delay.html · version 4 Type: `component` Delays each message. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `delay` | `Number` | no | `1000` | Delay. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). When several messages wait, the component sends the newest one first, then one message after each delay. The component delays processing of a message. ### downloader.html · version 2 Type: `component` Downloads a file from a URL address. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `output` | `String` | no | `file` | Output. One of: `file` (File), `base64` (BASE64), `datauri` (Data URI), `buffer` (Buffer). | | `path` | `String` | no | `value` | Assign response to the path. | | `urlpath` | `String` | no | `url` | Path for reading URL address. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). The component downloads the file from the URL address as it is. **Input** ```js { url: 'https://example.com/file.jpg', // file url } ``` **Output** ```js { value: '/tmp/xyz.bin', ... } ``` The file will be automaticaly deleted once the message is destroyed. ### duplicator.html · version 1 Type: `component` Sends each incoming message several times. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `count` | `Number` | no | `1` | Count. | | `repo` | `Boolean` | no | `true` | Duplicate repository. | | `refs` | `Boolean` | no | `true` | Duplicate references. | | `vars` | `Boolean` | no | `true` | Duplicate variables. | | `data` | `Boolean` | no | `true` | Duplicate data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component duplicates incoming messages according to the configuration settings. ### end.html · version 1 Type: `component` Ends the incoming message. **Inputs:** `input` (Input). **Outputs:** none. The component destroys the incoming message. ### extend.html · version 3 Type: `component` Adds new properties to the incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Load data from the specific property/field. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component extends the current message by adding new properties. ### feedtodelay.html · version 1 Type: `component` Forwards only the last message after a quiet period. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `timeout` | `String` | no | | Timeout in seconds. | | `resend` | `String` | no | | Keep resending. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The incomming message will only be forwarded after the timeout. Only the last message is forwarded, so any previously received messages are lost. If messages are comming in within the given timeout period this component will never forward any message. The timeout is activated by the first message. The maximum timeout is 2147483 seconds, which is about 24.8 days. Example usage: - A sensor is supposed to send data every minute, use this component to notify you that there is a problem with receiving message. - HTTP request comes in and it takes too much time to respond? Use this component to notify you about it. ### flashback.html · version 4 Type: `component` Remembers data so that you can repeat the action. **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component remembers the data for repeating the action. ### forward.html · version 1 Type: `component` Forwards messages, for use with colored connections. **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component send message next only. It's targeted for colorized connections to targeted to the same input. - The data will Flow only from input a specific color (except black) - The color black is a universal color and it will transport everything ### request.html · version 8 Type: `component` Makes an HTTP request and sends the response. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | | URL address. | | `method` | `String` | no | `GET` | Method. One of: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`. | | `dnscache` | `Boolean` | no | `true` | Enable DNS cache. | | `insecure` | `Boolean` | no | `false` | Allow insecure connection. | | `secret` | `String` | no | | Total.js Encryption/Decryption secret. | | `xhr` | `Boolean` | no | `false` | Add XHR header. | | `parse` | `Boolean` | no | `true` | Parse Response to Object. | | `timeout` | `Number` | no | `10000` | Timeout. | | `limit` | `Number` | no | `512000` | Max. size. | | `headers` | `Object` | no | `{}` | Headers. | | `cookies` | `Object` | no | `{}` | Cookies. | | `serialize` | `Object` | no | `null` | Data serialization. One of: `json` (JSON), `urlencoded` (URL encode), `buffer` (Buffer). | | `send` | `String` | no | `all` | Send to output. One of: `all` (Everything), `response` (Response body), `chunks` (Chunks of buffer), `headers` (Headers only), `status` (Status code). | | `path` | `String` | no | | Read path. | | `path2` | `String` | no | | Write path. | | `patherr` | `String` | no | | Error path. | **Inputs:** `payload` (Payload). **Outputs:** `response` (Response), `error` (Error). The component makes a HTTP request. The response data will be serialized as the payload. __Response__: ```json { status: Number, headers: { key: value }, cookies: { key: value }, host: String, body: String/Object/Buffer } ``` ### jsonschemavalidator.html · version 1 Type: `component` Validates incoming data against a JSON schema. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `schema` | `String` | no | | JSON schema. | **Inputs:** `input` (Input), `schema` (Schema). **Outputs:** `output` (Output), `schema` (Schema), `error` (Error). [JSON schema documentation](https://json-schema.org/learn/getting-started-step-by-step.html) **Inputs** - `input` validates data and send the result to output if no error, otherwise send error to error output - `schema` reads the schema and send it to the schema output ### livestats.html · version 1 Type: `component` Shows statistics of incoming messages live. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `interval` | `Number` | no | `1000` | Interval (ms). | | `color` | `String` | no | `#E73CF7` | Color. | **Inputs:** `input` (Counter). **Outputs:** none. **Live Stats Component** Keep an eye on incoming messages in a snap! ### logger.html · version 1 Type: `component` Logs information about incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | `id` | Message ID. | | `name` | `String` | no | `{{ data.name }}` | Log name. | | `status` | `String` | no | `Step 1` | Log step. | | `remove` | `String` | no | `1 year` | Remove logs older than. | **Inputs:** `input` (Input), `error` (Error). **Outputs:** `error` (Error), `output` (Output). The component logs information about incoming data. ### macro.html · version 1 Type: `component` Transforms data with the Total.js Macro language. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `code` | `String` | no | `RETURN DATA` | The code in the Total.js Macro language. | | `clear` | `String` | no | | Clear temporary data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The macro component uses Total.js Macro language that allows you to write much simple code like in JavaScript. Macros are targeted for small data transformation. - you don't need to solve Upper/Lower case - `return EXPRESSION` will return data and send them next - `data` keyword contains a message data - `temp` keyword can contain a persistent temporary data __Example__: ```text IF DATA>20 AND DATA<35 RETURN DATA * 5 FI ``` ### map-array.html · version 1 Type: `component` Keeps only the listed properties of each object in an array. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `array` | `String` | no | | Return an Array of Arrays (Default: Array of Objects). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component can iterate over an array and only take properties listed in the configuration. __The input must be an array of objects!__ **Example data** ```js [ { sensor: { temperature: 25, humidity: 50, ... some more properties }}, { sensor: { temperature: 24, humidity: 55, ... some more properties }}, { sensor: { temperature: 23, humidity: 60, ... some more properties }} ] ``` **Example configuration** - `sensor.temperature` -> `temp` - `sensor.humidity` -> `hum` **Example output** ```js [ { temp: 25, hum: 50 }, { temp: 24, hum: 55 }, { temp: 23, hum: 60 } ] ``` If `Return an Array of Arrays` is checked then each of the Map properties will be pushed to a new array, see example bellow **Example given the data above and this configuration:** `Return an Array of Arrays` -> **checked** **Map**: - `sensor.temperature` - `sensor.humidity` **Example output:** ```js [ [25, 50], [24, 55], [23, 60], ] ``` ### merge.html · version 1 Type: `component` Merges incoming data into an array. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `limit` | `Number` | no | `0` | Limit. | | `timeout` | `Number` | no | `2000` | Timeout. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component merges incoming data into an array. ### merginputs.html · version 1.1.0 Type: `component` Merges the data of several inputs into one object. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `inputs` | `Array` | no | `[]` | The inputs to merge. | | `clear` | `String` | no | | Clear cache. | | `path` | `String` | no | | Path. | | `assign` | `String` | no | | Assign to the path. | | `required` | `String` | no | | Required. | **Inputs:** they come from the settings of the node. **Outputs:** `output` (Output). This component merges multiple inputs into one object. ### modified.html · version 1 Type: `component` Compares incoming data with the previous data. **Inputs:** `input` (Input). **Outputs:** `modified` (Modified), `notmodified` (Not modified). The component compares incoming data with previous data. ### modify.html · version 3 Type: `component` Sets, moves or removes properties of the incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `rules` | `Array` | no | `[]` | The rules that change the data, applied in order. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component allows you to set/modify/move/remove properties of the incomming data. For eaxample, to set the message data to a string `Hello world` select *Message data* in the rule dropdown and leave the text field empty. Then in the bellow dropdown select `string` and enter the desired string in the text field. __Result:__ - before: $.data -> 'Hello world' - after: $.data -> 'New string' **Expression** Available params are: `data`, `repo`, `variables` ,`variables2` Where data is message.data, repo is message.repo --> [Documentation](https://docs.totaljs.com/total4/40844001ni51c) And variables are local variables which can be set in the Variables dialog accessible on the main toolbar(the button between Plus icon and Bug icon) For example, we want message data to be the value of (data.value + variables.offset) __Result:__ - before: $.data --> `{ value: 100 }` / variables --> `{ offset: 20, ... many other properties }` - after: $.data -> `{ value: 120 }` The expression: `data.value + variables.offset` **Important** - `Remove` -> `Message data / Message repo` -> `` will set `Message data / Message repo` to `null`; - `Remove` -> `Local variables / Global variables` -> `` will be ignored but `Remove` -> `Local variables / Global variables` -> `myVar` will work. - `Set` -> `Message data` -> `some.path` to: `Message data` -> `some.other.path` will add another property to the incoming data and rest of the data will remain untouched - `Set` -> `Message data` -> `` to: `Message data` -> `some.path` will essentialy overwrite the incomming data, after this there's no longer access to original data(same goes for repo) ### print.html · version 9 Type: `component` Prints incoming data in JSON format on the node. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `repo` | `Boolean` | no | `false` | Shows repository. | | `data` | `Boolean` | no | `true` | Shows data. | | `once` | `Boolean` | no | `false` | Print the data once as an example. | | `length` | `Number` | no | `0` | Max. length. | | `color` | `String` | no | | Color. | **Inputs:** `input` (Input). **Outputs:** none. The component prints incoming data in a JSON format. ### printhtml.html · version 2 Type: `component` Renders incoming data as HTML on the node. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `template` | `String` | no | `{{ value }}` | The HTML template. | **Inputs:** `input` (Input). **Outputs:** none. The component converts HTML-formatted data in the component body. You can easily visualise any data. The data is rendered on the server. ### printjson.html · version 2 Type: `component` Prints incoming data in JSON format. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `repo` | `Boolean` | no | `false` | Shows repository. | | `data` | `Boolean` | no | `true` | Shows data. | **Inputs:** `input` (Input). **Outputs:** none. The component prints incoming data in a JSON format. ### printtext.html · version 1 Type: `component` Prints incoming data as plain text. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | `response` | Path. | **Inputs:** `input` (Input). **Outputs:** none. The component prints text as plain text format. ### secrets.html · version 1 Type: `component` Creates secret variables from the incoming data. **Inputs:** `input` (Input). **Outputs:** none. The component creates secret variables from the input message data. You can read data easily via `{key}` in the component's settings. Keys and their values must be of String type. ```js { key1: value1, key2: value2, keyN: valueN } ``` ### sendandwait.html · version 1 Type: `component` Sends the data and then waits for a set time. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `timeout` | `Number` | no | `1` | Interval. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component sends the data next, and then waits for a defined period. ### stepper.html · version 1 Type: `component` Holds incoming messages until you release them. **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component postpones incoming messages. Releasing messages must be done by hand. ### stringoperations.html · version 1 Type: `component` Applies string operations to the incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `operation` | `String` | no | `lowercase` | Operation. One of: `capitalize` (Capitalize), `lowercase` (Lower Case), `uppercase` (Upper Case), `slug` (Slug), `deburr` (Remove diacritic), `reverse` (Reverse), `spaces` (Remove spaces). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This components can apply string operation to your components. - input: `String` - output: `String` ### switch.html · version 4 Type: `component` Sends each message to the output of the first condition it meets. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `conditions` | `Array` | no | `[{"operator":"eq","value":"Hello world","type":"string"}]` | The conditions. Each condition has its own output, in the same order. | **Inputs:** `input` (Input). **Outputs:** `output1` (Output #1); more come from the settings of the node. **Source and Path** Use the **Source** dropdown to select where to look for the value to use in the conditions check. Set a **Path** if the value is not the data itself. It supports dot notation: `position.longitude` or `sensor.0.value` for arrays, it does not support `sensor[0].value`. **Expression** supports javascript syntax. Should return a value which will be used in condition check as `data`. Available variables: data, repo, variables, variables2 **Expressions example:** ```js data.value - variables.offset ``` **Conditions** Each of the **Conditions** corresponds to an output in the exact same order. First condition -> First output. **Operator** Not all operators work on all data types. For example it is not possible to use `>` or `<` for strings, etc. *index of* only works for data of type array or string. **Expression operator** In this case the **type** field is ignored and the expression in the **value** field must return `true` or `false`. Available variables: data, repo, variables, variables2. Expressions operator example: ```js data.value > variables.threshold; ``` or with a conditions ```js if (typeof data.value !== 'number') return false; else return data.value > parseInt(variables.threshold); ``` **Expression type** The expression in the **value** field must return a value which will be used in the given operation. Available variables: data, repo, variables, variables2. Expressions example: ```js data.value - variables.offset ``` **Between operator** only works with datatype number and the value must be two comma separated values. e.g.: `2,4` so the condition becomes `val > 2 && val < 4` ### telemetry.html · version 4 Type: `component` Shows values of the incoming data in a template on the node. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `paths` | `Object` | no | `{}` | Properties to show in the template. | | `interval` | `Object` | no | `null` | Update interval (in ms). | | `format` | `String` | no | `dd.MM.yyyy HH:mm:ss` | Date format. | | `extend` | `String` | no | | Extend previous data? | **Inputs:** `input` (Input). **Outputs:** none. The component shows data in a template. Hovering over the value shows the last update time. Assuming this incomming data: ```javascript { speed: 1, nested: { value: 2 }, array: [{ value: 3 }] } ``` The paths bust be defined as: ``` speed // -> 1 nested.value // -> 2 array.0.value // -> 3 ``` ### teleport.html · version 3 Type: `component` Moves a message to another Teleport component without a connection. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | | Name. | | `color` | `String` | no | `#B9261A` | Color. | **Inputs:** they come from the settings of the node. **Outputs:** they come from the settings of the node. The component can teleport (input) message to another teleport (output) component. ### textenricher.html · version 1 Type: `component` Fills a text template with values from the incoming data. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `prop` | `String` | no | `content` | Read. | | `text` | `String` | no | `{value}` | Text. | | `path` | `String` | no | `content` | Write. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component enriches a text property according to the template defined in the configuration. The `{value}` placeholder is replaced with the corresponding value from the payload. ### throttle.html · version 1 Type: `component` Sends only a limited number of messages. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `limit` | `Number` | no | `1` | Limit. | | `delay` | `Number` | no | `0` | Delay (milliseconds). | **Inputs:** `input` (Input). **Outputs:** `output` (Outputs). The component sends only limited count of messages. ### transform.html · version 1 Type: `component` Sends data to a transform output and continues with the answer. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Transform value according to this path. | | `assign` | `String` | no | | Assign response to the path. | **Inputs:** `input` (Input). **Outputs:** `transform` (Transform), `output` (Output). This component can transform message data. ### transformer.html · version 1 Type: `component` Changes incoming data with your own code. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `code` | `String` | no | `data.name = data.name.toUpperCase()` | The JavaScript code that changes the data. | | `clear` | `Boolean` | no | `false` | Clear repository object. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). With this component you can easily modify incoming data. Then the `data` content is delivered. For storing temporary/persistent data you can use `repo {Object}` and `refs {Object}` variables. __Example 1__: ```js // "data" is a reference to message data data.name = data.name.toUpperCase(); ``` __Example 2__: ```js data = data.toUpperCase(); ``` __Example 3__: ```js var tmp = data; data = {}; data.name = tmp.Name; ``` ### urldownload.html · version 2 Type: `component` Downloads the content of a URL address. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `prop` | `String` | no | `url` | URL address property. | | `path` | `String` | no | `response` | Save response to. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). The component downloads content from the given URL. __Payload__: ```html https://www.totaljs.com ``` or ```js { url: 'https://www.totaljs.com' } ``` ### xmlparser.html · version 1 Type: `component` Parses XML from a string. **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Parse XML from string. - __Input__: {String} - __Ouput__: {String} --- title: Triggers and time project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/triggers-and-time/ updated: 2026-11-20T06:50:52.962Z --- # Triggers and time > Components that start messages on demand, on a schedule or from an endpoint, and work with dates. Components that start messages on demand, on a schedule or from an endpoint, and work with dates. This page holds the catalogue groups **Triggers**, **Timers**, **Date & Time**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### crontab.html · version 1 Type: `component` Triggers data at the times you set with a cron expression. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `random` | `Boolean` | no | `true` | Random data. | | `type` | `String` | no | `now` | Type. One of: `string` (String), `number` (Number), `boolean` (Boolean), `now` (Current date and time), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). | | `data` | `String` | no | | Data. | | `timers` | `Array` | no | `["0 9 * * *"]` | Timers. | | `restart` | `Boolean` | no | `false` | Trigger 5s after initialization. | | `offset` | `String` | no | | Time zone offset. | **Inputs:** none. **Outputs:** `output` (Output). The component can make a trigger in the specific time and date. **Cron string: `* * * * *`** Meaning of each `*` explained bellow, in order from left to right: - minute `0 - 59` - hour `0 - 23` - day of month `1 - 31` - month `1 - 12` - day of week `0 - 6` and `0` is Sunday ``` 0 16 * * * -> trigger every day at 16:00 20 19 * * * -> every day at 19:20 and 19:40 * * * * * -> trigger every minute 0 20 * * 1 -> every monday at 20:00 ``` ### date.html · version 1 Type: `component` Returns the current date and time, raw or formatted. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `format` | `String` | no | | Date format. | **Inputs:** `input` (Trigger). **Outputs:** `output` (Date/Time). The component will return a Date/Time object (raw or formatted) according to its configuration. ### exec.html · version 1 Type: `component` Sends data into the FlowStream when your code calls it. **Inputs:** none. **Outputs:** `output` (Output). The component is extraordinary because it must be executed directly from the source code via the `flowstream.exec()` method. The component triggers received data into the Flow. ```js var opt = {}; opt.id = 'ID_OF_EXEC_INSTANCE'; opt.data = { custom: 'data' }; opt.callback = function(err, msg) { // msg.uid; // msg.ref; // msg.repo {Object} // msg.data {Object} // msg.cloned {Number} how many times was the message cloned? // msg.duration {Number} in milliseconds }; // optional: // opt.vars = {}; --> custom variables // opt.repo = {}; --> custom repository data and this data will be returned in the callback // opt.uid; --> for storing some unique ID // opt.ref; --> for storing some reference ID flowinstance.exec(opt); ``` ### minutely.html · version 1 Type: `component` Triggers data every minute. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `random` | `Boolean` | no | `true` | Random data. | | `type` | `String` | no | `now` | Type. One of: `now` (Current date), `counter` (Counter), `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). | | `data` | `String` | no | | Data. | **Inputs:** none. **Outputs:** `output` (Output). The component triggers data into the Flow in every minute. ### notify.html · version 1 Type: `component` Receives data that is sent to the notify endpoint. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `method` | `String` | no | `all` | HTTP Method. One of: `all` (All supported HTTP methods), `GET`, `POST`. | | `send` | `String` | no | `all` | Send to output. One of: `all` (Everything), `query` (Query arguments), `body` (Payload), `headers` (Headers), `cookies` (Cookies). | **Inputs:** none. **Outputs:** `output` (Output). This component captures data on the `/notify/` endpoint. __Output data__: ```js { "method": String, "query": Object, "body": Object, "headers": Object, "cookies": Object, "url": String, "ip": String } ``` ### timezone.html · version 1 Type: `component` Converts a date and time to a time zone. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `ts` | `String` | no | `Europe/Bratislava` | Timezone. | | `input` | `String` | no | `ts` | Input property. | | `output` | `String` | no | `ts` | Output property. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component converts a date and time to a specified timezone and returns the corresponding UTC date. ### timeout.html · version 1 Type: `component` Starts a timeout and restarts it when a new message arrives. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `timeout` | `Number` | no | `5` | Timeout. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component starts a timeout and restarts it when a new message arrives. ### timer.html · version 3 Type: `component` Triggers data at a regular interval. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `random` | `Boolean` | no | `true` | Random data. | | `type` | `String` | no | `string` | Type. One of: `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). | | `data` | `String` | no | | Data. | | `prop` | `String` | no | | Write to. | | `restart` | `Boolean` | no | `false` | Trigger 5s after initialization. | | `interval` | `Number` | no | `5000` | Interval (milliseconds). | **Inputs:** none. **Outputs:** `output` (Output). The component triggers data into the Flow in the specified interval. ### trigger.html · version 6 Type: `component` Sends data into the FlowStream when you select its button. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `random` | `Boolean` | no | `true` | Random data. | | `type` | `String` | no | `string` | Type. One of: `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). | | `data` | `String` | no | | Data. | | `restart` | `Boolean` | no | `false` | Trigger 5s after initialization. | | `prompt` | `Boolean` | no | `false` | Prompt. | | `prop` | `String` | no | | Write to. | | `promptlabel` | `String` | no | | Prompt label. | **Inputs:** none. **Outputs:** `output` (Output). The component triggers data into the Flow. --- title: Data and transformations project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/data-and-transformations/ updated: 2026-11-20T06:50:52.962Z --- # Data and transformations > Components that parse, read, template and generate data. Components that parse, read, template and generate data. This page holds the catalogue groups **Transformations**, **Objects**, **Data**, **Array**, **Templates**, **HTML**, **Generators**, **Scripting**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### cheerio.html · version 1 Type: `component` Runs your code with Cheerio to read data from HTML. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `fn` | `String` | no | | The code that reads the HTML. `$` is the Cheerio instance and `html` is the HTML string; return the result. | | `path` | `String` | no | | Path to html. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `cheerio` when you add the component. Uses [Cheerio](https://cheerio.js.org/index.html) Please refer to the [documentation](https://cheerio.js.org/classes/Cheerio.html) for available functions. **Input** ```js ``` **Output** ```js { result: , input: } ``` **Example code** ```js // instance : component instance // $: cheerio instance // html: html string var txt = []; $('ul > li').each(function (i, elem) { txt.push($(this).text()); }); return txt; ``` ### dataparser.html · version 1 Type: `component` Splits a buffer or string into parts by new lines or by begin and end phrases. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `convert` | `Boolean` | no | `false` | Convert parsed value to the object. | | `beg` | `String` | no | | Begin phrase. | | `end` | `String` | no | | End phrase. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component can parse newline data or begin/end phrases in the buffer or string. In addition, it can help with parsing XML or CSV files. ### model.html · version 3 Type: `component` Prepares incoming data according to a schema. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | `Model` | Model name. | | `path` | `String` | no | | Load data from the specific property/field. | | `rewrite` | `Boolean` | no | `true` | Rewrite value only (otherwise, it will replace entire message data). | **Inputs:** `input` (Data), `partial` (Partial data). **Outputs:** `output` (Output), `error` (Error). This component prepares incoming data according to the defined schema. Output is prepared model or Error. ### object.html · version 1 Type: `component` Creates an object from a Tangular template. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `template` | `String` | no | | The Tangular template of the object. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component creates an object from the defined string (Tangular) template. With the help of the Tangular template engine, you can use conditions, loops, etc.. __Available markup__: - `{{ data.key }}` represents data - `{{ variables.key }}` represents local and global Flow variables - `{{ hostname }}` contains a current URL address to the main Flow app `{String}` - `{{ url }}` contains a current URL address to the current Flow `{String}` - `{{ env }}` contains a current environment `{String}` ### qrcode.html · version 1 Type: `component` Generates a QR code. **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Flow installs the npm package `qrcode` when you add the component. The component generates QR Code. __Input data__: ```js { text: String } ``` __Output data__: ```js { text: String, data: 'Data URL - BASE64' } ``` ### read.html · version 3 Type: `component` Reads specific values from the data according to a map. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Load data from the specific property/field. | | `keep` | `Boolean` | no | `false` | Keep the message data and transform only specific paths. | | `rewrite` | `String` | no | | Rewrite value only (otherwise, it will replace entire message data). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component reads specific values according to the configured map. ### rssreader.html · version 1 Type: `component` Downloads every item of an RSS feed. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | | URL address. | | `type` | `String` | no | `a` | Output. One of: `a` (Send all items), `b` (Send only new items), `c` (Send every item separately), `d` (Send only new items separately). | **Inputs:** `input` (Trigger). **Outputs:** `output` (Output). The component downloads every item from the RSS source. A message on to this `Trigger` input starts downloading RSS data. __Example__: ```js { title: String, description: String, link: String, image: String, // optional date: Date // optional } ``` ### script.html · version 1 Type: `component` Runs your own JavaScript code with a simple send function. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `code` | `String` | no | | The JavaScript code that runs for each message. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component executes a custom JavaScript code as it is. To send data to the default output use `send(data);` ### snapshot.html · version 1 Type: `component` Saves snapshots of incoming data to send them again later. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | `id` | Message ID. | | `name` | `String` | no | `{{ data.name }}` | Snapshot name. | | `status` | `String` | no | `Initial data` | Snapshot status. | | `remove` | `String` | no | `1 year` | Remove snapshots older than. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component takes a snapshot of the incoming data and the user can reuse saved snapshots in the future. ### split.html · version 1 Type: `component` Splits an array into separate messages. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Load data from the specific property/field. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component splits a message with an array of objects on the input into separate messages with individual objects on the output. __Input example__: ```js [ { "email": "michal@totaljs.com", "date": 20220202, "name": "Michal Klacan" }, { "email": "martin@totaljs.com", "date": 20220204, "name": "Martin Smola" }, { "email": "peter@totaljs.com", "datum": 20220210, "name": "Peter Sirka" } ] ``` __Output example__: ```js { "email": "michal@totaljs.com", "date": 20220202, "name": "Michal Klacan" } ``` ```js { "email": "martin@totaljs.com", "date": 20220204, "name": "Martin Smola" } ``` ```js { "email": "peter@totaljs.com", "datum": 20220210, "name": "Peter Sirka" } ``` ### tangular.html · version 1 Type: `component` Renders a Tangular template with the incoming data. **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component uses server-side implementation of [Tangular template engine](https://docs.totaljs.com/components/40d06002lm50c/). **Example** __Incomming data__: ```js { app_name: 'Total.js Flow' } ``` __Template__: ```html App name: {{ value.app_name }} ``` - `$` type `{MessageInstance}` In the example bellow, the $.refs.controller is only available if the message was created by the Route component: ```html URL: {{ $.refs.controller.url }} ``` ### vs.html · version 1 Type: `component` Generates a variable symbol in a custom format. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `format` | `String` | no | `yyyy####` | Format. | | `path` | `String` | no | | Path. | | `autoreset` | `String` | no | `yyyy` | Auto-reset. One of: `yyyy` (Yearly), `MM` (Monthly), `dd` (Daily). | | `start` | `Number` | no | `0` | Start from. | | `reset` | `Boolean` | no | `false` | Reset indexer. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). The component will generate a variable symbol according to a custom format. --- title: Flow and FlowStreams project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/flow-and-flowstreams/ updated: 2026-11-20T06:50:52.962Z --- # Flow and FlowStreams > Components that debug a FlowStream, extend the server and pass data between FlowStreams. Components that debug a FlowStream, extend the server and pass data between FlowStreams. This page holds the catalogue groups **Flow**, **FlowStream**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### consoledebug.html · version 4 Type: `component` Prints incoming messages and debug logs in the console of the designer. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `native` | `Boolean` | no | `true` | Append the log messages to the native web developer console. | | `console` | `Boolean` | no | `false` | Capture all console.log(). | **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. The component can print the payload of incoming messages and `instance.debug()` log messages in JSON format. ### consolelog.html · version 1 Type: `component` Prints the message into the console of the server. **Inputs:** `input` (Input). **Outputs:** none. This component prints a message into the console. ### debug.html · version 4 Type: `component` Prints incoming messages and debug logs in JSON format. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `repo` | `Boolean` | no | `false` | Shows repository. | | `debug` | `Boolean` | no | `true` | Shows debug messages. | | `data` | `Boolean` | no | `true` | Shows data. | **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. The component can print the payload of incoming messages and `instance.debug()` log messages in JSON format. ### flowrecorder.html · version 1 Type: `component` Records significant events of the FlowStream worker. **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. As the FlowStream worker runs, the component records significant information. The component can reveal hidden bugs or performance issues. The component stores data in the `logs/*` directory. ### input.html · version 2 Type: `component` Receives data that a Publish component sends from another FlowStream. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | `Input` | Input name. | | `readme` | `String` | no | | Readme. | **Inputs:** none. **Outputs:** `data` (Data). The component receives data in an encapsulated FlowStream. ### kill.html · version 1 Type: `component` Kills the current FlowStream process. **Inputs:** `input` (Input). **Outputs:** none. Be careful because this component will kill the current Flow instance. It's targeted only for exceptional cases. ### output.html · version 2 Type: `component` Sends data to the Subscribe components of other FlowStreams. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | `Output` | Output name. | | `readme` | `String` | no | | Readme. | **Inputs:** `data` (Data). **Outputs:** none. The component can send data from an encapsulated FlowStream. ### publish.html · version 5 Type: `component` Sends data to an Input component of another FlowStream. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | | Input. | **Inputs:** `data` (Data). **Outputs:** none. The component publish the data to the specific `Input` component. ### serverextension.html · version 1 Type: `component` Installs a Total.js server-side extension from your code. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | `My extension` | Name. | | `install` | `String` | no | | Installation code. It runs when the node starts and when its configuration changes. | | `uninstall` | `String` | no | | Uninstallation code. | | `icon` | `String` | no | | Icon. | **Inputs:** none. **Outputs:** none. The component installs Total.js server-side extension. In other words: it can evaluate JavaScript code when the component is initialized or the component settings is changed. ### subscribe.html · version 4 Type: `component` Receives data from an Output component of another FlowStream. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | | Output. | **Inputs:** none. **Outputs:** `data` (Data). The component subscribes to the specific `Output` component. --- title: Files and video project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/files-and-video/ updated: 2026-11-20T06:50:52.962Z --- # Files and video > Components that watch, write, rename and remove files, and convert videos. Components that watch, write, rename and remove files, and convert videos. This page holds the catalogue groups **Files**, **Video**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### filewatcher.html · version 1 Type: `component` Waits for a file to exist, reads it, sends its content and removes it. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Path. | | `parser` | `String` | no | `json` | Parser. One of: `json` (JSON), `text` (Text), `buffer` (Buffer), `number` (Number), `date` (Date). | | `interval` | `Number` | no | `1000` | Interval (milliseconds). | **Inputs:** none. **Outputs:** `output` (Output). The component watches the existence of the file, then reads the content and sends it next. The file will be removed automatically after reading. ### filewriter.html · version 1 Type: `component` Writes incoming data into a file. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Path. | | `serializer` | `String` | no | `json` | Serializer. One of: `json` (JSON), `text` (Text), `buffer` (Buffer). | | `rewrite` | `Boolean` | no | `true` | Rewrite content. | | `divider` | `String` | no | `\n` | Divider. | **Inputs:** `input` (Input). **Outputs:** none. The component writes incoming data into the file. ### fileswatcher.html · version 1 Type: `component` Watches a folder for new files. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | `/www/` | Path. | | `ext` | `String` | no | `.mp4` | Extension. | | `interval` | `Number` | no | `5000` | Interval (milliseconds). | | `expire` | `String` | no | `10 minutes` | Expire. | **Inputs:** none. **Outputs:** `output` (Output). This component watches new files. __Output__: ```js { "filename": "filename.mp4", "size": 10785133, "atime": "2026-04-30T06:53:00.501Z", "ctime": "2026-05-27T16:44:08.217Z", "mtime": "2026-04-30T06:53:00.501Z", } ``` ### fsunlink.html · version 1 Type: `component` Removes a file. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `prop` | `String` | no | `filename` | Read filename from the property. | **Inputs:** `input` (Filename). **Outputs:** `output` (Output). This component removes file according to the configuration path. __Payload__: ```js String // or { filename: 'String' } ``` __Output__: Incoming payload. ### fsrename.html · version 1 Type: `component` Renames a file. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `prop` | `String` | no | `filename` | Read filename from. | | `prop2` | `String` | no | `rename` | Rename filename to. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). This component renames file according to the input values. __Payload__: ```js { filename: 'String', rename: 'String' } ``` __Output__: Incoming payload. ### fstouch.html · version 1 Type: `component` Updates the modification time of a file. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | `filename` | Property. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component updates a file's modification timestamp if the file exists. __Input__: ```js { filename: '/absolute/path/to/file.txt' } ``` __Output__: ```js { filename: '/absolute/path/to/file.txt' } ``` ### ffmpegconverter.html · version 1 Type: `component` Resizes a video and changes its frame rate with FFmpeg. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `width` | `Number` | no | `400` | Width. | | `fps` | `Number` | no | `0` | FPS. | | `path` | `String` | no | `/` | Path. | | `prop` | `String` | no | `response` | Output property. | | `prop2` | `String` | no | `preview` | Output preview. | | `prop3` | `String` | no | `duration` | Output duration. | **Inputs:** `input` (File). **Outputs:** `output` (Output), `error` (Error). This component resizes video and change framerate according to the component settings. The component extends the output by adding an __Output property__ with a containing the file name. __Output__: ```js { // incoming payload ... output_property: String } ``` --- title: Checks and statistics project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/checks-and-statistics/ updated: 2026-11-20T06:50:57.962Z --- # Checks and statistics > Components that check your server and services and measure your messages. Components that check your server and services and measure your messages. This page holds the catalogue groups **Checks**, **Stats**, **Linux**, **Dashboard**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### checkfreespace.html · version 1 Type: `component` Checks the free space on a disk. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `warning` | `Number` | no | `10000` | Minimal free space. | **Inputs:** `input` (Test). **Outputs:** `error` (Error). This component checks a freespace on HDD. ### checklog.html · version 1 Type: `component` Reads new lines of a log file and reports the ones that contain your keywords. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | `/var/log/auth.log` | A path to the log file. | | `error` | `String` | no | `Log error: {0}` | Error message. | | `keywords` | `String` | no | `Error, error, ERROR` | Keywords. | | `remember` | `Boolean` | no | `true` | Remember file position. | **Inputs:** `input` (Test). **Outputs:** `error` (Error). This component checks a file and tries to find a ### checkpg.html · version 1 Type: `component` Checks the connection to a PostgreSQL database. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `connection` | `String` | no | `postgresql://user:pass@hostname:5432/database` | Connection string. | | `sql` | `String` | no | `SELECT 1` | SQL statement. | | `error` | `String` | no | `PostgreSQL error: {0}` | Error message format. | **Inputs:** `input` (Test). **Outputs:** `error` (Error). Flow installs the npm package `querybuilderpg` when you add the component. This component checks PostgreSQL database connection. ### checkurl.html · version 1 Type: `component` Checks that a URL address responds. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | `https://www.totaljs.com` | URL address. | | `error` | `String` | no | `URL error: {0}` | Error message format. | **Inputs:** `input` (Test). **Outputs:** `error` (Error). This component checks URL address. ### csvdataset.html · version 2 Type: `component` Stores incoming data as a CSV dataset in the private folder. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | | Name. | | `unit` | `String` | no | | Unit. | | `icon` | `String` | no | | Icon. | | `color` | `String` | no | | Color. | | `decimals` | `Number` | no | `2` | Decimals. | | `type` | `String` | no | `daily` | Type. One of: `lastvalue` (Last value only), `logger` (Logger), `hourly` (Hourly), `daily` (Daily), `weekly` (Weeekly), `monthly` (Monthly), `yearly` (Yearly). | | `sum` | `Number` | no | `0` | Calculate the sum. One of: `0` (Disabled), `1` (Periodical sum), `2` (Total sum). | | `hours` | `Number` | no | `48` | Hours. | | `days` | `Number` | no | `12` | Days. | | `months` | `Number` | no | `12` | Months. | | `years` | `Number` | no | `6` | Years. | **Inputs:** `input` (Value), `live` (Live stats), `stats` (Stats). **Outputs:** `stats` (Output). The component stores data as CSV Dataset for e.g. Dashboard application. Dataset is stored in `/private/` path that is available with the help of the Flow access token. CSV file contains only processed values (according to the period) and the `.meta` file contains meta data + last value. __Input for data processing__: ```js { key: String, // optional, e.g. device_id | device_name value: Number // measured value } ``` **CSV columns** - `a` = `key {String}` - `b` = `value {Number}` - `c` = `min {Number}` - `d` = `max {Number}` - `e` = `sum {Number}` - `f` = `count {Number}` - `g` = `tshour {Number}`in the form `yyyyMMddhh` - `h` = `tsday {Number}` in the form `yyyyMMdd` - `i` = `tsweek {Number}` in the form `yyyyww` - `j` = `tsmonth {Number}` in the form `yyyyMM` - `k` = `tsyear {Number}` in the form `yyyy` ### duration.html · version 1 Type: `component` Measures how long messages take to pass through the FlowStream. **Inputs:** `input` (Input). **Outputs:** `output` (Stats). The component counts the duration of the message. All values except count are defined in seconds. Place this component at the end of the flow. __Output__: ```js { min: Number, max: Number, avg: Number, last: Number, count: Number } ``` ### measuretime.html · version 1 Type: `component` Measures the time taken to create and send a message. **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component measures the time taken to create and send a message. ### norepeat.html · version 1 Type: `component` Stops the same content from being sent again within a short time. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `expire` | `Number` | no | `1` | Expire in minutes. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component prevents the same content from being sent again in a short amount of time. ### nvidiasmi.html · version 1 Type: `component` Collects NVIDIA GPU statistics at regular intervals. **Inputs:** none. **Outputs:** `output` (Stats). A FlowStream can hold only one node of this component. This component periodically collects hardware statistics. ### stopwatch.html · version 3 Type: `component` Measures the time taken to create and send a message. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | `Stopwatch` | Name. | | `delay` | `Number` | no | `1000` | Idle time delay (milliseconds). | **Inputs:** `input` (Counter). **Outputs:** none. This component measures the time taken to create and send a message. --- title: Databases project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/databases/ updated: 2026-11-20T06:50:57.962Z --- # Databases > Components that read and write data in databases. Components that read and write data in databases. This page holds the catalogue group **Databases**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### influxdb.html · version 1 Type: `component` Writes data to InfluxDB or runs a Flux query. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | | Server url. | | `token` | `String` | no | | Token. | | `org` | `String` | no | | Organization. | | `bucket` | `String` | no | | Bucket. | | `api` | `String` | no | | Action. One of: `write` (Write data), `query` (Execute a Flux query). | | `fields` | `String` | no | | Fields. | | `tags` | `String` | no | | Tags. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `@influxdata/influxdb-client` when you add the component. **Input** Expected data for "Write data": ```js { measurement: '', fields: { fieldname: , }, tags: { tagname: '' } } ``` Expected data for "Execute a Flux query": ```js { query: 'from(bucket: "Some Bucket") |> range(start: -1h)' } ``` ### localstorage.html · version 1 Type: `component` Stores data for a short time and reads it back. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `savekey` | `String` | no | `id` | Save key. | | `readkey` | `String` | no | `id` | Read key. | | `path` | `String` | no | | Where to save data? | | `remove` | `Boolean` | no | `true` | Remove the item after reading. | | `expire` | `String` | no | `1 hour` | Expiration. | **Inputs:** `save` (Save), `read` (Read). **Outputs:** `output` (Output), `error` (Error). A small and simple persistent storage component is provided by this component. Data can be stored for a short period of time and read when needed. ### mongodb-insert.html · version 1 Type: `component` Inserts documents into MongoDB. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `name` | `String` | no | | Connection name. | | `connection` | `String` | no | | Connection string (without the database name). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `mongodb@4.0.0` when you add the component. **Input** Example ```javascript { database: 'database-name', collection: 'collection-name', data: { ... }, // data to insert, object for `insertOne` and an array of objects for `insertMany` options: { ... }// insert options as passed to `insertOne(data, options)` or `insertMany(data, options)` } ``` ### mongodb-query.html · version 2 Type: `component` Runs queries on MongoDB. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `fn` | `String` | no | `return query.find();` | Query editor. | | `name` | `String` | no | | Connection name. | | `connection` | `String` | no | | Connection string (without the database name). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm packages `mongodb@4.0.0`, `mquery` when you add the component. Uses mquery under the hood. Here is the [documentation](https://www.npmjs.com/package/mquery) **Input** Example ```javascript { database: 'database-name', collection: 'collection-name', data: // this prop will be passed into the query function } ``` **Query editor** ```js // query; mquery instance // data; data from the incomming object return query.find(); // return all documents ``` **Important** In the `.select()` you cannot use inclusion and exclusion together. This is invalid: `.select('firstname -lastname')` Valid exclusion: `.select('-lastname')` or `.select('-email -lastname')` etc. Valid inclusion: `.select('name email')` or `.select('email lastname')` etc. ### mysql.html · version 2 Type: `component` Runs SQL queries on a MySQL database. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `connection` | `String` | no | | Connection string. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `mysql2` when you add the component. **Input** Expected data: ```javascript { query: 'SELECT * FROM tblname;' } ``` ### nosql.html · version 1 Type: `component` Inserts, reads, queries, updates and removes documents in the Total.js NoSQL database. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `collection` | `String` | no | | DB collection(table) name. | | `method` | `String` | no | | Method. One of: `insert` (Insert), `update` (Update), `read` (Read), `query` (Query), `remove` (Remove). | | `addid` | `String` | no | | Add unique ID to `id` property of data before insert. | | `upsert` | `String` | no | | Insert document if it doesn't exist. | | `upsertid` | `String` | no | | Add unique ID to `id` property of data before insert (only if it doesn't exist). | **Inputs:** `input` (Input). **Outputs:** `output` (Output). **Outputs** - response from nosql engine **Settings** - collection: (optional) if not set, incomming data object must have a 'collection' property set - method: (optional) if not set, incomming data object must have a 'method' property set **Input** ```javascript { collection: 'users', // optional, will override settings value method: 'query', // insert|read|query|update|remove - optional, will override settings value // for insert, update data: { ... }, // for query, read, update, remove filter: [ ['where', 'sensor', 'temp'], // builder.where('sensor', 'temp'); ['limit', 2] // builder.limit(2); ], upsert: true // only for update, if set then document will be inserted if it doesn't exist addid: true // only for insert and update, if set then id prop will be automaticaly generated (for update only when upsert is also set) } ``` **Insert** - inserts recieved data - expects data to be an Object - returns error, success, id **Read** - returns first document found - requires `filter` - returns error, response **Update** - updates document(s) - expects data to be an Object with all the props to be updated - requires `filter` - returns error, response - if response is 0 then update failed **Remove** - removes document - requires `filter` - returns error, response - if response is 0 then remove failed **Query** - returns all documents found - requires `filter` - returns error, response ### postgresql.html · version 2 Type: `component` Runs SQL queries on a PostgreSQL database. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `connection` | `String` | no | | Connection string. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `pg` when you add the component. PostgreSQL **Input** Expected data: ```javascript { query: 'SELECT * FROM tblname;' } ``` Output: ```javascript { command: 'INSERT', // SELECT, etc. rows: [], // rowCount: 1 } ``` ### sqlite3.html · version 2 Type: `component` Runs queries on an SQLite3 database. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `filename` | `String` | no | | Filename (optional). | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Flow installs the npm package `better-sqlite3` when you add the component. SQLite3 [Documentation](https://github.com/JoshuaWise/better-sqlite3/blob/HEAD/docs/api.md) ```js { // query prepare: 'INSERT INTO cats (name, age) VALUES (?, ?)', // function name: run, get, all, exec fn: 'run', // data, optional data: ['Joey', 2] // string/number or array } ``` __Functions:__ - [run](https://github.com/JoshuaWise/better-sqlite3/blob/HEAD/docs/api.md#runbindparameters---object) - [get](https://github.com/JoshuaWise/better-sqlite3/blob/HEAD/docs/api.md#getbindparameters---row) - [all](https://github.com/JoshuaWise/better-sqlite3/blob/HEAD/docs/api.md#allbindparameters---array-of-rows) - [exec](https://github.com/JoshuaWise/better-sqlite3/blob/HEAD/docs/api.md#execstring---this) --- title: Total.js project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/totaljs/ updated: 2026-11-20T06:50:57.962Z --- # Total.js > Components that use the Total.js framework: HTTP routes, responses, actions, schemas and SQL. Components that use the Total.js framework: HTTP routes, responses, actions, schemas and SQL. This page holds the catalogue group **Total.js**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### taction.html · version 2 Type: `component` Runs a Total.js action: it validates the incoming data with a schema and processes it with your code. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `partial` | `Boolean` | no | `false` | Allow partial data. | | `name` | `String` | no | `Unknown` | Action name. | | `input` | `String` | no | | Payload schema. | | `query` | `String` | no | | Query arguments schema. | | `color` | `String` | no | `#68B25B` | Color. | | `params` | `String` | no | | Params schema. | | `permissions` | `String` | no | | Permissions. | | `code` | `String` | no | | The JavaScript code of the action. | | `strerr` | `Boolean` | no | `false` | Convert errors to a string. | | `path` | `String` | no | `response` | Path for storing a response. | | `autoresponse` | `Boolean` | no | `false` | Auto HTTP response. | **Inputs:** `input` (Payload). **Outputs:** `output` (Response), `error` (Error). This component creates similar functionality as Total.js Actions. **Payload** ```js { ip: String, // optional, IP address url: String, // optional language: String, // optional ua: String, // optional, parsed user-agent user: Object, // optional headers: { key: String }, // optional, request headers cookies: { key: String }, // optional, cookies payload: {}, // optional, request payload query: { key: String }, // optional params: { key: String }, // optional files: [{ type: String, filename: String, path: String, ext: String, size: Number, width: Number, height: Number }] // optional } ``` **Custom scripting** - supports `await` - supports Total.js global functions __Properties__: - `$.model {Object}` or `model` parsed payload - `$.query {Object}` parsed URL query arguments - `$.params {Object}` parsed URL params - `$.cookies {Object}` parsed cookies - `$.files [Object]` uploaded files - `$.user {Object}` user session (optional) - `$.headers {Object}` request headers - `$.ip {String}` IP address (optional) - `$.language {String}` optional - `$.ua {String}` parsed user agent (optional) - `$.url {String}` URL endpoint - `$.message {Object}` Flow message instance - `$.request {Object}` Flow message payload data __Methods__: - `$.invalid(error)` responds with an error and ends the action - `$.success([value])` responds with `{ success: true, value }` object and ends the action - `$.callback(value)` responds with `value` object and ends the action - `$.cancel()` ends the action without response - `$.audit(message, [type])` writes audit **Supported types** - `string` - `number` - `boolean` - `date` - `object` - `email` - `phone` - `zip` - `base64` - `url` - `datauri` - `json` - `lower` - `upper` - `capitalize` all words - `capitalize2` only first word - `name` makes a name (capitalizes words and remove special characters) - `zip` - `uid` - `guid` - `color` - `icon` - `search` prepares string to a search string - `safestring` checks XSS and SQL Injections - `smallint` - `tinyint` - `{A|B|C}` enum type - `[type]` means array - `{ name:String, age:Number }` means nested object - `[ name:String, age:Number ]` means array with an object - `*something:type` is `required` field ### tapicreator.html · version 1 Type: `component` Creates a Total.js API payload from the incoming data. **Inputs:** `input` (Payload). **Outputs:** `output` (Output). This component creates Total.js API payload. Output data__: ```js { schema: 'input_name', data: input_data } ``` ### tapirouter.html · version 3 Type: `component` Routes incoming Total.js API data to an output for each operation of the API schema. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `payload` | `Boolean` | no | `false` | Send next only payload without schema. | **Inputs:** `input` (Payload). **Outputs:** they come from the settings of the node. This component routes incoming Total.js API data according to the defined API schema. The component extends input data (query, payload and params) with parsed data. __Input & Output data__: ```js { // REQUIRED payload: payload: { schema: 'schema_name/{param_1}/{param_2}?query=arguments', data: {} // optional, request payload }, ip: String, // optional, IP address url: String, // optional language: String, // optional ua: String, // optional, parsed UA user: Object, // optional headers: { key: String }, // optional, request headers cookies: { key: String }, // optional, cookies query: { key: String }, // optional params: { key: String }, // optional files: [{ type: String, filename: String, path: String, ext: String, size: Number, width: Number, height: Number }] // optional } ``` In the case of `error`, the input data is extended by the `response` property with an error. ### tauthtoken.html · version 1 Type: `component` Compares a token from the request header with the token in its configuration. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | Token. | | `code` | `Number` | no | `401` | Status code. | | `header` | `String` | no | `x-token` | Header. | | `error` | `String` | no | `Unauthorized` | Error message. | | `ddos` | `Number` | no | `0` | DDOS protection. | **Inputs:** `input` (Request). **Outputs:** `output` (Request). This component must be used only with REST Route component. It reads a token from the request header and compares it with the token declared in the configuration. ### tcors.html · version 3 Type: `component` Enables Cross-Origin Resource Sharing (CORS) for the routes of the FlowStream. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `hostnames` | `Array` | no | `[]` | Hostnames with a protocol. | **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. The component enables Cross-Origin Resource Sharing `CORS`, so the web browser will be able to communicate directly with the REST API. The functionality will work only with a defined Proxy endpoint for this Flow. ### tschema.html · version 2 Type: `component` Checks incoming data against a data schema. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `schema` | `String` | no | `*name:String, *email:Email` | Schema. | | `partial` | `Boolean` | no | `false` | Allow partial data. | | `strerr` | `Boolean` | no | `false` | Convert errors to a string. | **Inputs:** `input` (Payload). **Outputs:** `output` (Response), `error` (Error). This component is in the repository, but not in the catalogue that the **Download components** window shows. The component `Schema` can very quickly check incoming data according to the defined schema. __Supported types__: - `string` - `number` - `boolean` - `date` - `object` - `email` - `phone` - `zip` - `base64` - `url` - `datauri` - `json` - `lower` - `upper` - `capitalize` all words - `capitalize2` only first word - `name` makes a name (capitalizes words and remove special characters) - `zip` - `uid` - `guid` - `color` - `icon` - `search` prepares string to a search string - `safestring` checks XSS and SQL Injections - `smallint` - `tinyint` - `{A|B|C}` enum type - `[type]` means array - `*something:type` is `required` field ### error.html · version 1 Type: `component` Turns incoming data into the Total.js error structure. **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component transforms incoming data to the Total.js Error structure. ### insecuressl.html · version 1 Type: `component` Disables SSL certificate verification. **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. Disables SSL verification. ### querybuilderpg.html · version 1 Type: `component` Opens QueryBuilder connections to PostgreSQL databases for other components. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | `default` | Alias. | | `name` | `String` | no | `API PostgreSQL` | Name. | | `url` | `String` | no | | Connection string. | | `pooling` | `Number` | no | `2` | Pooling. | **Inputs:** none. **Outputs:** `error` (Error). Flow installs the npm package `querybuilderpg` when you add the component. The component initializes QueryBuilder for the PostgreSQL database. So you can use the 'API Database` component. Each connection must be separated by an alias. __Usage in API Database__: - `tbl_user` is targeted to the `default/tbl_user` alias connection - `anotherserver/tbl_user` will use `anotherserver` alias connection ### tredirect.html · version 2 Type: `component` Redirects an HTTP request to another address. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | | Redirect URL. | | `permanent` | `Boolean` | no | `false` | Permanent redirect. | **Inputs:** `input` (Input). **Outputs:** none. **Input** Incomming data have higher priority than the values set in the Configuration form. Both the `url` and `permanent` are optional. ```js { url: 'https://example.com', permanent: true|false } ``` ### tremember.html · version 1 Type: `component` Remembers data and returns it on request. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | | Set remembered data to the specific property/field. | **Inputs:** `remember` (Remember), `request` (Request). **Outputs:** `response` (Response). The primary goal of this component is to remember the data. The component contains two inputs: - Remember input for remembering data. - Request input as a trigger for obtaining data, then remembered data would extend the request message (its data), and the component would send it to the response output. ### tresponse.html · version 2 Type: `component` Responds to an HTTP request received by the Route component. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `type` | `String` | no | `auto` | Type. One of: `auto` (Auto), `json` (JSON), `success` (Success), `error` (Error), `empty` (Empty response), `plain` (Plain text), `html` (HTML), `xml` (XML), `buffer` (Buffer). | | `code` | `Number` | no | `200` | Status code. | | `path` | `String` | no | `response` | Path for reading value. | | `ctype` | `String` | no | | Content type. | **Inputs:** `input` (Response). **Outputs:** `output` (Log). This component can respond to an HTTP request. ### trestart.html · version 1 Type: `component` Restarts the current FlowStream. **Inputs:** `input` (Restart). **Outputs:** none. This component is in the repository, but not in the catalogue that the **Download components** window shows. This component restarts the current FlowStream. ### troute.html · version 3 Type: `component` Registers an HTTP route and sends the request data to its output. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | `/` | Relative URL address. | | `method` | `String` | no | `GET` | Method. One of: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `API`. | | `timeout` | `Number` | no | `5000` | Timeout. | | `limit` | `Number` | no | `5120` | Request limit (kB). | | `upload` | `Boolean` | no | `false` | Allow uploading files (form data). | | `user` | `Number` | no | `0` | Who can call the route. One of: `1` (Authorized), `2` (Unauthorized), `0` (Both). | | `send` | `String` | no | `all` | Send to output. One of: `all` (Everything), `payload` (Payload), `query` (Query arguments), `files` (Files), `params` (Dynamic params), `headers` (Headers), `cookies` (Cookies), `user` (User). | | `reader` | `String` | no | `-` | Read files to. One of: `-` (Keep as files), `buffer` (Buffer), `utf8` (UTF-8), `ascii` (ASCII), `datauri` (Data URI), `base64` (Base64), `hex` (Hex). | | `autoreply` | `String` | no | | Auto-reply. One of: `success` (Success), `empty` (Empty response). | | `action` | `String` | no | | API Action. | **Inputs:** none. **Outputs:** `output` (Request). This component registers an HTTP Route and sends request data next. It stores `controller` instance in the `message.refs.controller` property. You must respond to the REST response component. __Output data__: ```js { ip: String, // optional, IP address url: String, // optional language: String, // optional ua: String, // optional, parsed user-agent user: Object, // optional headers: { key: String }, // optional, request headers cookies: { key: String }, // optional, cookies payload: {}, // optional, request payload query: { key: String }, // optional params: { key: String }, // optional files: [{ type: String, filename: String, path: String, ext: String, size: Number, width: Number, height: Number, data:Buffer|String }] // optional } ``` ### tsql.html · version 1 Type: `component` Runs an SQL command on a PostgreSQL connection. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `id` | `String` | no | `default` | Connection. | | `sql` | `String` | no | `SELECT 1` | The SQL command. | | `first` | `Boolean` | no | `false` | Return only the first row. | | `path` | `String` | no | | Assign data according to the path. | **Inputs:** `input` (Payload). **Outputs:** `output` (Output), `error` (Error). The component executes SQL command on the specifi connection. This component depends on the `API PostgreSQL` component. ### tuploadedfiles.html · version 1 Type: `component` Processes the files uploaded through the Route component. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `action` | `String` | no | `read` | Action. One of: `read` (Read), `move` (Move). | | `path` | `String` | no | `/www/{name}{index}.{extension}` | Absolute path. | | `type` | `String` | no | `utf8` | Type. One of: `buffer` (Buffer), `utf8` (UTF-8), `base64` (BASE64), `hex` (Hex). | **Inputs:** `input` (Request). **Outputs:** `file` (File), `done` (Done). The component processes files from the Total.js Route component. ### twebsocketroute.html · version 1 Type: `component` Creates a WebSocket endpoint. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `endpoint` | `String` | no | `/realtime/` | Endpoint. | | `type` | `String` | no | `json` | Communication. One of: `json` (JSON), `text` (Text), `binary` (Binary). | **Inputs:** `send` (Send), `init` (Initial message). **Outputs:** `message` (Message). This component creates a WebSocket endpoint. Initial message data is stored in the memory of new clients. - `message.data {Object}` data from a WebSocket message - `message.refs.client {Object}` contains a client controller - `message.refs.controller {Object}` contains a WebSocket controller --- title: Total.js API project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/totaljs-api/ updated: 2026-11-20T06:50:57.962Z --- # Total.js API > Components that call the services of Total.js API with your token. Components that call the services of Total.js API with your token. This page holds the catalogue groups **Total.js API Services**, **Total.js API**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### tapicaptchaapi.html · version 1 Type: `component` Generates a captcha as a JPEG image with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `width` | `Number` | no | `200` | Width. | | `height` | `Number` | no | `80` | Height. | | `dark` | `Boolean` | no | `false` | Dark mode. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Captcha image generator generates a simple JPEG image. It utilizes the [Total.js Weather API](https://docs.totaljs.com/totalapi/6c221003eo51c/#Ii6INR1cR61f). __Input data:__ ```js // {String} Captcha text '123456' ``` __Output data__: ```js // Returns DataURI 'data:image/jpeg;base64,/9j/4AAQSkZ...'' ``` ### tapichatgptapi.html · version 1 Type: `component` Asks ChatGPT through Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `output` | `String` | no | `text` | Output. One of: `text` (Text), `image` (Image). | | `size` | `String` | no | `small` | Size. One of: `small` (Small), `medium` (Medium), `large` (Large). | | `response` | `String` | no | `buffer` | Response type. One of: `buffer` (Buffer), `base64` (Base64), `datauri` (DataURI). | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). By using this component you can asks ChatGPT / OpenAPI. It utilizes the [Total.js ChatGPT API](https://docs.totaljs.com/totalapi/6c221003eo51c/#128fm001kc51d). __Input data:__ ```js // {String} a question for ChatGPT 'What is Total.js Platform' ``` __Output data__: If `output` is set as Text: ```js { text: 'Total.js Platform is a web development platform that provides a comprehensive set of tools and modules for building modern, scalable, and high-performance web applications. It is based on the Node.js runtime and offers a seamless development experience with a powerful, intuitive, and easy-to-use framework. Total.js Platform includes features such as database integration, real-time communication, server-side rendering, RESTful API support, and more. It also supports various front-end technologies and integrates seamlessly with popular third-party libraries and services, making it a great choice for building full-stack web applications.' } ``` If `output` is set as Image: Returns data according to the component configuration Response type. It can be `Buffer`, `Base64` or `DataURI`. ### tapicheckapi.html · version 1 Type: `component` Returns the current status of your Total.js API token. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Returns a current status for your token. It utilizes the [Total.js Check API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6d397001td51c). __Output data__: ```js { credits: 34.49 } ``` ### tapicheckvatapi.html · version 1 Type: `component` Checks whether a company in the European Union is a VAT payer, with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Determines whether is a company VAT payer or no. Works only in European Union. It utilizes the [Total.js Check VAT API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6d385001lt51c). __Input data:__ ```js // {String} VAT ID 'SK2120417167' ``` __Output data__: ```js { is: true, // Is VAT Payer? vat: 20, // Country VAT name: 'Total Avengers s. r. o.', address: 'Viestova 6784/28\n97401 Banská Bystrica\nSlovensko' } ``` ### tapiexchangeratesapi.html · version 1 Type: `component` Reads exchange rates with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `currency` | `String` | no | `EUR` | Currency. | | `path` | `String` | no | | Path for reading input data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Reads exchange rates. It utilizes the [Total.js Exchangerates API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6e2f4001dt51c). __Input data__: ```js // {String} Date, optional input default is current date "2020-12-12" ``` __Output data__: ```js { USD: 1.2109, JPY: 126.05, BGN: 1.9558, CZK: 26.239, DKK: 7.4429, GBP: 0.9, HUF: 356.64, PLN: 4.4246, RON: 4.8685, SEK: 10.2745, CHF: 1.0764, ISK: 153.5, NOK: 10.5763, HRK: 7.549, RUB: 89.167, TRY: 9.4762, AUD: 1.6185, BRL: 6.1993, CAD: 1.5472, CNY: 7.9167, HKD: 9.3866, IDR: 17078, ILS: 3.9406, INR: 89.212, KRW: 1314.27, MXN: 23.9187, MYR: 4.9196, NZD: 1.7103, PHP: 58.298, SGD: 1.6174, THB: 36.388, ZAR: 18.0756 } ``` ### tapiconvertapi.html · version 1 Type: `component` Converts a file to another file type with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `to` | `String` | no | `pdf` | Convert to. One of: `pdf` (PDF), `jpg` (JPG), `png` (PNG). | | `output` | `String` | no | `buffer` | Response type. One of: `buffer` (Buffer), `base64` (Base64), `datauri` (DataURI). | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). It converts file to another type of file. It utilizes the [Total.js Convert API](https://docs.totaljs.com/totalapi/6c221003eo51c/#13ff8001db51d). __Input data:__ ```js // {String} dataURI of a file "data:application/pdf;base64,JVBERi0xLjcN..." ``` __Output data__: Returns data according to the component configuration `Response type`. It can be `Buffer`, `Base64` or `DataURI`. ### tapigeoipapi.html · version 1 Type: `component` Reads the location of an IP address with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Reads GEO information from IP address. It utilizes the [Total.js GEO IP API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6d381001hc51c). __Input data:__ ```js // {String} IP address "78.98.116.204" ``` __Output data__: ```js { ip: '78.98.95.176', isp: 'Slovak Telekom, a.s.', country: 'Slovakia', country_code: 'SK', region: 'Banska Bystrica', region_code: 'BC', city: 'Banská Bystrica', zip: '974 01', continent: 'Europe', continent_code: 'EU', lat: 48.804, lng: 19.1363, timezone: 'Europe/Bratislava' } ``` ### tapiinvoiceparserapi.html · version 1 Type: `component` Reads the data of an invoice from a PDF, JPG or PNG file with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). It parses meta data of the invoice from the PDF/JPG/PNG file type. It utilizes the [Total.js Invoiceparser API](https://docs.totaljs.com/totalapi/6c221003eo51c/#130w3001db51d). __Input data:__ ```js // {String} dataURI of a file "data": "data:application/pdf;base64,JVBERi0xLjcN..." ``` __Output data__: ```js { supplier: { address: 'Nádražní 44/86 15000 Praha 5', name: 'DRONPRO', vatid: 'CZ04587332' }, customer: { name: 'TOTAL AVENGERS S.R.O.', address: 'Viestova 6784/28 97401 Banská Bystrica, Slovakia', vatid: 'SK2120417167' }, date: '2023-07-17', number: '23ES04414', amount: 3445.46, total: 3445.46, currency: 'CZK', language: null, tax: 0 } ``` ### tlogger.html · version 2 Type: `component` Logs incoming messages into the Total.js Cloud Logger. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | Total API token. | | `type` | `String` | no | `info` | Type. One of: `info` (Info), `error` (Error), `warning` (Warning), `success` (Success). | | `message` | `String` | no | | Message. | | `reference` | `String` | no | | Reference. | | `url` | `String` | no | | URL address. | | `app` | `String` | no | | App name. | **Inputs:** `input` (Input). **Outputs:** none. The component logs incoming messages into the Total.js Cloud Logger. ### tapiocrapi.html · version 1 Type: `component` Reads the text of JPG, PNG or PDF files with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `language` | `String` | no | `eng` | Language. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). OCR reader for `JPG`, `PNG` or `PDF` files. It utilizes the [Total.js OCR API](https://docs.totaljs.com/totalapi/6c221003eo51c/#If83x81cy61f). __Input data:__ ```js // {String} dataURI of a file "data:image/png;base64,iVBORw0KGgo....." ``` __Output data:__ ```js { text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...' } ``` ### tapiplatenumber.html · version 1 Type: `component` Reads a vehicle plate number from a JPG or PNG picture with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `code` | `String` | no | `eu` | Country code. One of: `eu` (EU), `us` (US). | | `first` | `Boolean` | no | `false` | Return only the first value. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). It parses a plate number from the JPG/PNG picture. It utilizes the [Total.js Platenumber API](https://docs.totaljs.com/totalapi/6c221003eo51c/#13ffb001db51d). __Input data:__ ```js // {String} dataURI of an image 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEB....' ``` __Output data:__ ```js [ { "value": "H786P0J", "confidence": 89.8356 }, { "value": "H786POJ", "confidence": 87.6114 }, { "value": "HN786P0J", "confidence": 85.2152 } ] ``` ### tapiprintapi.html · version 1 Type: `component` Prints HTML or a URL address to a PDF, JPG, PNG or DOCX file with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | | `type` | `String` | no | `pdf` | Type. One of: `pdf` (PDF), `jpg` (JPG), `png` (PNG), `docx` (DOCX). | | `page` | `String` | no | `A4` | Page. | | `width` | `Number` | no | `0` | Width. | | `height` | `Number` | no | `0` | Height. | | `dpi` | `Number` | no | `96` | DPI. | | `top` | `Number` | no | `0` | Top. | | `right` | `Number` | no | `0` | Right. | | `bottom` | `Number` | no | `0` | Bottom. | | `left` | `Number` | no | `0` | Left. | | `viewport` | `String` | no | | Viewport. One of: `xs` (XS), `sm` (SM), `md` (MD), `lg` (LG). | | `quality` | `Number` | no | `80` | Quality. | | `orientation` | `String` | no | `portrait` | Orientation. One of: `portrait` (Portrait), `landscape` (Landscape). | | `grayscale` | `Boolean` | no | `false` | Grayscale. | | `lowquality` | `Boolean` | no | `false` | Lowquality. | | `zoom` | `Number` | no | `100` | Zoom. | | `output` | `String` | no | `buffer` | Response type. One of: `buffer` (Buffer), `base64` (Base64), `datauri` (DataURI). | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). Prints HTML or URL address to PDF, JPG, PNG or DOCX file. It utilizes the [Total.js Print API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6c225001ga51c). __Input data:__ ```js // {String} HTML content or URL address '

HTML content

' ``` __Output data:__ Returns data according to the component configuration `Response type`. It can be `Buffer`, `Base64` or `DataURI`. ### sms.html · version 1 Type: `component` Sends a text message. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | Total API token. | | `to` | `String` | no | | To. | | `from` | `String` | no | | From. | | `body` | `String` | no | | Message. | | `isdata` | `Boolean` | no | `false` | Send incoming message data only. | | `path` | `String` | no | | Path for reading message. | **Inputs:** `input` (Input). **Outputs:** none. The component sends a SMS message. ### tapismsapi.html · version 1 Type: `component` Sends a text message with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `from` | `String` | no | | From. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). By using this component, you can send SMS. It utilizes the [Total.js SMS API](https://docs.totaljs.com/totalapi/6c221003eo51c/#6d220001ni51c). __Input data:__ ```js { to: "+421903163302", body: "Your message ..." } ``` __Output data__: ```js { success: true } ``` ### tapiweatherapi.html · version 1 Type: `component` Reads the current weather for an address with Total.js API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | API token. | | `path` | `String` | no | | Path for reading input data. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). By using this component, you can obtain the current weather by an address. It utilizes the [Total.js Weather API](https://docs.totaljs.com/totalapi/6c221003eo51c/#128f7001kc51d). __Input data:__ ```js // {String} address without diacritics 'Banska Bystrica, Slovakia' ``` __Output data__: ```js { name: 'Bratislava', temperature: 22, wind: 20.2, humidity: 65, pressure: 1018, cloud: 25, uv: 6, sky: 'Partly cloudy' } ``` --- title: AI and online services project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/ai-and-online-services/ updated: 2026-11-20T06:50:57.962Z --- # AI and online services > Components that talk to language models and other online services. Components that talk to language models and other online services. This page holds the catalogue groups **AI**, **Ollama**, **Services**, **External**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### chatgpt.html · version 3 Type: `component` Sends the incoming text to ChatGPT and returns the answer. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `model` | `String` | no | `gpt-3.5-turbo-instruct` | Model. One of: `gpt-4` (GPT 4), `gpt-3.5-turbo` (GPT 3.5 Turbo), `gpt-3.5-turbo-instruct` (GPT 3.5 Turbo instruct), `Whisper` (whisper-1). | | `apikey` | `String` | no | | API key. | | `question` | `String` | no | | Question. | **Inputs:** `input` (Question). **Outputs:** `output` (Answer), `error` (Error). This component can talk to ChatGPT. **Input** Input will depend on selected model - __CPT 3.5 Turbo__ and __CPT 4__ ```js // Object { messages : [{ role: 'user', content: 'Text' }] } // or // Array [{ role: 'assistant', content: 'Text' }] ``` - __Whisper__ ```js // Object { path : 'path-to-file' } // or // String 'path-to-file' ``` - __CPT 3.5 Turbo instruct__ ```js // Object { text : 'your question' } // or // String 'your question' ``` **Output** Output also depends on selected model - __CPT 3.5 Turbo__ and __CPT 4__ ```js 'Response from assistant' ``` - __Whisper__ ```js // Object { text : 'transcipted text' } ``` - __CPT 3.5 Turbo instruct__ ```js // String 'Response from assistant' ``` ### aicontext.html · version 1 Type: `component` Loads Markdown contexts for a language model. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `path` | `String` | no | `content` | Content property. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). This component can load multiple Markdown contexts for the LLM. It replaces text phrases defined in the header, such as `[filename_defined_in_the_header]` with the content defined in the context. __Context example__: ```md ---------------------------------------------------------------- Name: document1.md ---------------------------------------------------------------- MARKDOWN 1 ---------------------------------------------------------------- Name: document2.md ---------------------------------------------------------------- MARKDOWN 2 ``` **Usage** ``` [document1.md] ``` __Output__: ``` MARKDOWN 1 ``` ### googlesearch.html · version 1 Type: `component` Searches Google for a keyword. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `lang` | `String` | no | `en` | Language. | | `limit` | `Number` | no | `5` | Results limit. | **Inputs:** `input` (Input). **Outputs:** `output` (Output). Flow installs the npm package `google-it` when you add the component. This component can google any keyword you want. __Configuration__ - `Language (optional)` : Search language; - `Limit (optional)` : Limit number of results. __Input__ - `Object` | String : input expects `data: String` or `data.text: String` as search keywords. __Output__ - `Array` of found results: ### ollamals.html · version 1 Type: `component` Lists the models of an Ollama server. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | `http://localhost:11434` | OLLAMA endpoint. | **Inputs:** none. **Outputs:** none. A FlowStream can hold only one node of this component. This component list all OLLAMA models. ### ollamaprompt.html · version 1 Type: `component` Sends a prompt to an Ollama model. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `think` | `Boolean` | no | `false` | Thinking. | | `url` | `String` | no | | OLLAMA endpoint. | | `model` | `String` | no | | Model. | | `parse` | `Boolean` | no | `false` | Parse response as JSON object. | | `system` | `String` | no | | System prompt. | | `temperature` | `Number` | no | `-1` | Temperature. | **Inputs:** `input` (Prompt). **Outputs:** `output` (Response), `error` (Error). This component makes a prompt into the OLLAMA engine. ```js { model: 'qwen3.5:9b', // optional think: true, // optional content: 'User message', images: ['base64'] // optional } ``` The component saves the __response__ to the `response` property and the __error__ to the `error` property. The output is text. ### ollamawebsearch.html · version 1 Type: `component` Searches the web with the Ollama Web Search API. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `token` | `String` | no | | Ollama API Token. | | `path` | `String` | no | `response` | Path to response. | | `prop` | `String` | no | `search` | Read search query. | | `merge` | `Boolean` | no | `false` | Merge content together. | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). This component uses the Ollama Web Search API to perform web searches. A valid Ollama API token is required for authentication and access to the service. __Payload__: ```js { search: 'Total.js Platform' } ``` __Response__: ```json [ { "title": "...", "url": "https://www.totaljs.com", "content": "..." } ] ``` ### opensync.html · version 2 Type: `component` Receives data from the OpenSync app. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `url` | `String` | no | | URL address + token. | **Inputs:** none. **Outputs:** `output` (Output). This component receives a data from the [OpenSync](https://docs.totaljs.com/opensync/) app. Data example: ```js { id: String, // Internal ID type: String, // Parsed content-type (can be empty with the "GET" method) channel: String, // Channel ip: String, // Host IP address method: String, // HTTP method (upper-case) headers: Object, // Key:value query: Object, // Key:value body: Object, // JSON/key:value/String ua: String, // Parsed user-agent files: [Object Array] // Uploaded files { filename: String, extension: String, type: String, size: Number, url: String, width: Number, height: Number } } ``` ### openweather.html · version 1 Type: `component` Reads weather data from OpenWeatherMap. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `type` | `String` | no | `current` | Request Type. One of: `current` (Current Weather), `forecast` (Forecast). | | `apikey` | `String` | no | | Api key. | | `mode` | `String` | no | `json` | Output Type. One of: `json` (JSON), `xml` (XML), `html` (HTML). | | `time` | `String` | no | `hourly` | Time. One of: `hourly` (Hourly (4 days data)), `daily` (Daily (16 days data)), `climate` (Climate Forecast (30 Days)). | **Inputs:** `input` (Input). **Outputs:** `output` (Output), `error` (Error). This component can retieve weather data from [OpenWheatherMap](https://openweathermap.org/api/); __Input__: ```js { query: String, // Optional, City name, Country code, State code e.g: London, Ouagadougou, sk lon: String, // Optional, Longitude lat: String, // Optional, Latitude lang: String, // Optional, Output language e.g: `en`, `de`, `sk`, `fr` etc... units: String, // Optional, standard, metric, imperial date: String // Optional, Timestamp (Unix time, UTC time zone), e.g. date=1586468027 } ``` --- title: Security and authentication project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/security/ updated: 2026-11-20T06:50:57.962Z --- # Security and authentication > Components for confirmation codes, one-time passwords, request limits and OAuth 2.0. Components for confirmation codes, one-time passwords, request limits and OAuth 2.0. This page holds the catalogue groups **Security**, **API**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### confirmation-code.html · version 1 Type: `component` Generates confirmation codes and verifies them. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `count` | `Number` | no | `3` | Count of attempts. | | `type` | `String` | no | `pin` | Type. | | `length` | `Number` | no | `4` | Length. | | `expire` | `String` | no | `5 minutes` | Expiration. | | `lock` | `String` | no | | Lock. | | `limit` | `Number` | no | `1` | Max. calls per lock. | **Inputs:** `create` (Create), `verify` (Verify). **Outputs:** `output` (Output). This component can help you with generating confirmation codes. Keep data structure for inputs according to the documentation below. **`create` input/output** __Create input__: - `id {String}` identifier (email, phone number, identifier, etc.) - `param {String}` a custom parameter __Create output__: - `success {Boolean}` determines if the code is verified or not accroding to its identifier - `value {String}` a pin/code/token - `param {String}` a custom parameter (it sends only if the value is true) - `error {String}` (optional) a simple error identifier, it can contain: - `locked` the identifier is locked by the previous call **`verify` input/output** __Verify input__: - `id {String}` identifier (email, phone number, identifier, etc.) - `value {String}` a pin/code/token __Verify output__: - `success {Boolean}` determines if the code is verified or not accroding to its identifier - `slots {Number}` free slots/attempts - `error {String}` (optional) a simple error identifier, it can contain: - `invalid` the code is invalid - `404` identifier not found --- **Settings** - __Lock__ prevents overwriting of the code according to the identifier ### iplimiter.html · version 1 Type: `component` Limits the number of requests per IP address. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `count` | `Number` | no | `1` | Max. limit. | | `timeout` | `Number` | no | `5` | Timeout in seconds. | | `path` | `String` | no | `ip` | Path to the IP address. | **Inputs:** `input` (Request). **Outputs:** `output` (Allowed), `error` (Blocked). This component limits the number of requests per IP address. The component first tries to obtain the IP address from the `$.controller`. If that doesn't work, it tries to load the IP address from the payload. ### oauth2.html · version 1 Type: `component` Obtains an OAuth 2.0 access token from another service. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `urltoken` | `String` | no | | Token URL. | | `urlauthorize` | `String` | no | | Authorize URL. | | `variable` | `String` | no | | Assign token to the global variable. | | `clientid` | `String` | no | | Client ID. | | `clientsecret` | `String` | no | | Client secret. | | `scope` | `String` | no | | Scope. | | `accesstoken` | `String` | no | | Access token. | **Inputs:** none. **Outputs:** none. This component can obtain OAuth 2.0 access token from 3rd party service. ### totp.html · version 1 Type: `component` Generates TOTP secrets and verifies one-time passwords for two-factor authorization. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `issuer` | `String` | no | `Total.js` | Issuer. | | `time` | `Number` | no | `30` | Time. | **Inputs:** `generate` (Generate), `verify` (Verify). **Outputs:** `output` (Output). **Time-Based One-Time Password Algorithm** This component can generate a secret and verifies the code (generated via Authenticator app) as a one-time password for 2FA authorization. - recommended mobile apps: __Google Authenticator__ or __Microsoft Authenticator__ --- __How does it work?__ First, a user must generate a secret via`generate` input in the authenticator app. Then, for verification of the one-time generated password, you need to use the second input `verify,` which needs user secrets. **`generate` input/output** __Input data__: - `user {String}` email or user/account name without special characters __Output data `object` with__: - `secret {String}` a generated secret which you must store for the specific user - `url {String}` an optimized url address for tokenization - `qrcode {String}` a link to the picture with QR code **`verify` input/outputs** __Input data `object` with__: - `secret {String}` __Output data `object` with__: - `success {Boolean}` determines if the password is valid or not --- title: MQTT project: Flow version: 11.1 section: components language: en license: MIT url: https://totaljs.es/docs/flow/11-1/components/mqtt/ updated: 2026-11-20T06:50:57.962Z --- # MQTT > Components that connect to an MQTT broker, publish and subscribe. Components that connect to an MQTT broker, publish and subscribe. This page holds the catalogue group **MQTT**. Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see [Download components](/flow/11-1/guides/download-components/). ## API ### mqtt-broker.html · version 4 Type: `component` Connects to an MQTT broker and sends the messages it receives. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `host` | `String` | no | `localhost` | Hostname or IP address. | | `port` | `Number` | no | `1883` | Port. | | `secure` | `Boolean` | no | `false` | Secure (SSL). | | `clientid` | `String` | no | | Client ID. | | `auth` | `String` | no | | Require Authorization. | | `username` | `String` | no | | Username. | | `password` | `String` | no | | Password. | | `lwt` | `String` | no | | Last will topic (LWT). | | `lwttopic` | `String` | no | | Last will topic. | | `lwtmessage` | `String` | no | | Last will message. | **Inputs:** none. **Outputs:** `output` (Messages). Flow installs the npm package `mqtt` when you add the component. ### mqtt-publish.html · version 3 Type: `component` Publishes messages to an MQTT topic. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `broker` | `String` | no | | Broker. | **Inputs:** `message` (Message). **Outputs:** none. MQTT Publish Input: ```javascript { topic: 'some/topic', message: { some: 'data' }, // optional options: { qos: 0|1|2, retain: true|false } } ``` ### mqtt-subscribe.html · version 3 Type: `component` Subscribes to an MQTT topic. | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `broker` | `String` | no | | Broker. | | `topic` | `String` | no | | Topic. | **Inputs:** none. **Outputs:** `message` (Message). MQTT Subscribe --- title: Develop components project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/introduction/ updated: 2026-11-19T10:58:48.323Z --- # Develop components > What a Flow component is, what you need to write one and what to read next. A component is a building block of a FlowStream, such as **Trigger**, **Code** or **Print**. When the official catalogue has no component for your task, you can write your own. A component is one HTML file with a little JavaScript, and you can create it in the designer of Flow without other tools. This section covers release 11.1 of Total.js Flow. To use Flow itself, see the [Flow guides](/flow/11-1/guides/introduction/). The official components are listed in [Official components](../../components/introduction/). ## How a component works | Word | What it means | |---|---| | **Component** | The file: its code, its settings form, the look of its node and its readme. | | **Instance** | One node of the component on the canvas. Flow runs your code once for each node, with the configuration of that node. | | **Message** | The data that travels from an output of one node to an input of another. Your code receives it and sends it on, or ends it. | | **Configuration** | The settings of one node, which the user edits in the settings form. | The code of a component runs on the server, in the process of its FlowStream. Each FlowStream runs in its own process, so a component in one FlowStream does not share memory with another FlowStream. ## What you need - A running Flow and a FlowStream to try your component in. - Basic JavaScript. The server code uses Node.js and the Total.js 5 framework, so its helpers such as `U` and `F` are available. - A text editor if you want to keep your component in a file. The designer has its own editor too. ## What to read next 1. [The component file](../component-file/): the parts of the file. 2. [Your first component](../first-component/): create it, use it and change it. 3. [Inputs, outputs and messages](../inputs-outputs/), then the other topics in the menu. 4. The reference: [Component file](../component-api/), [Instance](../instance-api/) and [Message](../message-api/). --- title: The component file project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/component-file/ updated: 2026-11-19T10:58:43.323Z --- # The component file > The parts of a component file: server code, readme, settings form, styles, the look of the node and the browser script. A component is one HTML file. Flow reads the parts of the file by their tags. Only ` Markdown that describes the component. ``` ## The parts | Tag | What it holds | |---|---| | ` Converts the incoming data to uppercase text.
$NAME
``` 5. Select **APPLY**. **Uppercase** appears in the list of components on the left, in the **Demo** group. ## Use it 1. Download **Trigger** and **Print** if the FlowStream does not have them. See [Download components](/flow/11-1/guides/download-components/). 2. Drag **Trigger**, **Uppercase** and **Print** onto the canvas and connect them in this order. See [Add and connect nodes](/flow/11-1/guides/connect-nodes/). 3. Configure the **Trigger** node: clear **Random data** and type `hello flow` in **Data**. 4. Select **APPLY** in the toolbar to start the design. 5. Select **Run** on the **Trigger** node. **Print** shows `HELLO FLOW`. ![Trigger, Uppercase and Print connected, with HELLO FLOW in the Print node](/files/JapyVv5NE60f.webp) ## What the code does - `exports.id`, `exports.name`, `exports.icon` and the other properties describe the component. - `exports.inputs` and `exports.outputs` create the connection points of the node. - Flow calls `exports.make` once for each node. It receives the `instance` of the node and its `config`. - Flow calls `instance.message` for every message that arrives. `$` is the message, `$.data` its data. - `$.send('output', ...)` sends new data to the output with the id `output`. ## Change the component 1. Right-click the **Uppercase** node and select **Edit source code**. 2. Change the code and select **APPLY**. Flow replaces the component in this FlowStream and restarts its nodes with the new code. ## Install it from a file Save the code as `uppercase.html` on a web server. In another FlowStream, select **Add**, then **Link component**, and enter the address of the file. See [Install a component from a URL](/flow/11-1/guides/link-component/). To offer many components to your team, publish them in [your own catalogue](../own-catalogue/). --- title: Inputs, outputs and messages project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/inputs-outputs/ updated: 2026-11-19T10:58:45.178Z --- # Inputs, outputs and messages > Declare inputs and outputs, receive messages, send them on and end them. Inputs and outputs are the connection points of a node. Data travels between nodes as messages: your component receives a message on an input, and sends it on through an output or ends it. ## Declare inputs and outputs Each input and output has an `id`, which you use in code, and a `name`, which the node shows: ```js exports.inputs = [{ id: 'input', name: 'Text' }]; exports.outputs = [{ id: 'output', name: 'Object' }, { id: 'error', name: 'Error' }]; ``` A component without inputs, such as a trigger, starts messages itself. A component without outputs, such as **Print**, ends every message it receives. ## Receive messages Flow calls `instance.message` for every message that arrives on any input. `$.input` tells you which input it came through: ```js instance.message = function($) { // $.data is the data, $.input is the id of the input $.send('output', $.data); }; ``` You can also define a handler for one input. Its name is `message_` followed by the id of the input: ```js exports.inputs = [{ id: 'input', name: 'Input' }, { id: 'second', name: 'Second' }]; exports.make = function(instance, config) { instance.message_second = function($) { // only messages from the "second" input $.destroy(); }; }; ``` When a component defines both, Flow calls `message_second` first and then `message` for the same message, so let `message` skip that input: ```js instance.message = function($) { if ($.input === 'second') return; $.send('output', $.data); }; ``` ## Send a message on `$.send(output, data)` sends the message to every node connected to that output. Without `data`, the message keeps its data: ```js $.send('output'); // the same data $.send('output', { name: 'Jane' }); // new data $.send(null, 'to every output'); // every output that has a connection ``` Flow copies object data for each connection, so a node can change its copy without changing the data of the others. To turn this off for a FlowStream, see **Enable cloning of message data** in [FlowStream fields](/flow/11-1/reference/flowstream-fields/). ## End a message A message that you do not send on must end, or the designer counts it under **Pending** forever. Call `$.destroy()` (or `$.end()`): ```js instance.message = function($) { console.log($.data); $.destroy(); }; ``` ## Keep data along the way `$.repo` is an object that travels with the message from node to node. A node can store a value in it, and the nodes after it can read it: ```js // first node $.repo.orderid = 1001; $.send('output'); // a node later in the flow var orderid = $.repo.orderid; ``` ## Start a new message A node without inputs, such as a trigger or a timer, starts its own messages with `instance.send`: ```js instance.send('output', { ts: new Date() }); ``` See [Triggers, timers and closing](../triggers-and-timers/). ## Change the outputs from the configuration A component can build its outputs from its settings. Set `instance.outputs` and save the node, and the designer redraws it. The **Code** component creates its outputs this way: ```js instance.configure = function() { instance.outputs = []; for (let i = 1; i <= config.outputs; i++) instance.outputs.push({ id: 'output' + (i === 1 ? '' : i), name: 'Output #' + i }); instance.save(); }; ``` The full list of message properties and methods is in [Message reference](../message-api/). --- title: Configuration and the settings form project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/configuration/ updated: 2026-11-19T10:58:44.389Z --- # Configuration and the settings form > Give a component default settings, a settings form, and react when the user changes them. Every node has its own configuration. You set the default values in the component, the user changes them in the settings form, and your code reads them from `config`. This page builds **Greeting**, which greets the name it receives with a greeting from its settings. ## Default values `exports.config` holds the default configuration. Each new node starts with a copy of it: ```js exports.config = { greeting: 'Hello', uppercase: false }; ``` ## Read the configuration `exports.make` receives the configuration of the node as `config`. It is the same object for the whole life of the node, and Flow updates it when the user saves the settings: ```js exports.make = function(instance, config) { instance.message = function($) { var text = config.greeting + ', ' + $.data + '!'; $.send('output', config.uppercase ? text.toUpperCase() : text); }; }; ``` ## React to changes Flow calls `instance.configure` after the user changes the settings. Use it to prepare what depends on the configuration, and call it once yourself at the end of `make` for the first values: ```js var greeting; instance.configure = function() { greeting = instance.replace(config.greeting); }; instance.configure(); ``` `instance.replace` fills in variables, see [Variables in components](../variables/). ## The settings form Write the form in ``. A field whose `path` starts with `?.` edits that key of the configuration: ```html
Greeting
You can use variables, for example {welcome}.
Write in capital letters
``` The user opens the form by right-clicking the node and selecting **Configure**. See [Configure a node](/flow/11-1/guides/configure-nodes/). ![The settings window of a Greeting node](/files/JapyVl5GE61f.webp) The fields are UI components of Total.js. These options of `ui-component name="input"` appear in the official components: | `config` option | What it does | |---|---| | `required:1` | The field must have a value before the user can apply. | | `type:checkbox` | A checkbox for a `true` or `false` value. | | `type:number` | A number. Add `min:0` for a lowest value. | | `type:multiline` | A text area. Add `height:250` for its height. | | `dirsource:a\|A,b\|B` | A list to choose from: the value, a bar, and the label. | | `placeholder:text` | A hint inside the empty field. | | `monospace:1` | Shows the value in a fixed-width font. | The settings window is 800 pixels wide. For a wider form, set `exports.meta = { settingswidth: 1200 };`. ## Show the configuration on the node `$CONFIG` in `` is the configuration of the node. This shows the greeting under the name of the node: ```html
$NAME
``` ## Change the configuration from code `instance.reconfigure` changes keys of the configuration, calls `instance.configure`, shows the new values in the designer and saves them: ```js instance.reconfigure({ uppercase: true }); ``` ## The whole component ```html Greets the incoming name. The greeting can contain variables, for example `{welcome}`.
Greeting
You can use variables, for example {welcome}.
Write in capital letters
$NAME
``` With **Greeting** set to `{welcome}` and the FlowStream variable `welcome` set to `Good morning`, a **Trigger** that sends `Jane` makes **Print** show `Good morning, Jane!`. With **Write in capital letters** on, it shows `GOOD MORNING, JANE!`. ![Trigger, Greeting and Print, with Good morning, Jane! in the Print node](/files/JapyVn5HE60f.webp) --- title: Variables in components project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/variables/ updated: 2026-11-19T10:58:54.144Z --- # Variables in components > Read FlowStream variables and global variables in your component and react when they change. Users keep values such as addresses and names in variables, so they do not have to repeat them in every node. A FlowStream has its own variables, and Flow has global variables for all FlowStreams. See [Variables](/flow/11-1/guides/variables/). ## Fill in variables `instance.replace(text)` replaces every `{key}` in the text with the value of that variable: ```js var greeting = instance.replace(config.greeting); // "{welcome}" becomes "Good morning" when the variable welcome is "Good morning" ``` Flow looks for the key in this order: 1. The variables of the FlowStream. 2. The global variables. 3. The secrets of the FlowStream, which the **Secrets** component creates. 4. `{hostname}`: the address of the FlowStream. 5. The data you pass as the second argument, for example `instance.replace('{welcome}, {name}', { name: 'Jane' })`. A key that Flow cannot find stays in the text as it is, for example `{welcome}`. Inside `instance.message`, `$.replace(text)` does the same, and reads the keys that are not variables from the message, for example `{data.name}` from `$.data.name`. ## Read variables directly The variables are objects on the FlowStream: ```js var a = instance.main.variables; // variables of the FlowStream var b = instance.main.variables2; // global variables ``` ## React when variables change Flow calls these functions of every node when the user saves variables: | Function | When | |---|---| | `instance.variables(variables)` | The variables of the FlowStream have changed. | | `instance.variables2(variables)` | The global variables have changed. | Prepare your values again in them. **Greeting** does it like this: ```js instance.configure = function() { greeting = instance.replace(config.greeting); }; instance.variables = instance.variables2 = function() { instance.configure(); }; ``` After the user changes the FlowStream variable `welcome` from `Good morning` to `Good evening`, the next greeting is `Good evening, Jane!`, with no change to the node. --- title: Status and the look of the node project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/status-and-look/ updated: 2026-11-19T10:58:54.144Z --- # Status and the look of the node > Show live information on the node with a status, design its body and add a script that runs in the designer. A node can show live information on the canvas: a counter, the last value, the state of a connection. The server code sends a status, and the `` of the component shows it. This page builds **Tally**, which counts the messages it receives and turns the number red from a limit in its settings. ![A Tally node that has counted 12 messages, with a Reset button](/files/JapyXN6zE60f.webp) ## Send a status `instance.status(data)` sends any data to the designers that have the FlowStream open: ```js var status = { count: 0 }; instance.message = function($) { status.count++; instance.status(status, 500); $.destroy(); }; instance.status(status); ``` With a second argument, Flow waits that many milliseconds and then sends the last status. A node that receives many messages sends one status instead of one for each message: twelve quick messages to **Tally** arrive in the designer as one status with `count` `12`. Flow keeps the last status of each node and sends it again when someone opens the designer. ## Show the status in the body `$STATUS` in `` is the last status of the node. Bind it with `ui-bind`: ```html
$NAME
``` The `
` with the icon and the name is the title bar of the node. A ` ``` --- title: Triggers, timers and closing project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/triggers-and-timers/ updated: 2026-11-19T10:58:54.144Z --- # Triggers, timers and closing > Start messages from a button or a timer, and clean up when a node is removed or changed. Some components start messages themselves: when the user selects a button, at an interval, or when something happens on the server. This page builds **Heartbeat**, which sends the current date and time at an interval and has a **Send now** button. ## The trigger button A ` ``` ```js instance.trigger = function(msg) { instance.send('output', { ts: new Date() }); }; ``` `msg.data` holds the text of the `data-data` attribute of the button, if it has one. The designer does not run triggers while the FlowStream has changes that are not applied: select **APPLY** first. ## Start a new message `instance.send(output, data)` creates a new message and sends it to the nodes connected to that output. It returns the number of nodes that received it. Official components like this set `exports.kind = 'trigger';`. It is a label for the catalogue, which copies it. ## Run code at an interval Start the timer in `instance.configure`, so that a new interval from the settings takes effect at once: ```js var timer = null; instance.configure = function() { timer && clearInterval(timer); timer = config.interval > 0 ? setInterval(instance.trigger, config.interval * 1000) : null; }; instance.configure(); ``` For work that is done once a minute, Flow calls `instance.service(minutes)` every minute, with the number of minutes since the FlowStream started. ## Clean up with close Flow calls `instance.close` when the node stops: when the user removes it and applies the design, and when the component changes. Stop timers, close connections and release files there, or they keep running: ```js instance.close = function() { timer && clearInterval(timer); timer = null; }; ``` ## Pause When the user pauses the FlowStream, Flow stops delivering messages and calls `instance.pause(true)`; when the user resumes, it calls `instance.pause(false)`. Messages sent during the pause are dropped. A component that holds messages can wait with them while it is paused, as **Delay** does. ## The whole component ```html Sends the current date and time at a regular interval. Select **Send now** to send it at once.
Interval in seconds
Use 0 to send only when you select Send now.
$NAME
``` With **Interval in seconds** set to `1`, a **Print** node connected to **Heartbeat** shows a new date every second. After the node is removed, no more dates arrive. --- title: Errors and logging project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/errors-and-logging/ updated: 2026-11-19T10:58:44.389Z --- # Errors and logging > Report errors to the designer, send failed data to an error output, and write logs. A component reports a problem in two ways: to the person who watches the designer, and to the next nodes of the flow, so the design can handle it. This page builds **JSON parse**, which turns JSON text into an object. ## Report an error to the designer `instance.throw(error)` adds the error to the errors of the FlowStream. The designer shows the number under **Errors** in the status bar, and the FlowStream keeps the last 10 errors: ```js instance.throw('Invalid JSON: ' + e.message); ``` Inside `instance.message`, `$.throw(error)` does the same and also stores the error in `$.error`. ## Send failed data to an error output An error output lets the user decide what happens with data that failed: log it, retry, or answer the request with an error. Declare it like any output: ```js exports.outputs = [{ id: 'output', name: 'Object' }, { id: 'error', name: 'Error' }]; ``` **JSON parse** reports the error and sends the text to the **Error** output: ```js instance.message = function($) { try { $.send('output', JSON.parse($.data)); } catch (e) { instance.throw('Invalid JSON: ' + e.message); $.send('error', { error: e.message, text: $.data }); } }; ``` For the text `not json`, the **Error** output sends this, and the designer counts one error: ```json { "error": "Unexpected token 'o', \"not json\" is not valid JSON", "text": "not json" } ``` ## Errors that you do not catch When your `instance.message` throws an exception, Flow catches it and ends the message. The next nodes receive nothing. Catch errors yourself when the user needs to see them in the designer or handle them in the flow. ## Write logs `console.log` in the server code writes to the output of the Flow process, for example the terminal where you started Flow. ```js instance.close = function() { console.log('Heartbeat ' + instance.id + ' stopped'); }; ``` This line appears in the output of Flow as `Heartbeat hb stopped`, where `hb` is the id of the node. For logs that the user reads on the canvas, send a [status](../status-and-look/) instead. ## The whole component ```html Parses JSON text. Text that is not valid JSON goes to the **Error** output.
$NAME
``` --- title: Test components with the tester project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/testing/ updated: 2026-11-19T10:58:54.144Z --- # Test components with the tester > Write automatic tests for a component with the tester of the official components repository. The official components repository has a small tester. It loads one component into a FlowStream, sends data to its inputs and checks what comes out of its outputs, without Flow and without a browser. The tester runs the component with Total.js 4, from the `total4` package, as the repository sets it up. ## Set up the tester 1. Download the repository: ```bash git clone https://github.com/totaljs/flowstreamcomponents.git cd flowstreamcomponents ``` 2. Install the framework, once: ```bash npm install total4 ``` 3. Copy your component into the `components` folder, for example `components/uppercase.html`. The tester finds a component by its file name. ## Write a test Create a file in the `tests` folder, for example `tests/uppercase.js`: ```js require('../tester')(async function(describe, done) { await describe('uppercase', function(test, next) { test.input('input', 'hello flow', function(msg) { test.ok(msg.data === 'HELLO FLOW', 'Converts text to uppercase'); next(); }); }); done(); }); ``` - `describe(name, fn)` loads `components/.html` and connects every output to a catcher. - `test.input(input, data, callback)` sends `data` to the input with that id, and calls `callback` with the first message that comes out. - `test.ok(condition, text)` records a passed test when `condition` is true, and a failed one when it is false. - `next()` ends this test and lets the next `describe` start. `done()` prints the results. Always pass the id of the input as the first argument of `test.input`: when the first argument is a string, the tester reads it as the id of the input. ## Run it ```bash node tests/uppercase.js ``` The tester prints one line for each check and a summary: ```text [OK] Uppercase - Converts text to uppercase (2 ms) |--------------------------------------| | Total | 1 | | Success | 1 | | Failed | 0 | | Duration | 417 ms | |--------------------------------------| ``` To run every file in the `tests` folder, run `node tester.js`. ## Test errors and outputs This test checks both outputs of **JSON parse** from [Errors and logging](../errors-and-logging/), and the error it reports: ```js require('../tester')(async function(describe, done) { await describe('jsonparse', function(test, next) { test.input('input', '{"name":"Jane"}', function(msg) { test.ok(msg.output === 'output' && msg.data.name === 'Jane', 'Parses valid JSON'); next(); }); }); await describe('jsonparse', function(test, next) { test.onerror = function(err) { test.ok(err.indexOf('Invalid JSON') === 0, 'Reports invalid JSON'); }; test.input('input', 'not json', function(msg) { test.ok(msg.output === 'error' && msg.data.text === 'not json', 'Sends invalid JSON to the error output'); next(); }); }); done(); }); ``` ```text [OK] JSON parse - Parses valid JSON (1 ms) [OK] JSON parse - Reports invalid JSON (1 ms) [OK] JSON parse - Sends invalid JSON to the error output (1 ms) ``` `msg.output` is the id of the output that sent the message. ## More of the test object | Name | What it does | |---|---| | `test.configure(config)` | Resets the configuration to `exports.config`, applies these keys and calls `instance.configure`. With `true` as the second argument, it does not call `instance.configure`. | | `test.trigger(data)` | Calls `instance.trigger(data)`. | | `test.output = function(msg)` | Receives every message from every output. | | `test.status = function(status)` | Receives every status of the node. | | `test.onerror = function(err)` | Receives the errors of `instance.throw`. | | `test.fail(condition, text)` | Records a failed test when `condition` is true. | | `test.instance` | The instance of the node. | The tester stops after 5 seconds. For longer tests, set `this.timeout` in milliseconds at the start of the callback of `require('../tester')`. --- title: Your own catalogue project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/own-catalogue/ updated: 2026-11-19T10:58:53.655Z --- # Your own catalogue > Publish your components in a catalogue file that appears in the Download components window next to the official components. A catalogue is a JSON file that lists components and the addresses of their files. Flow shows the official catalogue in the **Download components** window, and it can show a second catalogue of your own next to it, so your team installs your components the same way as the official ones. ![The Download components window with a Demo group of three components from a custom catalogue](/files/JapyXI6uE61f.webp) ## The catalogue file The file is an array with one object for each component. It has the same structure as `db.json` in the official repository: ```json [ { "id": "greeting", "group": "Demo", "name": "Greeting", "url": "https://components.example.com/greeting.html", "author": "Jane Doe", "icon": "ti ti-comment", "color": "", "version": "1", "kind": "", "readme": "Greets the incoming name. The greeting can contain variables, for example `{welcome}`." } ] ``` | Field | What it does | |---|---| | `id` | The id of the component. | | `name` | The name in the window. Flow also uses it to find out whether the component is installed. | | `group` | The heading in the window. Components without a group are listed first, without a heading. | | `url` | The address of the component file. Flow downloads it when the user selects the component. | | `version` | The version. When it is higher than the installed version, the window shows an **update** badge. | | `author` | The author. An author that does not contain `Total.js` gets a **Community** badge. | | `icon` | The icon in the window. | | `color` | A color for the icon, for example `#7A5CFF`. Empty uses the color of the group. | | `kind` | A label, such as `trigger`, `action` or `output`. | | `readme` | The text of **Read me**, in Markdown. | Keep `name`, `version` and `icon` in the file equal to `exports.name`, `exports.version` and `exports.icon` of the component. Flow installs the component under the `exports.id` of the file. ## Publish it Put the catalogue and the component files on a web server. The browser of each user downloads them, so: - the addresses must be reachable from the browsers of your users; - on another domain than Flow, the server must allow cross-origin requests (CORS). The `public` folder of Flow is one place for them: a file at `public/catalogue/db.json` is served at `/catalogue/db.json` by Flow itself. ## Connect it to Flow 1. Stop Flow. 2. Add the address of your catalogue to the `config` file in the Flow folder: ```text components2 : https://flow.example.com/catalogue/db.json ``` 3. Start Flow again. Open the designer, select **Add**, then **Download components**. Your components appear in their groups next to the official ones. For the other keys of the file, see [Configuration file](/flow/11-1/reference/config-file/). ## Release a new version 1. Change the component file and raise `exports.version`, for example from `1` to `2`. 2. Raise `version` of the component in the catalogue to the same number. In every FlowStream that has the old version, the window shows the **update** badge on the component. Selecting it installs the new file. --- title: Share a component with the official repository project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/share/ updated: 2026-11-19T10:58:53.655Z --- # Share a component with the official repository > Prepare a component for the official catalogue and offer it to the Total.js repository. The official components live in the public GitHub repository [totaljs/flowstreamcomponents](https://github.com/totaljs/flowstreamcomponents). When your component is useful to others, you can offer it there, and after it is accepted it appears in the catalogue of every Flow. ## How the repository is organized | Path | What it holds | |---|---| | `components/` | One HTML file for each component. The name of the file is the id of the component in the catalogue. | | `db.json` | The catalogue. | | `db.js` | The script that builds `db.json` from the files in `components/`. | | `tester.js` and `tests/` | The [tester](../testing/) and the tests. | ## Prepare your component 1. Name the file after the component, in lowercase, for example `components/uppercase.html`. 2. Write each of `exports.id`, `exports.name`, `exports.group`, `exports.version`, `exports.icon`, `exports.author`, `exports.color` and `exports.kind` on one line that ends with a semicolon. `db.js` reads these lines one by one to build the catalogue entry. 3. Write a ``. `db.js` copies it into the catalogue, and users read it under **Read me** and in [Official components](../../components/introduction/). 4. Put your name in `exports.author`. Components whose author is not Total.js show a **Community** badge. 5. Add a test in `tests/`, and run it. 6. Follow the coding standards that the repository links in its README. ## Build the catalogue entry `db.js` reads every file in `components/` and writes `db.json`, sorted by name. The address of each file in the catalogue is: ```text https://cdn.totaljs.com/flowstream/webcomponents/ ``` Run it from the repository folder after `npm install total4`: ```bash node db.js ``` Check that `db.json` has an entry for your component with the right name, group, version and readme. ## Offer it Fork the repository on GitHub, add your component and its test on a branch, and open a pull request with a short description of what the component does. Total.js publishes the catalogue at the address above. ## Change a component later Raise `exports.version` with every change. Flow compares the version in the catalogue with the installed one, and shows an **update** badge in the **Download components** window when the catalogue has a newer version. --- title: Component file reference project: Flow version: 11.1 section: development language: en license: MIT url: https://totaljs.es/docs/flow/11-1/development/component-api/ updated: 2026-11-20T06:50:57.962Z --- # Component file reference > The exports properties and functions of the server code of a component. The server code in `