Skip to content


The Lua language is an easy to use and high performance scripting language. The Fluxweave Platform provides a Lua API and scripting interface for easy access to Org data and for integrating with other systems.


For security reasons the majority of the standard library has been disabled. Table features are still active.

Available libraries


local ls = core.QueryDispatch("given trackers [journal]")

for index, dispatch in pairs(ls) do

Introduction to working with Lua

Simple numbers

local n = 0
n = n + 1


local str = "Hello"
str = str .. ", world!"

Arrays and objects

local arr = {"apples", "oranges"}
local obj = {foo = "hey", bar = "there"}

table.insert(arr, "kiwi")

obj.other = "hello" (obj)

Flow control

local test = 5
if test == 5 then"its 5")

Arrays and objects passed as JSON arguments

Lua objects are automatically converted to objects. To force conversion to array add a _type element (it will be removed in the final data).

local arr1 = {_type="array", "apples", "oranges"}

local arr2 = {_type="array", {fruit="apples"}, {fruit="oranges"}}

local arr3 = {{fruit="apples"}, {fruit="oranges"}}
arr1 = ["apples", "oranges"]
arr2 = [{fruit: "apples"}, {fruit:"oranges"}]
arr3 = {
    0:{fruit: "apples"}, 
    1: {fruit:"oranges}

Working with Lua arrays and tables

Most functions take or return lua tables. These are map data structures that can be key value pair or simple lists where the key is an increasing integer.

To iterate a range

for n=1,20 do

To create an iterate an array

local numbers = {1, 5, 24, 44, 80}
for index, n in pairs(numbers) do

To iterate a list

for index, item in pairs(list) do 
    -- do something with the item

To get and set values

local data = {foo="hello", bar="goodbye"}["bar"])
data["another"] = "hello again"

For more information about Lua check out the documentation.