---
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` -> `<empty path>` will set `Message data / Message repo` to `null`;
- `Remove` -> `Local variables / Global variables` -> `<empty path>` 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` -> `<empty path>` 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 | `<b>{{ value }}</b>` | 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}
