# Convex

> Work with your Convex backend: run your app's queries, mutations and actions, read tables and documents, manage environment variables, check usage and the audit log, pause or resume the deployment, and start workflows when documents are added, changed or deleted.

App · 15 actions. Web page: https://docs.lodol.com/docs/integrations/convex

## Actions

### Count documents

Count the documents in a table.

**Inputs**

- Table (`table`, text, required): The table. Pick one, or type its name.

**Outputs**

- `count` (number): How many documents it holds
- `table` (text): The table counted

**Example output**

```json
{
  "count": 42,
  "table": "tasks"
}
```

### Delete environment variable

Remove an environment variable from your deployment.

**Inputs**

- Name (`name`, text, required): The environment variable's name. Pick one, or type it.

**Outputs**

- `deleted` (true/false): False if there was no such variable
- `name` (text): The variable's name

**Example output**

```json
{
  "deleted": true,
  "name": "SITE_URL"
}
```

### Get deployment info

Get which deployment this is (production, development or preview), its project, and the addresses its functions and HTTP actions are served at.

**Inputs**: None.

**Outputs**

- `deployment_id` (number): The deployment's id
- `deployment_type` (text): prod, dev, preview or custom
- `deployment_url` (text): Where its functions are served
- `http_actions_url` (text): Where its HTTP actions are served
- `kind` (text): cloud or self_hosted
- `project_id` (number): The project's id
- `project_name` (text): The project's name
- `project_slug` (text): The project's slug
- `reference` (text): The deployment's reference, if it has one
- `team_id` (number): The team's id

**Example output**

```json
{
  "deployment_id": 12345,
  "deployment_type": "prod",
  "deployment_url": "https://happy-otter-123.convex.cloud",
  "http_actions_url": "https://happy-otter-123.convex.site",
  "kind": "cloud",
  "project_id": 678,
  "project_name": "My app",
  "project_slug": "my-app",
  "reference": null,
  "team_id": 90
}
```

### Get usage

Get how much the deployment has used today and this month: function calls, database and file bandwidth, compute and more.

**Inputs**: None.

**Outputs**

- `complete` (true/false): False while Convex is still adding up the period, so the numbers may be low
- `count` (number): How many
- `metrics` (list): Each metric

**Example output**

```json
{
  "complete": true,
  "count": 1,
  "metrics": [
    {
      "metric": "functionCalls",
      "this_month": 35000,
      "today": 1200,
      "unit": "calls"
    }
  ]
}
```

### List audit log events

List changes made to the deployment, oldest first: code pushed, environment variables changed, data edited in the dashboard and more, with who made each. Needs a Convex Pro plan.

**Inputs**

- Since (`since`, date and time): Only changes made at or after this time. Defaults to the last 24 hours.
- Page size (`limit`, number): How many to return, 1 to 100. Defaults to 100. From 1 to 100.
- Next page cursor (`cursor`, text): The 'next_cursor' from an earlier page, with the same Since, to get the page after it.

**Outputs**

- `count` (number): How many
- `events` (list): The changes
- `has_more` (true/false): True if there are more
- `next_cursor` (text): Give this as Next page cursor for more; empty at the end

**Example output**

```json
{
  "count": 1,
  "events": [
    {
      "action": "update_environment_variable",
      "actor": "member 1234",
      "client_ip": null,
      "created_at": "2026-10-30T09:00:00.000Z",
      "metadata": {
        "variable_name": "SITE_URL"
      }
    }
  ],
  "has_more": false,
  "next_cursor": ""
}
```

### List documents

List a table's documents, newest first unless you choose oldest first. Returns one page; pass 'next_cursor' as Next page cursor for more.

**Inputs**

- Table (`table`, text, required): The table. Pick one, or type its name.
- Order (`order`, text): By when each document was created. One of: `desc` (Newest first (default)), `asc` (Oldest first). Default: `desc`.
- Page size (`limit`, number): How many documents to return, 1 to 1,000. Defaults to 100. From 1 to 1000.
- Next page cursor (`cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many documents are on this page
- `documents` (list): The documents, with all their fields
- `is_done` (true/false): True when there are no more documents
- `next_cursor` (text): Give this as Next page cursor for the next page; empty at the end
- `table` (text): The table read

**Example output**

```json
{
  "count": 1,
  "documents": [
    {
      "_creationTime": 1793594393943.69,
      "_id": "j57739me76acsgqhajbt73mb2h8hfwre"
    }
  ],
  "is_done": true,
  "next_cursor": "",
  "table": "tasks"
}
```

### List environment variables

List your deployment's environment variables (the settings your functions read with process.env) and their values.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `variables` (list): The variables, by name

**Example output**

```json
{
  "count": 1,
  "variables": [
    {
      "name": "SITE_URL",
      "value": "https://example.com"
    }
  ]
}
```

### List functions

List the queries, mutations and actions deployed in your app, with the arguments each takes and whether it is public or internal.

**Inputs**

- Kind (`function_type`, text): Only functions of this kind. Leave empty for all. One of: `query` (Queries), `mutation` (Mutations), `action` (Actions).

**Outputs**

- `count` (number): How many
- `functions` (list): The functions

**Example output**

```json
{
  "count": 1,
  "functions": [
    {
      "arguments": [
        {
          "name": "text",
          "optional": false,
          "type": "string"
        }
      ],
      "name": "tasks:add",
      "required_arguments": [
        "text"
      ],
      "type": "mutation",
      "visibility": "public"
    }
  ]
}
```

### List tables

List the tables in your deployment's database.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `tables` (list): The tables

**Example output**

```json
{
  "count": 1,
  "tables": [
    {
      "name": "tasks"
    }
  ]
}
```

### Pause deployment

Stop the deployment running any functions, including scheduled ones and cron jobs, until it is resumed. No data is lost; calls to it fail while it is paused.

**Inputs**: None.

**Outputs**

- `paused` (true/false): Always true

**Example output**

```json
{
  "paused": true
}
```

### Resume deployment

Let a paused deployment run functions again; scheduled functions that waited run now. Nothing changes if it isn't paused.

**Inputs**: None.

**Outputs**

- `paused` (true/false): Always false
- `was_paused` (true/false): False if it was already running

**Example output**

```json
{
  "paused": false,
  "was_paused": true
}
```

### Run action

Run one of your app's action functions with arguments, such as one that calls another service, and return what it returns. An action can run for up to ten minutes.

**Inputs**

- Action (`function`, text, required): The action to run. Pick one, or type its name as your code names it, such as emails:send.
- Arguments (`arguments`, object): The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.

**Outputs**

- `function` (text): The function that ran, such as tasks:list
- `log_lines` (list): What the function logged with console.log
- `value` (object): What the function returned: any value, list or object

**Example output**

```json
{
  "function": "emails:send",
  "log_lines": [],
  "value": {
    "sent": true
  }
}
```

### Run mutation

Run one of your app's mutation functions with arguments, such as one that adds or changes documents, and return what it returns.

**Inputs**

- Mutation (`function`, text, required): The mutation to run. Pick one, or type its name as your code names it, such as tasks:add.
- Arguments (`arguments`, object): The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.

**Outputs**

- `function` (text): The function that ran, such as tasks:list
- `log_lines` (list): What the function logged with console.log
- `value` (object): What the function returned: any value, list or object

**Example output**

```json
{
  "function": "tasks:add",
  "log_lines": [],
  "value": "j57739me76acsgqhajbt73mb2h8hfwre"
}
```

### Run query

Run one of your app's query functions with arguments and return what it returns. Queries only read data.

**Inputs**

- Query (`function`, text, required): The query to run. Pick one, or type its name as your code names it, such as tasks:list.
- Arguments (`arguments`, object): The arguments to pass, by name, such as {"text": "Hello"}. Leave empty for a function that takes none.

**Outputs**

- `function` (text): The function that ran, such as tasks:list
- `log_lines` (list): What the function logged with console.log
- `value` (object): What the function returned: any value, list or object

**Example output**

```json
{
  "function": "tasks:list",
  "log_lines": [],
  "value": [
    {
      "_creationTime": 1793594393943.69,
      "_id": "j57739me76acsgqhajbt73mb2h8hfwre"
    }
  ]
}
```

### Set environment variable

Add an environment variable to your deployment, or change its value. Your functions see the new value straight away.

**Inputs**

- Name (`name`, text, required): The variable's name: letters, digits and underscores, starting with a letter, such as SITE_URL.
- Value (`value`, text, required): The value to give it.

**Outputs**

- `created` (true/false): True if it is new, false if it changed
- `name` (text): The variable's name
- `value` (text): Its value now

**Example output**

```json
{
  "created": true,
  "name": "SITE_URL",
  "value": "https://example.com"
}
```
