How To Call It
Workflow is a global table: call its functions with a dot (Workflow.<method>(...)), not a colon. Requires Macro Handler 1.0.62 or later.
Updates a defined macro variable while preserving its type; returns true on success.
Documented for app version 1.0.64Updated:
Workflow is a global table: call its functions with a dot (Workflow.<method>(...)), not a colon. Requires Macro Handler 1.0.62 or later.
Updates a defined macro variable while preserving its type; returns true on success.
Define the variable in the Variables section of Macro Settings first. Supported types are text, integer, decimal, boolean, array, dictionary and color. Unknown names and type mismatches are errors. Each new run loads initial values. Legacy independent action plans retain their own variable definitions.
Use Workflow.get/set in the Code editor or a Code block in No-Code or Logic. Arrays and dictionaries are copies; call set after editing them. Use KV for persistent values. Android action block fields take literal values; the Lua Automation.action args table also validates computed values.
The snippet below is a starter pattern that can be applied directly in runtime flow.
-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)From foundation to combined usage, each level is provided as a separate code block so you can copy the level you need and adapt it directly.
-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)local stepOk = true
-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)
end)
if not ok then
print("API step failed: Workflow.set: " .. tostring(err))
requestStop()
end-- Workflow.set(name, value)
local function run_set_step()
-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)
end
local ok, err = pcall(run_set_step)
if not ok then
toast("Step failed")
print(err)
end-- Define integer variable "count" in Macro Settings first.
local count = Workflow.get("count")
Workflow.set("count", count + 1)