KosmoKrator

productivity

Make.com Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Make.com KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.make_com.*. Use lua_read_doc("integrations.make-com") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic Make.com workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.make_com.list_scenarios({organization_id = "example_organization_id", team_id = "example_team_id", folder_id = "example_folder_id", limit = 1, offset = 1}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("make-com"))' --json
kosmo integrations:lua --eval 'print(docs.read("make-com.list_scenarios"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local make_com = app.integrations.make_com
local result = make_com.list_scenarios({organization_id = "example_organization_id", team_id = "example_team_id", folder_id = "example_folder_id", limit = 1, offset = 1})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.make_com, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.make_com.default.* or app.integrations.make_com.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Make.com, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Make.com — Lua API Reference

Make.com is a visual automation platform that connects apps and services through scenarios. This integration lets you list and inspect scenarios, monitor executions, view connections, and manage teams — all from Lua scripts.

Authentication

Uses an API Token configured in your integration settings. Generate a token at https://www.make.com/en/user/api. The token authenticates via the Make.com REST API at https://api.make.com/v1 using Bearer authentication. The token is scoped to the user who created it — the integration can only access organizations and resources that user has permission for.


Overview

All tools are called via app.integrations.make_com.<tool_name>({ ... }). Every function takes a single Lua table of named parameters and returns a result table.

local result = app.integrations.make_com.get_scenario({ id = "12345" })

Errors surface as result.error (string). Check for it before using the response.

if result.error then
  print("Error: " .. result.error)
  return
end

Scenarios

app.integrations.make_com.list_scenarios(...)

List Make.com scenarios the authenticated user has access to. Supports filtering by organization, team, or folder.

NameTypeRequiredDescription
organization_idstringnoFilter by organization ID.
team_idstringnoFilter by team ID.
folder_idstringnoFilter by folder ID.
limitintegernoNumber of results per page. Default: 20.
offsetintegernoOffset for pagination.

Returns: scenarios (array), total (integer).

-- List all scenarios
local result = app.integrations.make_com.list_scenarios({})

-- List scenarios in a specific team
local result = app.integrations.make_com.list_scenarios({
  team_id = "team_abc",
  limit = 10,
})

app.integrations.make_com.get_scenario(...)

Get detailed information about a Make.com scenario by ID, including its blueprint, scheduling, and status.

NameTypeRequiredDescription
idstringyesScenario ID.

Returns: Full scenario object with blueprint, scheduling, and metadata.

local result = app.integrations.make_com.get_scenario({ id = "12345" })
print("Scenario: " .. result.name)
print("Status: " .. (result.isScheduling or "inactive"))

Executions

app.integrations.make_com.list_executions(...)

List Make.com scenario executions (runs) with optional filters. Useful for monitoring scenario health and debugging failed runs.

NameTypeRequiredDescription
scenario_idstringnoFilter by scenario ID.
statusstringnoFilter by status ("success", "error", "warning").
limitintegernoNumber of results per page. Default: 20.
offsetintegernoOffset for pagination.

Returns: executions (array), total (integer).

-- List recent executions for a scenario
local result = app.integrations.make_com.list_executions({
  scenario_id = "12345",
  limit = 5,
})

-- List failed executions
local result = app.integrations.make_com.list_executions({
  status = "error",
  limit = 10,
})

app.integrations.make_com.get_execution(...)

Get detailed information about a Make.com scenario execution (run) by ID, including status, duration, input/output for each module, and any errors.

NameTypeRequiredDescription
idstringyesExecution (run) ID.

Returns: Full execution object with module-level details.

local result = app.integrations.make_com.get_execution({ id = "run_67890" })

if result.status == "error" then
  print("Execution failed at step: " .. (result.failedModule or "unknown"))
end

Connections

app.integrations.make_com.list_connections(...)

List Make.com connections the authenticated user has access to. Supports filtering by team.

NameTypeRequiredDescription
team_idstringnoFilter by team ID.
limitintegernoNumber of results per page. Default: 20.
offsetintegernoOffset for pagination.

Returns: connections (array), total (integer).

local result = app.integrations.make_com.list_connections({
  team_id = "team_abc",
})

for _, conn in ipairs(result.connections) do
  print("Connection: " .. conn.name .. " (" .. conn.service .. ")")
end

Teams

app.integrations.make_com.list_teams(...)

List Make.com teams (organizations) the authenticated user has access to. Use this to discover team IDs needed for filtering scenarios and connections.

NameTypeRequiredDescription
limitintegernoNumber of results per page. Default: 20.
offsetintegernoOffset for pagination.

Returns: teams (array), total (integer).

local result = app.integrations.make_com.list_teams({})

for _, team in ipairs(result.teams) do
  print("Team: " .. team.name .. " (ID: " .. team.id .. ")")
end

User

app.integrations.make_com.get_current_user(...)

Get the currently authenticated Make.com user’s profile, including ID, name, email, and team memberships.

Takes no parameters.

Returns: User object with id, name, email, and other profile fields.

local result = app.integrations.make_com.get_current_user({})
print("Logged in as: " .. result.name .. " <" .. result.email .. ">")

Error Handling

All tools return errors consistently. Always check for result.error:

local result = app.integrations.make_com.get_scenario({ id = "invalid" })

if result.error then
  print("API Error: " .. result.error)
  -- Handle error: log, notify, retry, etc.
  return
end

-- Safe to use result
print("Scenario name: " .. result.name)

Common error scenarios:

  • Not configured: The Make.com API token is missing or invalid.
  • Not found: The requested resource (scenario, execution) does not exist.
  • Permission denied: The token does not have access to the requested organization or resource.
  • Rate limited: Too many requests; wait and retry.
Raw agent markdown
# Make.com — Lua API Reference

Make.com is a visual automation platform that connects apps and services through scenarios. This integration lets you list and inspect scenarios, monitor executions, view connections, and manage teams — all from Lua scripts.

## Authentication

Uses an **API Token** configured in your integration settings. Generate a token at [https://www.make.com/en/user/api](https://www.make.com/en/user/api). The token authenticates via the Make.com REST API at `https://api.make.com/v1` using Bearer authentication. The token is scoped to the user who created it — the integration can only access organizations and resources that user has permission for.

---

## Overview

All tools are called via `app.integrations.make_com.<tool_name>({ ... })`. Every function takes a single Lua table of named parameters and returns a result table.

```lua
local result = app.integrations.make_com.get_scenario({ id = "12345" })
```

Errors surface as `result.error` (string). Check for it before using the response.

```lua
if result.error then
  print("Error: " .. result.error)
  return
end
```

---

## Scenarios

### `app.integrations.make_com.list_scenarios(...)`

List Make.com scenarios the authenticated user has access to. Supports filtering by organization, team, or folder.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `organization_id` | string | no | Filter by organization ID. |
| `team_id` | string | no | Filter by team ID. |
| `folder_id` | string | no | Filter by folder ID. |
| `limit` | integer | no | Number of results per page. Default: 20. |
| `offset` | integer | no | Offset for pagination. |

Returns: `scenarios` (array), `total` (integer).

```lua
-- List all scenarios
local result = app.integrations.make_com.list_scenarios({})

-- List scenarios in a specific team
local result = app.integrations.make_com.list_scenarios({
  team_id = "team_abc",
  limit = 10,
})
```

---

### `app.integrations.make_com.get_scenario(...)`

Get detailed information about a Make.com scenario by ID, including its blueprint, scheduling, and status.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | Scenario ID. |

Returns: Full scenario object with blueprint, scheduling, and metadata.

```lua
local result = app.integrations.make_com.get_scenario({ id = "12345" })
print("Scenario: " .. result.name)
print("Status: " .. (result.isScheduling or "inactive"))
```

---

## Executions

### `app.integrations.make_com.list_executions(...)`

List Make.com scenario executions (runs) with optional filters. Useful for monitoring scenario health and debugging failed runs.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `scenario_id` | string | no | Filter by scenario ID. |
| `status` | string | no | Filter by status (`"success"`, `"error"`, `"warning"`). |
| `limit` | integer | no | Number of results per page. Default: 20. |
| `offset` | integer | no | Offset for pagination. |

Returns: `executions` (array), `total` (integer).

```lua
-- List recent executions for a scenario
local result = app.integrations.make_com.list_executions({
  scenario_id = "12345",
  limit = 5,
})

-- List failed executions
local result = app.integrations.make_com.list_executions({
  status = "error",
  limit = 10,
})
```

---

### `app.integrations.make_com.get_execution(...)`

Get detailed information about a Make.com scenario execution (run) by ID, including status, duration, input/output for each module, and any errors.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | Execution (run) ID. |

Returns: Full execution object with module-level details.

```lua
local result = app.integrations.make_com.get_execution({ id = "run_67890" })

if result.status == "error" then
  print("Execution failed at step: " .. (result.failedModule or "unknown"))
end
```

---

## Connections

### `app.integrations.make_com.list_connections(...)`

List Make.com connections the authenticated user has access to. Supports filtering by team.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `team_id` | string | no | Filter by team ID. |
| `limit` | integer | no | Number of results per page. Default: 20. |
| `offset` | integer | no | Offset for pagination. |

Returns: `connections` (array), `total` (integer).

```lua
local result = app.integrations.make_com.list_connections({
  team_id = "team_abc",
})

for _, conn in ipairs(result.connections) do
  print("Connection: " .. conn.name .. " (" .. conn.service .. ")")
end
```

---

## Teams

### `app.integrations.make_com.list_teams(...)`

List Make.com teams (organizations) the authenticated user has access to. Use this to discover team IDs needed for filtering scenarios and connections.

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of results per page. Default: 20. |
| `offset` | integer | no | Offset for pagination. |

Returns: `teams` (array), `total` (integer).

```lua
local result = app.integrations.make_com.list_teams({})

for _, team in ipairs(result.teams) do
  print("Team: " .. team.name .. " (ID: " .. team.id .. ")")
end
```

---

## User

### `app.integrations.make_com.get_current_user(...)`

Get the currently authenticated Make.com user's profile, including ID, name, email, and team memberships.

Takes no parameters.

Returns: User object with `id`, `name`, `email`, and other profile fields.

```lua
local result = app.integrations.make_com.get_current_user({})
print("Logged in as: " .. result.name .. " <" .. result.email .. ">")
```

---

## Error Handling

All tools return errors consistently. Always check for `result.error`:

```lua
local result = app.integrations.make_com.get_scenario({ id = "invalid" })

if result.error then
  print("API Error: " .. result.error)
  -- Handle error: log, notify, retry, etc.
  return
end

-- Safe to use result
print("Scenario name: " .. result.name)
```

Common error scenarios:
- **Not configured**: The Make.com API token is missing or invalid.
- **Not found**: The requested resource (scenario, execution) does not exist.
- **Permission denied**: The token does not have access to the requested organization or resource.
- **Rate limited**: Too many requests; wait and retry.
Metadata-derived Lua example
local result = app.integrations.make_com.list_scenarios({organization_id = "example_organization_id", team_id = "example_team_id", folder_id = "example_folder_id", limit = 1, offset = 1})
print(result)

Functions

list_scenarios Read

List Make.com scenarios the authenticated user has access to. Supports filtering by organization, team, or folder. Use this to discover scenario IDs needed for other tools.

Lua path
app.integrations.make_com.list_scenarios
Full name
make-com.make_com_list_scenarios
ParameterTypeRequiredDescription
organization_id string no Filter by organization ID.
team_id string no Filter by team ID.
folder_id string no Filter by folder ID.
limit integer no Number of results per page. Default: 20.
offset integer no Offset for pagination.
get_scenario Read

Get detailed information about a Make.com scenario by ID, including its blueprint, scheduling, and status.

Lua path
app.integrations.make_com.get_scenario
Full name
make-com.make_com_get_scenario
ParameterTypeRequiredDescription
id string yes Scenario ID.
list_executions Read

List Make.com scenario executions (runs) with optional filters. Filter by scenario ID or execution status. Useful for monitoring scenario health and debugging failed runs.

Lua path
app.integrations.make_com.list_executions
Full name
make-com.make_com_list_executions
ParameterTypeRequiredDescription
scenario_id string no Filter by scenario ID.
status string no Filter by status (e.g. "success", "error", "warning").
limit integer no Number of results per page. Default: 20.
offset integer no Offset for pagination.
get_execution Read

Get detailed information about a Make.com scenario execution (run) by ID, including status, duration, input/output for each module, and any errors.

Lua path
app.integrations.make_com.get_execution
Full name
make-com.make_com_get_execution
ParameterTypeRequiredDescription
id string yes Execution (run) ID.
list_connections Read

List Make.com connections the authenticated user has access to. Supports filtering by team. Use this to inspect connected services and their status.

Lua path
app.integrations.make_com.list_connections
Full name
make-com.make_com_list_connections
ParameterTypeRequiredDescription
team_id string no Filter by team ID.
limit integer no Number of results per page. Default: 20.
offset integer no Offset for pagination.
list_teams Read

List Make.com teams (organizations) the authenticated user has access to. Use this to discover team IDs needed for filtering scenarios and connections.

Lua path
app.integrations.make_com.list_teams
Full name
make-com.make_com_list_teams
ParameterTypeRequiredDescription
limit integer no Number of results per page. Default: 20.
offset integer no Offset for pagination.
get_current_user Read

Get the currently authenticated Make.com user's profile, including ID, name, email, and team memberships.

Lua path
app.integrations.make_com.get_current_user
Full name
make-com.make_com_get_current_user
ParameterTypeRequiredDescription
No parameters.