Skip to content

Code examples#

There are two places in Doc² where you need to use code:

  • In expressions, for example programmatically setting the value of a field based on incoming data.
  • In the function node, when you need to add JavaScript to your workflow.

This section covers:

Expressions:#

1
2
3
* [Introduction to expressions in WF²](/workflow//code-examples/expressions/).
* Built in [methods](/workflow//code-examples/expressions/methods/) and [variables](/workflow//code-examples/expressions/variables/).
* Supported libraries: [Luxon](/workflow//code-examples/expressions/luxon/) (for data and time) and [JMESPath](/workflow//code-examples/expressions/jmespath/) (for working with JSON).

JavaScript:#

1
2
3
4
* [Introduction to JavaScript in WF²](/workflow//code-examples/javascript-functions/).
* Built in [methods](/workflow//code-examples/javascript-functions/methods/) and [variables](/code-examples/javascript-functions/variables/).
* [Checking incoming data](/workflow//code-examples/javascript-functions/check-incoming-data/).
* [Get the number of items returned by the last node](/workflow//code-examples/javascript-functions/number-items-last-node/).