---
title: Trigger e tempo
project: Total.js Flow
version: 11.1
section: components
language: it
license: MIT
url: https://totaljs.es/docs/it/flow/11-1/components/triggers-and-time/
updated: 2026-11-20T06:50:52.962Z
---

# Trigger e tempo

> Componenti che avviano messaggi su richiesta, a orari pianificati o da un endpoint, e lavorano con le date.

Componenti che avviano messaggi su richiesta, a orari pianificati o da un endpoint, e lavorano con le date. Questa pagina contiene i gruppi del catalogo **Triggers**, **Timers**, **Date & Time**.

Ogni voce elenca gli ingressi e le uscite del componente, le sue impostazioni principali e il testo del suo readme. Per aggiungere un componente a un FlowStream, consulta [Scaricare i componenti](/flow/11-1/guides/download-components/).

## API

### crontab.html · version 1

Type: `component`

Invia dati negli orari che imposti con un'espressione cron.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `random` | `Boolean` | no | `true` | Dati casuali. |
| `type` | `String` | no | `now` | Tipo. Uno tra: `string` (String), `number` (Number), `boolean` (Boolean), `now` (Current date and time), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). |
| `data` | `String` | no |  | Dati. |
| `timers` | `Array` | no | `["0 9 * * *"]` | Timer. |
| `restart` | `Boolean` | no | `false` | Avvia 5 s dopo l'inizializzazione. |
| `offset` | `String` | no |  | Differenza di fuso orario. |

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Il componente può far partire un trigger a un'ora e in una data specifiche.

**Stringa cron: `* * * * *`**

Il significato di ogni `*` è spiegato qui sotto, in ordine da sinistra a destra:

- minuto `0 - 59`
- ora `0 - 23`
- giorno del mese `1 - 31`
- mese `1 - 12`
- giorno della settimana `0 - 6`, dove `0` è domenica

```
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`

Restituisce la data e l'ora attuali, grezze o formattate.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `format` | `String` | no |  | Formato della data. |

**Ingressi:** `input` (Trigger).  
**Uscite:** `output` (Date/Time).

Il componente restituisce un oggetto Date/Time (grezzo o formattato) in base alla sua configurazione.

### exec.html · version 1

Type: `component`

Invia dati nel FlowStream quando il tuo codice lo chiama.

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Il componente è speciale perché deve essere eseguito direttamente dal codice sorgente tramite il metodo `flowstream.exec()`. Il componente invia i dati ricevuti nel 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`

Invia dati ogni minuto.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `random` | `Boolean` | no | `true` | Dati casuali. |
| `type` | `String` | no | `now` | Tipo. Uno tra: `now` (Current date), `counter` (Counter), `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). |
| `data` | `String` | no |  | Dati. |

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Il componente invia dati nel Flow ogni minuto.

### notify.html · version 1

Type: `component`

Riceve i dati inviati all'endpoint notify.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `method` | `String` | no | `all` | Metodo HTTP. Uno tra: `all` (All supported HTTP methods), `GET`, `POST`. |
| `send` | `String` | no | `all` | Invia all'uscita. Uno tra: `all` (Everything), `query` (Query arguments), `body` (Payload), `headers` (Headers), `cookies` (Cookies). |

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Questo componente cattura i dati sull'endpoint `/notify/`.

__Dati in uscita__:

```js
{
	"method": String,
	"query": Object,
	"body": Object,
	"headers": Object,
	"cookies": Object,
	"url": String,
	"ip": String
}
```

### timezone.html · version 1

Type: `component`

Converte una data e un'ora in un fuso orario.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `ts` | `String` | no | `Europe/Bratislava` | Fuso orario. |
| `input` | `String` | no | `ts` | Proprietà di ingresso. |
| `output` | `String` | no | `ts` | Proprietà di uscita. |

**Ingressi:** `input` (Input).  
**Uscite:** `output` (Output).

Questo componente converte una data e un'ora nel fuso orario indicato e restituisce la data UTC corrispondente.

### timeout.html · version 1

Type: `component`

Avvia un timeout e lo riavvia quando arriva un nuovo messaggio.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `timeout` | `Number` | no | `5` | Timeout. |

**Ingressi:** `input` (Input).  
**Uscite:** `output` (Output).

Il componente avvia un timeout e lo riavvia quando arriva un nuovo messaggio.

### timer.html · version 3

Type: `component`

Invia dati a intervalli regolari.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `random` | `Boolean` | no | `true` | Dati casuali. |
| `type` | `String` | no | `string` | Tipo. Uno tra: `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). |
| `data` | `String` | no |  | Dati. |
| `prop` | `String` | no |  | Scrivi in. |
| `restart` | `Boolean` | no | `false` | Avvia 5 s dopo l'inizializzazione. |
| `interval` | `Number` | no | `5000` | Intervallo (millisecondi). |

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Il componente invia dati nel Flow all'intervallo indicato.

### trigger.html · version 6

Type: `component`

Invia dati nel FlowStream quando selezioni il suo pulsante.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `random` | `Boolean` | no | `true` | Dati casuali. |
| `type` | `String` | no | `string` | Tipo. Uno tra: `string` (String), `number` (Number), `boolean` (Boolean), `date` (Date), `object` (Object), `buffer` (Buffer as Base64). |
| `data` | `String` | no |  | Dati. |
| `restart` | `Boolean` | no | `false` | Avvia 5 s dopo l'inizializzazione. |
| `prompt` | `Boolean` | no | `false` | Richiesta (prompt). |
| `prop` | `String` | no |  | Scrivi in. |
| `promptlabel` | `String` | no |  | Etichetta della richiesta. |

**Ingressi:** nessuno.  
**Uscite:** `output` (Output).

Il componente invia dati nel Flow.
