Task Object Overview
Tasks provide the capability to periodically execute queries against internal and/or external data sources and use the results to create new Drops or execute some additional flow.js. What this means in practice is that you can use some external data source such as a REST api as a source of streaming data to drive flowthings.io applications by running requests on it at a fixed time interval.
Tasks execute as a two-step procedure. First, the
source part of the task is executed (if specified). This is where you describes how and where queries will be executed and optionally how the returned data parsed. The query can be executed against an url or against the flow.js drop.find() API.
Task Object Members
periodicity controls how often the task will be invoked and is expressed in milliseconds. If no value is set the default value of 1 hour (3600000) will be used. Tasks can not be scheduled to run more often than once per minute. Values below 1 minute will be rejected.
displayName member is a string (max 2048 chars). It is optional and its primary purpose is to store a human-readable name for the Task.
description member is a string. It is optional and its primary purpose is to store a human-readable description or contextual data concerning the Task.
reportFlowId (Read Only)
reportFlowId member is the unique identifier for the task's reporting Flow. A Drop with information on the task's performance will be written to this Flow every time a task is executed.
reportPath (Read Only)
reportPath member is the path to the task's reporting Flow. A Drop with information on the task's performance will be written to this Flow every time a task is executed.
lastRun (Read Only)
lastRun member is the millisecond timestamp indicating the most recent execution of the Task.
nextRun (Read Only)
nextRun member is the millisecond timestamp indicating the next scheduled execution of the Task.
status (Read Only)
status member is a string indicating the state of the most recent Task execution.
runCt (Read Only)
runCt member is an integer indication the number of times the Task has been run.
source field specifies a map that describes how a task will retrieve its data. This data may then be subject to additional processing in the js step or directly written to the destination flow. For more information, see Tasks In Depth.
source, as well as any request data that may have been generated by an http request in the source, and must output drops that will then be written to their specified flows. For more information, see Tasks In Depth.