do-red
Version:
A do-node and corresponding return-node for creating loops and task-lists.
58 lines (55 loc) • 2.4 kB
HTML
<p>Allows to define a list of tasks (flows) that are processed sequentially. A task defines whether it has ended or not by sending the message to a return-node.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>Name
<span class="property-type">string</span>
</dt>
<dd> Set a custom name for your node.</dd>
</dl>
<dl class="message-properties">
<dt>Mode
<span class="property-type">string</span>
</dt>
<dd> Select what you want to loop through your tasks with. You can work through your tasks once with the whole message object (default) or do all tasks for each value of a collection. </dd>
</dl>
<dl class="message-properties">
<dt>Collection
<span class="property-type">collection</span>
</dt>
<dd> If do task for each value: Select the collection you want to iterate.</dd>
</dl>
<dl class="message-properties">
<dt>Send
<span class="property-type">string</span>
</dt>
<dd> If do task for each value: Select if you want the key / value / key-value pair from the collection.</dd>
</dl>
<dl class="message-properties">
<dt>Tasks
<span class="property-type">array</span>
</dt>
<dd> Each task will create a separate output for the node, in which you can handle the task.</dd>
</dl>
<dl class="message-properties">
<dt>Done output
<span class="property-type">boolean</span>
</dt>
<dd> Create an output which will continue the flow after doing all tasks.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Task outputs
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>Each task will have an output.</dd>
</dl>
</li>
<li>Done output (optional)
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>The output after the task list is done. Can be deactivated with the "Done output" option.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
<p>A do-node with two outputs (one task and the done-output) is a very simple way to define a loop. The task (flow) thereby needs to either return <i>continue</i> if the loop has not yet ended or <i>next</i> resp. <i>done</i> in case the loop shall end.</p>