How To Call It
Api is a global table: call its functions with a dot (Api.<method>(...)), not a colon. Requires Macro Handler 1.0.51 or later.
Returns whether a named API is available in this application catalog as a boolean.
Documented for app version 1.0.50Updated:
Api is a global table: call its functions with a dot (Api.<method>(...)), not a colon. Requires Macro Handler 1.0.51 or later.
Returns whether a named API is available in this application catalog as a boolean.
API names are case-sensitive, for example Workflow.retry, Agent.run or click. Availability describes published catalog names that are not directly policy-blocked; it is not a permission, saved-asset, approved-plan, network or provider readiness check.
Check requirements at the start of a portable library and provide a clear error or supported fallback when a feature is missing. Catalog checks neither create permissions nor replace runtime error handling.
The snippet below is a starter pattern that can be applied directly in runtime flow.
if Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
endFrom 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.
if Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
endlocal stepOk = true
if Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
end
if stepOk then
wait(200)
endlocal ok, err = pcall(function()
if Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
end
end)
if not ok then
print("API step failed: Api.supports: " .. tostring(err))
requestStop()
end-- Api.supports(name)
local function run_supports_step()
if Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
end
end
local ok, err = pcall(run_supports_step)
if not ok then
toast("Step failed")
print(err)
endif Api.supports("Workflow.retry") then
print("Retry API available")
else
print("Update the application to use Workflow.retry")
end