productivity
Webflow Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Webflow KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.webflow.*.
Use lua_read_doc("integrations.webflow") 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
Webflow workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.webflow.list_sites({}))' --json kosmo integrations:lua --eval 'print(docs.read("webflow"))' --json
kosmo integrations:lua --eval 'print(docs.read("webflow.list_sites"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local webflow = app.integrations.webflow
local result = webflow.list_sites({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.webflow, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.webflow.default.* or app.integrations.webflow.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Webflow, use the narrower 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.
Webflow — Lua API Reference
list_sites
List all Webflow sites the authenticated user has access to.
Parameters
None.
Example
local result = app.integrations.webflow.list_sites({})
for _, site in ipairs(result.sites) do
print(site.name .. " (" .. site.id .. ")")
end
get_site
Get details for a specific Webflow site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique identifier of the Webflow site |
Example
local result = app.integrations.webflow.get_site({
id = "641d84b8f0bca14670785897"
})
print(result.name)
print(result.domain)
list_collections
List CMS collections for a Webflow site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
site_id | string | yes | The unique identifier of the Webflow site |
limit | integer | no | Maximum number of collections to return (default: 100) |
offset | integer | no | Number of collections to skip for pagination (default: 0) |
Example
local result = app.integrations.webflow.list_collections({
site_id = "641d84b8f0bca14670785897"
})
for _, collection in ipairs(result.collections) do
print(collection.displayName .. " (" .. collection.slug .. ")")
end
list_items
List items in a Webflow CMS collection.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection |
limit | integer | no | Maximum number of items to return (default: 100) |
offset | integer | no | Number of items to skip for pagination (default: 0) |
Example
local result = app.integrations.webflow.list_items({
collection_id = "641d84b8f0bca14670785901",
limit = 10
})
for _, item in ipairs(result.items) do
print(item.fieldData.name)
end
Paginated example
local offset = 0
local limit = 50
local all_items = {}
repeat
local result = app.integrations.webflow.list_items({
collection_id = "641d84b8f0bca14670785901",
limit = limit,
offset = offset
})
for _, item in ipairs(result.items) do
table.insert(all_items, item)
end
offset = offset + limit
until #result.items < limit
get_item
Get a single CMS item from a collection.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection |
id | string | yes | The unique identifier of the CMS item |
Example
local result = app.integrations.webflow.get_item({
collection_id = "641d84b8f0bca14670785901",
id = "641d84b8f0bca14670785905"
})
print(result.fieldData.name)
print(result.fieldData.slug)
create_item
Create a new item in a Webflow CMS collection.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection |
fields | object | yes | Field data as key-value pairs matching the collection schema |
live | boolean | no | Whether to publish the item immediately (default: false) |
Common Fields
| Field | Description |
|---|---|
name | Item display name |
slug | URL slug (auto-generated from name if omitted) |
_draft | Whether the item is a draft |
_archived | Whether the item is archived |
Field names vary by collection. Use list_collections to inspect schema fields.
Examples
Create a draft item
local result = app.integrations.webflow.create_item({
collection_id = "641d84b8f0bca14670785901",
fields = {
name = "My New Blog Post",
slug = "my-new-blog-post",
_draft = true
}
})
print("Created item: " .. result.id)
Create and publish immediately
local result = app.integrations.webflow.create_item({
collection_id = "641d84b8f0bca14670785901",
fields = {
name = "Breaking News",
slug = "breaking-news"
},
live = true
})
print("Published item: " .. result.id)
get_current_user
Get the currently authenticated Webflow user.
Parameters
None.
Example
local result = app.integrations.webflow.get_current_user({})
print(result.user.email)
print(result.user.firstName .. " " .. result.user.lastName)
Multi-Account Usage
If you have multiple Webflow accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.webflow.list_sites({})
-- Explicit default (portable across setups)
app.integrations.webflow.default.list_sites({})
-- Named accounts
app.integrations.webflow.production.list_sites({})
app.integrations.webflow.staging.list_sites({})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Webflow — Lua API Reference
## list_sites
List all Webflow sites the authenticated user has access to.
### Parameters
None.
### Example
```lua
local result = app.integrations.webflow.list_sites({})
for _, site in ipairs(result.sites) do
print(site.name .. " (" .. site.id .. ")")
end
```
---
## get_site
Get details for a specific Webflow site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique identifier of the Webflow site |
### Example
```lua
local result = app.integrations.webflow.get_site({
id = "641d84b8f0bca14670785897"
})
print(result.name)
print(result.domain)
```
---
## list_collections
List CMS collections for a Webflow site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `site_id` | string | yes | The unique identifier of the Webflow site |
| `limit` | integer | no | Maximum number of collections to return (default: 100) |
| `offset` | integer | no | Number of collections to skip for pagination (default: 0) |
### Example
```lua
local result = app.integrations.webflow.list_collections({
site_id = "641d84b8f0bca14670785897"
})
for _, collection in ipairs(result.collections) do
print(collection.displayName .. " (" .. collection.slug .. ")")
end
```
---
## list_items
List items in a Webflow CMS collection.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `collection_id` | string | yes | The unique identifier of the CMS collection |
| `limit` | integer | no | Maximum number of items to return (default: 100) |
| `offset` | integer | no | Number of items to skip for pagination (default: 0) |
### Example
```lua
local result = app.integrations.webflow.list_items({
collection_id = "641d84b8f0bca14670785901",
limit = 10
})
for _, item in ipairs(result.items) do
print(item.fieldData.name)
end
```
### Paginated example
```lua
local offset = 0
local limit = 50
local all_items = {}
repeat
local result = app.integrations.webflow.list_items({
collection_id = "641d84b8f0bca14670785901",
limit = limit,
offset = offset
})
for _, item in ipairs(result.items) do
table.insert(all_items, item)
end
offset = offset + limit
until #result.items < limit
```
---
## get_item
Get a single CMS item from a collection.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `collection_id` | string | yes | The unique identifier of the CMS collection |
| `id` | string | yes | The unique identifier of the CMS item |
### Example
```lua
local result = app.integrations.webflow.get_item({
collection_id = "641d84b8f0bca14670785901",
id = "641d84b8f0bca14670785905"
})
print(result.fieldData.name)
print(result.fieldData.slug)
```
---
## create_item
Create a new item in a Webflow CMS collection.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `collection_id` | string | yes | The unique identifier of the CMS collection |
| `fields` | object | yes | Field data as key-value pairs matching the collection schema |
| `live` | boolean | no | Whether to publish the item immediately (default: false) |
### Common Fields
| Field | Description |
|-------|-------------|
| `name` | Item display name |
| `slug` | URL slug (auto-generated from name if omitted) |
| `_draft` | Whether the item is a draft |
| `_archived` | Whether the item is archived |
Field names vary by collection. Use `list_collections` to inspect schema fields.
### Examples
#### Create a draft item
```lua
local result = app.integrations.webflow.create_item({
collection_id = "641d84b8f0bca14670785901",
fields = {
name = "My New Blog Post",
slug = "my-new-blog-post",
_draft = true
}
})
print("Created item: " .. result.id)
```
#### Create and publish immediately
```lua
local result = app.integrations.webflow.create_item({
collection_id = "641d84b8f0bca14670785901",
fields = {
name = "Breaking News",
slug = "breaking-news"
},
live = true
})
print("Published item: " .. result.id)
```
---
## get_current_user
Get the currently authenticated Webflow user.
### Parameters
None.
### Example
```lua
local result = app.integrations.webflow.get_current_user({})
print(result.user.email)
print(result.user.firstName .. " " .. result.user.lastName)
```
---
## Multi-Account Usage
If you have multiple Webflow accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.webflow.list_sites({})
-- Explicit default (portable across setups)
app.integrations.webflow.default.list_sites({})
-- Named accounts
app.integrations.webflow.production.list_sites({})
app.integrations.webflow.staging.list_sites({})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.webflow.list_sites({})
print(result) Functions
list_sites Read
List all Webflow sites the authenticated user has access to. Returns site IDs, names, and domains needed for further CMS operations.
- Lua path
app.integrations.webflow.list_sites- Full name
webflow.webflow_list_sites
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_site Read
Get details for a specific Webflow site by its ID. Returns site name, domain, publishing status, and other metadata.
- Lua path
app.integrations.webflow.get_site- Full name
webflow.webflow_get_site
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique identifier of the Webflow site (e.g., "641d84b8f0bca14670785897"). |
list_collections Read
List CMS collections for a Webflow site. Collections are content models (e.g., "Blog Posts", "Team Members") that hold structured items.
- Lua path
app.integrations.webflow.list_collections- Full name
webflow.webflow_list_collections
| Parameter | Type | Required | Description |
|---|---|---|---|
site_id | string | yes | The unique identifier of the Webflow site. |
limit | integer | no | Maximum number of collections to return (default: 100). |
offset | integer | no | Number of collections to skip for pagination (default: 0). |
list_items Read
List items in a Webflow CMS collection. Returns paginated results with item IDs, field data, and draft/publish status.
- Lua path
app.integrations.webflow.list_items- Full name
webflow.webflow_list_items
| Parameter | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection. |
limit | integer | no | Maximum number of items to return (default: 100). |
offset | integer | no | Number of items to skip for pagination (default: 0). |
get_item Read
Get a single CMS item from a Webflow collection by its ID. Returns full field data including rich text, images, and references.
- Lua path
app.integrations.webflow.get_item- Full name
webflow.webflow_get_item
| Parameter | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection the item belongs to. |
id | string | yes | The unique identifier of the CMS item. |
create_item Write
Create a new item in a Webflow CMS collection. Pass field data as key-value pairs matching the collection's schema. Set live to true to publish immediately.
- Lua path
app.integrations.webflow.create_item- Full name
webflow.webflow_create_item
| Parameter | Type | Required | Description |
|---|---|---|---|
collection_id | string | yes | The unique identifier of the CMS collection to add the item to. |
fields | object | yes | Field data as key-value pairs matching the collection schema. Common fields: name, slug, _archived, _draft. |
live | boolean | no | Whether to publish the item immediately (default: false). Set to true to make the item live on the site. |
get_current_user Read
Get the currently authenticated Webflow user. Returns user profile including name, email, and account details.
- Lua path
app.integrations.webflow.get_current_user- Full name
webflow.webflow_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||