KosmoKrator

productivity

Workable Lua API for KosmoKrator Agents

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

Lua Namespace

Agents call this integration through app.integrations.workable.*. Use lua_read_doc("integrations.workable") 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 Workable workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.workable.list_jobs({state = "example_state", limit = 1, offset = 1}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("workable"))' --json
kosmo integrations:lua --eval 'print(docs.read("workable.list_jobs"))' --json

Workflow file

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

workflow.lua
local workable = app.integrations.workable
local result = workable.list_jobs({state = "example_state", 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.workable, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.workable.default.* or app.integrations.workable.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Workable, 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.

Workable — Lua API Reference

list_jobs

List jobs from your Workable account with optional state filtering and pagination.

Parameters

NameTypeRequiredDescription
statestringnoFilter by job state: "published", "draft", "closed", or "archived". Omit to list all jobs.
limitintegernoNumber of results per page (default: 50, max: 100).
offsetintegernoOffset for pagination — pass the value from a previous response to get the next page.

Examples

-- List all published jobs
local result = app.integrations.workable.list_jobs({
  state = "published"
})

for _, job in ipairs(result.jobs) do
  print(job.title .. " (" .. job.shortcode .. ")")
end

-- Paginate through all jobs
local offset = 0
repeat
  local page = app.integrations.workable.list_jobs({
    limit = 50,
    offset = offset
  })
  for _, job in ipairs(page.jobs or {}) do
    print(job.title .. " - " .. job.state)
  end
  offset = offset + 50
until #page.jobs < 50

get_job

Get full details for a specific Workable job by its shortcode.

Parameters

NameTypeRequiredDescription
shortcodestringyesThe job shortcode identifier (e.g., "GROVF002").

Examples

local result = app.integrations.workable.get_job({
  shortcode = "GROVF002"
})

print(result.title)
print(result.department)
print(result.employment_type)
print(result.location.city .. ", " .. result.location.country)

create_job

Create a new job posting in Workable.

Parameters

NameTypeRequiredDescription
titlestringyesJob title (e.g., "Senior Backend Engineer").
descriptionstringyesFull job description in HTML or plain text.
departmentstringnoDepartment name (e.g., "Engineering").
employment_typestringnoEmployment type: "full-time", "part-time", "contract", "temporary", "intern".

Examples

local result = app.integrations.workable.create_job({
  title = "Senior Backend Engineer",
  description = "<p>We are looking for an experienced backend engineer...</p>",
  department = "Engineering",
  employment_type = "full-time"
})

print("Created job: " .. result.shortcode)

list_candidates

List candidates for a specific Workable job, with pagination support.

Parameters

NameTypeRequiredDescription
shortcodestringyesThe job shortcode to list candidates for (e.g., "GROVF002").
limitintegernoNumber of results per page (default: 50, max: 100).
offsetintegernoOffset for pagination — pass the value from a previous response to get the next page.

Examples

-- List candidates for a job
local result = app.integrations.workable.list_candidates({
  shortcode = "GROVF002"
})

for _, candidate in ipairs(result.candidates or {}) do
  print(candidate.name .. " - Stage: " .. candidate.stage)
end

-- Paginate through all candidates
local offset = 0
repeat
  local page = app.integrations.workable.list_candidates({
    shortcode = "GROVF002",
    limit = 50,
    offset = offset
  })
  for _, candidate in ipairs(page.candidates or {}) do
    print(candidate.name .. " <" .. candidate.email .. ">")
  end
  offset = offset + 50
until #(page.candidates or {}) < 50

get_candidate

Get full details for a specific Workable candidate by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe candidate ID (e.g., "abc123def456").

Examples

local result = app.integrations.workable.get_candidate({
  id = "abc123def456"
})

print(result.name)
print(result.email)
print(result.stage)
print("Applied: " .. result.applied_at)
print("Phone: " .. (result.phone or "N/A"))

list_members

List all team members in your Workable account.

Parameters

This function takes no parameters.

Examples

local result = app.integrations.workable.list_members()

for _, member in ipairs(result.members or {}) do
  print(member.name .. " - " .. member.email .. " (" .. (member.role or "member") .. ")")
end

get_current_user

Get the profile of the currently authenticated Workable user.

Parameters

This function takes no parameters.

Examples

local result = app.integrations.workable.get_current_user()

print("Logged in as: " .. result.name)
print("Email: " .. result.email)
print("Role: " .. (result.role or "unknown"))

Multi-Account Usage

If you have multiple Workable accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.workable.list_jobs({})

-- Explicit default (portable across setups)
app.integrations.workable.default.list_jobs({})

-- Named accounts
app.integrations.workable.us_office.list_jobs({})
app.integrations.workable.eu_office.list_jobs({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Workable — Lua API Reference

## list_jobs

List jobs from your Workable account with optional state filtering and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `state` | string | no | Filter by job state: `"published"`, `"draft"`, `"closed"`, or `"archived"`. Omit to list all jobs. |
| `limit` | integer | no | Number of results per page (default: 50, max: 100). |
| `offset` | integer | no | Offset for pagination — pass the value from a previous response to get the next page. |

### Examples

```lua
-- List all published jobs
local result = app.integrations.workable.list_jobs({
  state = "published"
})

for _, job in ipairs(result.jobs) do
  print(job.title .. " (" .. job.shortcode .. ")")
end

-- Paginate through all jobs
local offset = 0
repeat
  local page = app.integrations.workable.list_jobs({
    limit = 50,
    offset = offset
  })
  for _, job in ipairs(page.jobs or {}) do
    print(job.title .. " - " .. job.state)
  end
  offset = offset + 50
until #page.jobs < 50
```

---

## get_job

Get full details for a specific Workable job by its shortcode.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `shortcode` | string | yes | The job shortcode identifier (e.g., `"GROVF002"`). |

### Examples

```lua
local result = app.integrations.workable.get_job({
  shortcode = "GROVF002"
})

print(result.title)
print(result.department)
print(result.employment_type)
print(result.location.city .. ", " .. result.location.country)
```

---

## create_job

Create a new job posting in Workable.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `title` | string | yes | Job title (e.g., `"Senior Backend Engineer"`). |
| `description` | string | yes | Full job description in HTML or plain text. |
| `department` | string | no | Department name (e.g., `"Engineering"`). |
| `employment_type` | string | no | Employment type: `"full-time"`, `"part-time"`, `"contract"`, `"temporary"`, `"intern"`. |

### Examples

```lua
local result = app.integrations.workable.create_job({
  title = "Senior Backend Engineer",
  description = "<p>We are looking for an experienced backend engineer...</p>",
  department = "Engineering",
  employment_type = "full-time"
})

print("Created job: " .. result.shortcode)
```

---

## list_candidates

List candidates for a specific Workable job, with pagination support.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `shortcode` | string | yes | The job shortcode to list candidates for (e.g., `"GROVF002"`). |
| `limit` | integer | no | Number of results per page (default: 50, max: 100). |
| `offset` | integer | no | Offset for pagination — pass the value from a previous response to get the next page. |

### Examples

```lua
-- List candidates for a job
local result = app.integrations.workable.list_candidates({
  shortcode = "GROVF002"
})

for _, candidate in ipairs(result.candidates or {}) do
  print(candidate.name .. " - Stage: " .. candidate.stage)
end

-- Paginate through all candidates
local offset = 0
repeat
  local page = app.integrations.workable.list_candidates({
    shortcode = "GROVF002",
    limit = 50,
    offset = offset
  })
  for _, candidate in ipairs(page.candidates or {}) do
    print(candidate.name .. " <" .. candidate.email .. ">")
  end
  offset = offset + 50
until #(page.candidates or {}) < 50
```

---

## get_candidate

Get full details for a specific Workable candidate by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The candidate ID (e.g., `"abc123def456"`). |

### Examples

```lua
local result = app.integrations.workable.get_candidate({
  id = "abc123def456"
})

print(result.name)
print(result.email)
print(result.stage)
print("Applied: " .. result.applied_at)
print("Phone: " .. (result.phone or "N/A"))
```

---

## list_members

List all team members in your Workable account.

### Parameters

This function takes no parameters.

### Examples

```lua
local result = app.integrations.workable.list_members()

for _, member in ipairs(result.members or {}) do
  print(member.name .. " - " .. member.email .. " (" .. (member.role or "member") .. ")")
end
```

---

## get_current_user

Get the profile of the currently authenticated Workable user.

### Parameters

This function takes no parameters.

### Examples

```lua
local result = app.integrations.workable.get_current_user()

print("Logged in as: " .. result.name)
print("Email: " .. result.email)
print("Role: " .. (result.role or "unknown"))
```

---

## Multi-Account Usage

If you have multiple Workable accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.workable.list_jobs({})

-- Explicit default (portable across setups)
app.integrations.workable.default.list_jobs({})

-- Named accounts
app.integrations.workable.us_office.list_jobs({})
app.integrations.workable.eu_office.list_jobs({})
```

All functions are identical across accounts — only the credentials differ.
Metadata-derived Lua example
local result = app.integrations.workable.list_jobs({state = "example_state", limit = 1, offset = 1})
print(result)

Functions

list_jobs Read

List jobs from your Workable account. Optionally filter by state (published, draft, closed, archived). Returns paginated results with job titles, shortcodes, and statuses.

Lua path
app.integrations.workable.list_jobs
Full name
workable.workable_list_jobs
ParameterTypeRequiredDescription
state string no Filter by job state: "published", "draft", "closed", or "archived". Omit to list all jobs.
limit integer no Number of results per page (default: 50, max: 100).
offset integer no Offset for pagination — pass the value from a previous response to get the next page.
get_job Read

Get full details for a specific Workable job by its shortcode. Returns title, description, department, location, employment type, salary, and application counts.

Lua path
app.integrations.workable.get_job
Full name
workable.workable_get_job
ParameterTypeRequiredDescription
shortcode string yes The job shortcode identifier (e.g., "GROVF002").
create_job Write

Create a new job posting in Workable. Specify the title, description, department, and employment type. The job is created in draft state by default.

Lua path
app.integrations.workable.create_job
Full name
workable.workable_create_job
ParameterTypeRequiredDescription
title string yes Job title (e.g., "Senior Backend Engineer").
description string yes Full job description in HTML or plain text.
department string no Department name (e.g., "Engineering").
employment_type string no Employment type: "full-time", "part-time", "contract", "temporary", "intern".
list_candidates Read

List candidates for a specific Workable job. Returns paginated results with candidate names, emails, stages, and applied dates.

Lua path
app.integrations.workable.list_candidates
Full name
workable.workable_list_candidates
ParameterTypeRequiredDescription
shortcode string yes The job shortcode to list candidates for (e.g., "GROVF002").
limit integer no Number of results per page (default: 50, max: 100).
offset integer no Offset for pagination — pass the value from a previous response to get the next page.
get_candidate Read

Get full details for a specific Workable candidate by ID. Returns profile info, resume, cover letter, application stage, and activity history.

Lua path
app.integrations.workable.get_candidate
Full name
workable.workable_get_candidate
ParameterTypeRequiredDescription
id string yes The candidate ID (e.g., "abc123def456").
list_members Read

List all team members in your Workable account, including recruiters and hiring managers. Returns names, emails, and roles.

Lua path
app.integrations.workable.list_members
Full name
workable.workable_list_members
ParameterTypeRequiredDescription
No parameters.
get_current_user Read

Get the profile of the currently authenticated Workable user. Useful for verifying credentials and identifying who the API is acting as.

Lua path
app.integrations.workable.get_current_user
Full name
workable.workable_get_current_user
ParameterTypeRequiredDescription
No parameters.