Triggers and time
Components that start messages on demand, on a schedule or from an endpoint, and work with dates.
On this page
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.
API
component
crontab.html · version 1
Triggers data at the times you set with a cron expression.
crontab.html · version 1| Parameter | Type | Description |
|---|---|---|
random? |
Boolean |
Random data. Default: true |
type? |
String |
Type. One of: string (String), number (Number), boolean (Boolean), now (Current date and time), date (Date), object (Object), buffer (Buffer as Base64). Default: now |
data? |
String |
Data. |
timers? |
Array |
Timers. Default: ["0 9 * * *"] |
restart? |
Boolean |
Trigger 5s after initialization. Default: false |
offset? |
String |
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 - 6and0is 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
component
date.html · version 1
Returns the current date and time, raw or formatted.
date.html · version 1| Parameter | Type | Description |
|---|---|---|
format? |
String |
Date format. |
Inputs: input (Trigger).
Outputs: output (Date/Time).
The component will return a Date/Time object (raw or formatted) according to its configuration.
component
exec.html · version 1
Sends data into the FlowStream when your code calls it.
exec.html · version 1Inputs: 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.
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);
component
minutely.html · version 1
Triggers data every minute.
minutely.html · version 1| Parameter | Type | Description |
|---|---|---|
random? |
Boolean |
Random data. Default: true |
type? |
String |
Type. One of: now (Current date), counter (Counter), string (String), number (Number), boolean (Boolean), date (Date), object (Object), buffer (Buffer as Base64). Default: now |
data? |
String |
Data. |
Inputs: none.
Outputs: output (Output).
The component triggers data into the Flow in every minute.
component
notify.html · version 1
Receives data that is sent to the notify endpoint.
notify.html · version 1| Parameter | Type | Description |
|---|---|---|
method? |
String |
HTTP Method. One of: all (All supported HTTP methods), GET, POST. Default: all |
send? |
String |
Send to output. One of: all (Everything), query (Query arguments), body (Payload), headers (Headers), cookies (Cookies). Default: all |
Inputs: none.
Outputs: output (Output).
This component captures data on the /notify/ endpoint.
Output data:
{
"method": String,
"query": Object,
"body": Object,
"headers": Object,
"cookies": Object,
"url": String,
"ip": String
}
component
timezone.html · version 1
Converts a date and time to a time zone.
timezone.html · version 1| Parameter | Type | Description |
|---|---|---|
ts? |
String |
Timezone. Default: Europe/Bratislava |
input? |
String |
Input property. Default: ts |
output? |
String |
Output property. Default: ts |
Inputs: input (Input).
Outputs: output (Output).
This component converts a date and time to a specified timezone and returns the corresponding UTC date.
component
timeout.html · version 1
Starts a timeout and restarts it when a new message arrives.
timeout.html · version 1| Parameter | Type | Description |
|---|---|---|
timeout? |
Number |
Timeout. Default: 5 |
Inputs: input (Input).
Outputs: output (Output).
The component starts a timeout and restarts it when a new message arrives.
component
timer.html · version 3
Triggers data at a regular interval.
timer.html · version 3| Parameter | Type | Description |
|---|---|---|
random? |
Boolean |
Random data. Default: true |
type? |
String |
Type. One of: string (String), number (Number), boolean (Boolean), date (Date), object (Object), buffer (Buffer as Base64). Default: string |
data? |
String |
Data. |
prop? |
String |
Write to. |
restart? |
Boolean |
Trigger 5s after initialization. Default: false |
interval? |
Number |
Interval (milliseconds). Default: 5000 |
Inputs: none.
Outputs: output (Output).
The component triggers data into the Flow in the specified interval.
component
trigger.html · version 6
Sends data into the FlowStream when you select its button.
trigger.html · version 6| Parameter | Type | Description |
|---|---|---|
random? |
Boolean |
Random data. Default: true |
type? |
String |
Type. One of: string (String), number (Number), boolean (Boolean), date (Date), object (Object), buffer (Buffer as Base64). Default: string |
data? |
String |
Data. |
restart? |
Boolean |
Trigger 5s after initialization. Default: false |
prompt? |
Boolean |
Prompt. Default: false |
prop? |
String |
Write to. |
promptlabel? |
String |
Prompt label. |
Inputs: none.
Outputs: output (Output).
The component triggers data into the Flow.